jeu. 13 juin 2019, 11h09
GLS
France
atoutfox.public.association
Re: Report Blob Image
Bonjour,
Ce code, une fois les erreurs de syntaxe corrigées, ne rendra pas le service escompté.
Pour imprimer dans un REPORT ou un LABEL, une ou plusieurs images pour plusieurs enregistrements d'une table / curseur, il faut:
- soit avoir dans le table curseur un ou plusieurs champs GENERAL dans lequel / lesquels sera indiqué / stocké le fichier image et ajouter dans le REPORT, LABEL un objet OLE pour chaque image / champ GENERAL
- soit utiliser une classe dérivée de la classe _REPORTLISTENER, classe dérivée dans laquelle a été ajouté les propriétés et les méthodes:
MyReportListener.graphpictureval = ''
MyReportListener.InitObjetGraph()
LPARAMETERS p_Field_graph
* Ajout d'un objet ObjetImage basé sur la classe de base IMAGE
* pour permettre le lien entre le REPORT et la classe ReportListener
* afin d'imprimer les images contenues dans le champ BLOB (p_field_graph)
WITH m.THIS
.graphpictureval = m.p_Field_graph
.objetGraph = NEWOBJECT('img')
.objetGraph.PICTUREVAL = m.p_Field_graph
ENDWITH
MyReportListener.objetgraph=''
MyReportListener.LoadObject()
LPARAMETERS oData AS OBJECT
LOCAL oXML AS MSXML2.DomDocument;
, oNode AS OBJECT;
, cClass AS STRING
** Add a custom handler property to hold handler object
ADDPROPERTY(m.oData, "oHandler", NULL)
** Read custom metadata to determine if a custom
** handler object is needed
IF NOT EMPTY(m.oData.STYLE)
oXML = CREATEOBJECT("MSXML.DomDocument")
IF oXML.LOADXML(m.oData.STYLE)
oNode = oXML.selectSingleNode("*/rptctrl")
IF NOT ISNULL(m.oNode)
cClass = LOWER(oNode.getAttribute("class"))
oData.oHandler = CREATEOBJECT(m.cClass, m.This, m.oData, m.oNode)
ENDIF
ENDIF
ENDIF
oXML = NULL
avant de reprendre l'exemple d'utilisation depuis
http://www.atoutfox.org/nntp.asp?ID=0000012405Cordialement
GLS
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000019404