ReportPro 2.x .NET (X# version): PDF creation in non-interactive mode

This forum is the place to discuss issues related to ReportPro, Xs2Ado, Vo2Ado, bBrowser and other 3rd party products
Post Reply
Bernhard Mayer
Posts: 52
Joined: Thu Oct 06, 2016 3:00 pm
Location: Austria

ReportPro 2.x .NET (X# version): PDF creation in non-interactive mode

Post by Bernhard Mayer »

Dear fellow X#'ers!

Currently ReportPro 2x needs at least two environmental prerequisites to get to work: A VO based owner as well as a default printer.

Do you think it might be possible to change the printing process for the creation of PDFs so that both prerequisites are no longer required?

The problem is that we are using more and more "background" tasks for our applications which create RP PDFs, and sometimes there are errors when creating handles in non-interactive sessions where we don't have an idea how to get rid of them although the user accounts launching the tasks ought to have default printer settings as well as enough privileges to create VO windows.

Best regards,
Bernhard
User avatar
robert
Posts: 4552
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

ReportPro 2.x .NET (X# version): PDF creation in non-interactive mode

Post by robert »

Bernhard,
I am really not sure if this can be done without owner and printer.

For the owner you could probably create a "fake" object. We are already wrapping the owner object in a RpReportOwner object inside the PtrDevice class for performance issues (so we can cache method info ).
One place where the owner is used is for the Progress Dialog. But we could probably suppress that when no owner is specified.

The printerdevice is a different thing. The whole printing in Rp2 is done through the PtrDevice object. This object gets the default printer and reads the paper bin names etc.
- this object also allocates the device context that is used for the printing, preview and export
- this device context is passed to all objects in the report
- the output is then saved page by page to a meta file
- after that the meta file is "played" and the preview or export pages are created from the info in the meta file.

In theory we could skip the step of the meta file and directly produce the PDF but that would require a major change.
I do not see that happen in the near future.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Bernhard Mayer
Posts: 52
Joined: Thu Oct 06, 2016 3:00 pm
Location: Austria

ReportPro 2.x .NET (X# version): PDF creation in non-interactive mode

Post by Bernhard Mayer »

Hi Robert!

Thank you for the information resp. for the confirmation of my thoughts that it cannot be done easily as the question originally did come from some colleagues of mine (and I said 'no' :-)).
Meanwhile I got kind of familiar with the RP source code to a certain degree but there's always the chance that I miss something.

BR,
Bernhard
Post Reply