Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to save report output into multiple PDF files?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Divers
Thread ID:
00911352
Message ID:
00911776
Vues:
19
Simon,

Is your client also running any VFP R/W Reports? If they're not totally stuck on using Crystal Reports to accomplish this task, you can run all 3000 pages into the Mind's Eye Report Engine and then write each page to a separate PDF file using the SAVETOPDF() Method and then specifying the page number in a loop.
USE ReportCardData.DBF
SET CLASSLIB TO MINDSEYEREPORTENGINE
oReportEngine = CREATEOBJECT('MINDSEYEREPORTENGINE')
oRPT = oReportEngine.ReportFormObject('ReportCardReport.FRX')
FOR lnPageNo = 1 TO oRPT.oReportEngine.nTotalPages
   oRPT.oReportEngine.SaveToPDF('ReportCard'+PADL(lnPageNo,4,'0')+'.PDF',.F.,lnPageNo,lnPageNo)
ENDFOR
You could also use the new method I added while at DevEssentials so that you can now generate a Page or Range of Pages in the Report Engine as a PDF Document returned as a String Variable. For Example:
FOR lnPageNo = 1 TO oRPT.oReportEngine.nTotalPages
   lcPDF = oRPT.oReportEngine.PDFStream(lnPageNo,lnPageNo)  && RETURNS PDF FILE AS A STREAM/STRING
   STRTOFILE(lcPDF,'ReportCard'+PADL(lnPageNo,4,'0')+'.PDF')
ENDFOR
Since the PDF Engine does not go through any printer drivers the output is extremely fast. For an example benchmark, generating a PDF from a 110 page report using MERE's SAVETOPDF() Method took around 2.3 seconds on a 1.6GHz Centrino notebook while printing to the Adobe 6 PDF Writer Printer Driver took around 29 seconds for the same report from the Mind's Eye Report Preview Form.

You can download the Trial Demo from the website and try this concept out and email me directly if you have any questions.

Are you planning on setting any security options so the Ferris Bueller's of the world don't change their grades? <bg>



I have a client who is printing report cards for a school. A VFP table contains all the report card data for each student. The client wants the output to be produced as separate PDF files, one for each student. At present it prints one PDF containing the report cards for each student on a separate page resulting in a 3000 page report.

My question is what settings have to be changed to ensure it prints all the students but saves each students report as a separate PDF file?

Obviously I have not used Crystal Reports before so any tips would be appreciated. The report is written in version 9 using VFP tables as the data source.

I know I could set a parameter for the student number and then run the report specifing a new parameter each time. However, we just want to run the process once and have it produce all the PDF files with correct page numbering.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform