1. Scott
  2. Report Editor
  3. Donnerstag, März 17 2016, 10:26 PM
  4.  Abonnieren via E-Mail
For the pre and post scripts area in the Report editor are they fired per rendering or once before/after the report is generated.

For example:

I preview the report (on average 10-pages) and then in the post script text editor I want to update each line item on the invoice as 'submitted' in the DB. (Client requirement that each line item be accounted for versus the invoice as a whole).

So, if the report is previewed (or generated via PDF via a web browser) as it is rendered by the VStudio engine, is the pre-script area being fired for each page or once when the entire report is done?

Thanks

Scott
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hello, Scott

In short - scripts are not fired for each page.

But that's how it works internally.

Pre-build and post-build scripts are called once per report model generation.

Report model is an internal representation of report and all of its pages, and it is used to render a report to any other format - preview, PDF, HTML...

Model is generated only when it is necessary, and can be reused later multiple times.

If you change some setting, which changes layout of report, during preview (for example, paper orientation, margins), or you change it in code for VReport object - model will be regenerated, so the scripts will be called again.

Example.

You preview the report - and pre-built and post-build scripts are called. You navigate between pages, change zoom, export to PDF, HTML, preview in browser, etc - nothing changes for the model, regeneration doesn't happen and scripts are not called.

Now you change orientation in preview mode - model is marked as to be regenerated, and it will be rebuilt on the first need, so the scripts will be called once again.
Kommentar
There are no comments made yet.
Scott Akzeptierte Antwort
Thanks Sergey.

Can the pre/post scripts be passed parameters? I need a pre/post script to process the data that comes into the report.

For example: During week 11, John Smith works 5 days therefore has five different entries in the DB, each with its unique sequence number. During invoicing, these 5 jobs are retrieved via query and then used on the report (all 5 entries will go on one invoice) I would like to then pre or post, take the individual sequence numbers from that report and mark them as submitted in the DB and the date/time this occurred.

How can I pull data from the report's query and then use it in the pre/post scripts?
Kommentar
There are no comments made yet.
Scott Akzeptierte Antwort
Thanks Sergey.

Can the pre/post scripts be passed parameters? I need a pre/post script to process the data that comes into the report.

For example: During week 11, John Smith works 5 days therefore has five different entries in the DB, each with its unique sequence number. During invoicing, these 5 jobs are retrieved via query and then used on the report (all 5 entries will go on one invoice) I would like to then pre or post, take the individual sequence numbers from that report and mark them as submitted in the DB and the date/time this occurred.

How can I pull data from the report's query and then use it in the pre/post scripts?
Anhänge
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
No, that's currently not possible to use parameters in these scripts.
It was initially implemented as a way to do some initialisation work, set connection variables or properties.

But you generate this report in code, and want to avoid opening an additional connection to mark records as submitted programmatically. Right?
Kommentar
There are no comments made yet.
Scott Akzeptierte Antwort
Yes, I was just trying to off load as much code/logic as I could to the VServer.
Kommentar
There are no comments made yet.
  • Seite :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories