Welcome! Log In Create A New Profile

Advanced

Issue generating PDF report under WEBDEV

Posted by PETER ZHOU 
PETER ZHOU
Issue generating PDF report under WEBDEV
September 05, 2019 05:58PM
Hi,

// Create a unique file name
sFile1 is string = fDataDir()+“\”+DateSys()+TimeSys()+“.pdf”
// Print the report in a PDF file
iDestination(iPDF, sFile1)
iInitReportQuery(RPT_Letterhead, TABLE.COL_ID)
// Generate the report
iPrintReport(RPT_Letterhead)
// Display the report in PDF format
FileDisplay(sFile1, “application/pdf”,"Letterhead" + Today() + ".pdf")
//FileDisplay(sFile1, “application/pdf”)
// Delete the file
fDelete(sFile1)

How do i generate a second report after this report under WEBDEV ?

Regards,

PETER ZHOU
PETER ZHOU
Re: Issue generating PDF report under WEBDEV
September 06, 2019 03:41AM
PETER ZHOU Wrote:
-------------------------------------------------------
> Hi,
>
> // Create a unique file name
> sFile1 is string =
> fDataDir()+“\”+DateSys()+TimeSys()+“.pdf”
> // Print the report in a PDF file
> iDestination(iPDF, sFile1)
> iInitReportQuery(RPT_Letterhead, TABLE.COL_ID)
> // Generate the report
> iPrintReport(RPT_Letterhead)
> // Display the report in PDF format
> FileDisplay(sFile1, “application/pdf”,"Letterhead"
> + Today() + ".pdf")
> //FileDisplay(sFile1, “application/pdf”)
> // Delete the file
> fDelete(sFile1)
>
> How do i generate a second report after this
> report under WEBDEV ?
>
> Regards,
>
> PETER ZHOU

Hi,

Maybe i didn't state clearly my scope.
The above code snippet generate a pdf report.
Is there anyway to generate 1 pdf report follow by another pdf report ( a different report ) under WEBDEV?

Regards,

PETER ZHOU
Re: Issue generating PDF report under WEBDEV
September 06, 2019 03:24PM
Hi Peter,

I think the thing that might be confusing people is... why don't you just repeat the code for your 2nd report?

I feel there is still something about your specific requirement you're not telling us?

e.g. what is the problem you are encountering or what is stopping you producing your 2nd report???

Regards,
Darren.
PETER ZHOU
Re: Issue generating PDF report under WEBDEV
September 06, 2019 04:54PM
DarrenF Wrote:
-------------------------------------------------------
> Hi Peter,
>
> I think the thing that might be confusing people
> is... why don't you just repeat the code for your
> 2nd report?
>
> I feel there is still something about your
> specific requirement you're not telling us?
>
> e.g. what is the problem you are encountering or
> what is stopping you producing your 2nd report???

Hi Darren,

For webdev, any command after FileDisplay and Fdelete, it will ignore any request/command after these.
Have you have used these 2 commands before ?


Regards,

PETER ZHOU
pao
Re: Issue generating PDF report under WEBDEV
September 06, 2019 05:46PM
Ok now i think i get it.
The problem is with the download of the files and not the generation.


The easier way is to generate the two pdf files, put them in one ZIP and FileDisplay of the ZIP instead of the PDFs
Other option, generate the two pdf files, merge them in one PDFMerge and FileDisplay of the result file

Regards

Paulo Oliveira



Edited 1 time(s). Last edit at 09/17/2019 05:12PM by pao.
PETER ZHOU
Re: Issue generating PDF report under WEBDEV
September 06, 2019 07:22PM
pao Wrote:
-------------------------------------------------------
> Ok now a think i get it.
> The problem is with the download of the files and
> not the generation.
>
>
> The easier way is to generate the two pdf files,
> put them in one ZIP and FileDisplay of the ZIP
> instead of the PDFs
> Other option, generate the two pdf files, merge
> them in one PDFMerge and FileDisplay of the
> result file

Hi Paulo,

Thank you for the suggestion, I will try it out.

I have to thank Darren for asking good question that makes it much easier to understand..

Regards,

PETER ZHOU
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: