I have an old app in VFP 9 to print certificate of analysis in PDF, then it’s send to the customer as an e-mail attachment. The process is very automated and the user only have to acknowledge the message and it is sent automatically.
Now, sometimes the Certificate produce in PDF is empty. We think it’s probably a human error in the laboratory but the person in charge of sending the document is not able to verify the content of each certificate for one order.
I’m using very simple code to create the Crystal object (RDC), changing some properties and export it in PDF format.
I know, in the “craxddrt.dll” lib. there is an event called “NoData” but I never program classes with session OLEPUBLIC and Implement in VFP.
I’d like to have, if possible, some examples on how to instantiate a Crystal report object and override the NoData event so I’ll be able to tell my user that the document he’s about to send is empty.
Thanks for your advice and your time.
Nro
Now, sometimes the Certificate produce in PDF is empty. We think it’s probably a human error in the laboratory but the person in charge of sending the document is not able to verify the content of each certificate for one order.
I’m using very simple code to create the Crystal object (RDC), changing some properties and export it in PDF format.
Code:
FUNCTION EprtReport(tcReport AS String, ;
tnCROpenReportMethod AS Integer)
loCrystalReport = NEWOBJECT("CrystalRuntime.Application.11")
loRep = loCrystalReport.OpenReport(tcReport, tnCROpenReportMethod)
*
* Set some prop.
*
loRep.Expport(.F.)
I know, in the “craxddrt.dll” lib. there is an event called “NoData” but I never program classes with session OLEPUBLIC and Implement in VFP.
Code:
DEFINE CLASS myCrClass AS session OLEPUBLIC
IMPLEMENTS IReportEvent IN "..\bin\craxddrt.dll"
PROCEDURE IReportEvent_NoData(;
pCancel AS LOGICAL) AS VOID;
HELPSTRING "Fires this event when there is no data"
* add user code here
ENDPROC
PROCEDURE IReportEvent_BeforeFormatPage(;
PageNumber AS Number) AS VOID;
HELPSTRING "Fires this event before formatting a page"
* add user code here
ENDPROC
PROCEDURE IReportEvent_AfterFormatPage(;
PageNumber AS Number) AS VOID;
HELPSTRING "Fires this event after formatting a page"
* add user code here
ENDPROC
PROCEDURE IReportEvent_FieldMapping(;
reportFieldArray AS VARIANT, ;
databaseFieldArray AS VARIANT, ;
useDefault AS LOGICAL) AS VOID
HELPSTRING "If database is changed while verifing database"
* add user code here
ENDPROC
ENDDEFINE
I’d like to have, if possible, some examples on how to instantiate a Crystal report object and override the NoData event so I’ll be able to tell my user that the document he’s about to send is empty.
Thanks for your advice and your time.
Nro