Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Embedded scripts does not work when Run->View Report->as PDF (Script and PDF )
Embedded scripts does not work when Run->View Report->as PDF [message #1830140] Fri, 17 July 2020 19:15 Go to next message
Elizabet Gonzalez is currently offline Elizabet GonzalezFriend
Messages: 5
Registered: July 2020
Junior Member
I have a problem when try to generate a report as PDF using genReport.sh or directly from the IDE when run as PDF; the embedded scripts doesn't work.
See the attached report example, that works if generated as html but does not show the message if run as PDF
Re: Embedded scripts does not work when Run->View Report->as PDF [message #1830169 is a reply to message #1830140] Sun, 19 July 2020 00:50 Go to previous messageGo to next message
Colin Sutton is currently offline Colin SuttonFriend
Messages: 121
Registered: July 2009
Senior Member
The master page is a template for a page, your report has no page, no body.
Re: Embedded scripts does not work when Run->View Report->as PDF [message #1830214 is a reply to message #1830169] Mon, 20 July 2020 20:45 Go to previous messageGo to next message
Elizabet Gonzalez is currently offline Elizabet GonzalezFriend
Messages: 5
Registered: July 2020
Junior Member
Hi Colin,

Thank you for your answer.

I just created a simple report to show our issue. It is the same behavior when we put something in the page. My guess is that nothing related with script work in pdf. The very same code works for web. See attachments

I do not know if we are missing some configuration. We are using BIRT 4.8

Thank you

Regards,
Elizabet
  • Attachment: web.png
    (Size: 5.91KB, Downloaded 69 times)
  • Attachment: view_as_pdf.png
    (Size: 6.45KB, Downloaded 63 times)
Re: Embedded scripts does not work when Run->View Report->as PDF [message #1831110 is a reply to message #1830214] Tue, 11 August 2020 20:23 Go to previous messageGo to next message
Thomas Gutmann is currently offline Thomas GutmannFriend
Messages: 21
Registered: April 2020
Junior Member
Hello Elizabet,

this isn't an issue it works like designed.
Both methods onPageStart() and onPageEnd() works onl if 2 BIRT-engine tasks RUN & RENDER are executetd - see: https://www.eclipse.org/birt/phoenix/project/notable2.5.php

But these both processing are only given on client side if you create the preview (HTML) and afterwards the PDF-document.
If you start the PDF-generation from eclipse directly only the RENDER-Task will started without the RUN-Task.

Kind regards
Re: Embedded scripts does not work when Run->View Report->as PDF [message #1831159 is a reply to message #1831110] Wed, 12 August 2020 15:37 Go to previous messageGo to next message
Elizabet Gonzalez is currently offline Elizabet GonzalezFriend
Messages: 5
Registered: July 2020
Junior Member
Hi Thomas, thank you for your answer.

I understand now what is happening, but still it seems a little weird that design decision, because I always expected the same result for my report does not matter if I run it from the web view or from the IDE.

The problem is that I'm using a job to generate the report, for this I use the genReport.sh script and it behave like running it from the IDE. Is there a way to generate a report in the backend without using any web browser client? (where the events are executed).

For now the only way I can think of is creating a new java console app that use the Run & Render tasks. Of course I would prefer to use the genReport.sh that comes with the BIRT installation.

Thanks again for your answer.

Regards,
Elizabet
Re: Embedded scripts does not work when Run->View Report->as PDF [message #1831163 is a reply to message #1831159] Wed, 12 August 2020 18:21 Go to previous messageGo to next message
Thomas Gutmann is currently offline Thomas GutmannFriend
Messages: 21
Registered: April 2020
Junior Member
Hello Elizabet,

perhaps you can try the following way to use your shell-script.
The idea is to use 2 calls instead of 1 script call.

Step 1 RUN-Task:
genreport -m run test.rptdesign

Step 2 RENDER_Task:
genreport -m render -f pdf -o output.pdf test.rptdocument

In step 1 the intermediate format .rptdocument-file will be created.
In step 2 the intermediat document will be transformed to a pdf document.

Give it a try and let me know.

Kind regards
Thomas
Re: Embedded scripts does not work when Run->View Report->as PDF [message #1831189 is a reply to message #1831159] Thu, 13 August 2020 08:49 Go to previous messageGo to next message
Colin Sutton is currently offline Colin SuttonFriend
Messages: 121
Registered: July 2009
Senior Member
An alternative, if the html output from genreport is acceptable, would be to convert it using the converter from https://wkhtmltopdf.org/downloads.html
I have found that does a better job than BIRT's pdf output

[Updated on: Thu, 13 August 2020 08:50]

Report message to a moderator

Re: Embedded scripts does not work when Run->View Report->as PDF [message #1831205 is a reply to message #1831163] Thu, 13 August 2020 16:45 Go to previous messageGo to next message
Elizabet Gonzalez is currently offline Elizabet GonzalezFriend
Messages: 5
Registered: July 2020
Junior Member
Hi Thomas,

Thank you very much for your answer it works great. There is only one minor issue that you might have also the solution; it is that when I use the
genreport -m render -f pdf -o output.pdf test.rptdocument
it generates a pdf per each page of the report, like output_1.pdf, output_2.pdf...

To solve the problem now, what I'm doing is using pdfunite after the render, but it would be beautiful if there is an argument I can send to the genReport to say that the output is a single pdf file.

Best regards,
Elizabet

[Updated on: Thu, 13 August 2020 16:46]

Report message to a moderator

Re: Embedded scripts does not work when Run->View Report->as PDF [message #1831214 is a reply to message #1831163] Thu, 13 August 2020 20:23 Go to previous message
Elizabet Gonzalez is currently offline Elizabet GonzalezFriend
Messages: 5
Registered: July 2020
Junior Member
Hi Thomas,
I thought that all problems were solved but then I notice that with the
genReport -m render -f pdf
the master page header is not shown in every page, it is weird, the footer is shown but not the header :(

do you have any idea what could be the problem.

Regards,
Elizabet
Previous Topic:2D Datamatix barcode using iText
Next Topic:Count rows in Birt
Goto Forum:
  


Current Time: Fri Apr 26 21:49:50 GMT 2024

Powered by FUDForum. Page generated in 0.03443 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top