[Ultimate PDF] Can I download a pdf of a screen in background without displaying the screen itself?

Forge Component
(11)
Published on 10 Feb (9 days ago) by Ricardo Costa
11 votes
Published on 10 Feb (9 days ago) by Ricardo Costa

I would like to inquire if this component can build the pdf in background.

I have this screen (preparation and all) that i want to generate reports. Could I download the pdf version of that screen using this component without previewing the screen itself?

I've tried testing it that way, but im getting a "Object reference not set to an instance of an object." error.

I am trying to understand more on how to utilize this component for future applications.

Hi Harold. Can you share the code of how you're trying to generate the PDF?

You should not have an error like that.

Here's my screen.
my goal is to generate reports based on the data from the database. i created the button "Generate Report" with an action to PrintPDF based on the sample in this component.


this is what i get when i click on the button:


Here're my code blocks:



This is the screen i that will generate the report which i intended to use PrintPDF:


and here are the error stack from logs: i get 2 logs everytime.



did i implement it correctly on my app?

Thanks!

It looks correct, but I've noticed you're using IsReactive = True. Please set it to False, and see if that works.

it does proceed but i get an error "Invalid URI" instead.

d:
ef78603c-3e19-4b6e-8cc4-559e031c315d
Time of Log:
2019-12-18 05:52:35
Request Key:ccac095d-7af0-4c6f-b7f7-5db04465d3b4
Module:
RoomManagementSystem
Tenant:
Users
User:
 (5)
Session Id:
A2Su0KgCrEuogf6WNd8Vig==
Server:
S6C84-LT81RN
Module:

Message:


Invalid URI: The format of the URI could not be determined.


Environment InformationeSpaceVer: Id=298, PubId=0, CompiledWith=11.0.606.0
RequestUrl: https://haroldstephen-sierra.outsystemscloud.com/RoomManagementSystem/BookingInfo.aspx (Method: POST)
AppDomain: /LM/W3SVC/37/ROOT/RoomManagementSystem-69-132211219409056706
FilePath: C:\OutSystems\Sandboxes\VA7WBT034\Platform Server\running\RoomManagementSystem\BookingInfo.aspx
ClientIp: 103.219.71.206
Locale: en-US
DateFormat: yyyy-MM-dd
PID: 27576 ('w3wp', Started='12/10/2019 3:34:08 AM', Priv=576Mb, Virt=2115790Mb)
TID: 31
Thread Name:
.NET: 4.0.30319.42000
Stack:
Invalid URI: The format of the URI could not be determined.
   at ssRoomManagementSystem.RssExtensionUltimatePDF.MssPrintPDF(HeContext heContext, String inParamURL, IRecord inParamViewport, IRecord inParamPaper, Int32 inParamBrowserRevision, Boolean inParamReuseSession, Boolean inParamIsReactive, Byte[]& outParamPDF)
   at ssRoomManagementSystem.Flows.FlowMainFlow.ScrnBookingInfo.CommandGenerateReport(HeContext heContext)


i've debugged and checked that the URL should be correct ("/RoomManagementSystem/BookingReports.aspx")

Harold Stephen Sierra wrote:

I would like to inquire if this component can build the pdf in background.

I have this screen (preparation and all) that i want to generate reports. Could I download the pdf version of that screen using this component without previewing the screen itself?

I've tried testing it that way, but im getting a "Object reference not set to an instance of an object." error.

I am trying to understand more on how to utilize this component for future applications.


Hi,

I have Used HTMLtoPDF convertor, and achivedthis by connecting screen(that I wanted to download as PDF) with an entry point. 

and used action like this

pass all the required parameters inthe GEtEntryURL server action, and in generate url , entered this code

 

MakeAbsoluteURL(GetEntryURL.URL)

In this way I am able to download PDF without  preview with single click.

That may help you also

Regards

Seema