cancel
Showing results for 
Search instead for 
Did you mean: 

Generating PDF Reports in Dynpro

Former Member
0 Kudos

I have a need to create and allow downloading reports in PDF format. To create the PDF files I plan on using iText.

My question comes in transferring the PDF files to the client. Is their a way in Dynpro to change the response content type and write the PDF to the response? Or is it possible/better to write the PDF somewhere accessible through a url and forward the request to that address?

I would also like to store the PDFs anyway if possible so that if the same reports is requested multiple times it doesn't have to regenerate the report each time. I am just not sure of what capabilities I have in Dynpro yet for accessing the ServletResponse object or the file system for storing the PDFs.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Brook,

Also, refer to the following thread "Problem with PDF show"

https://www.sdn.sap.com/sdn/collaboration.sdn?node=linkFnode6-1&contenttype=url&content=https://

This will be very much useful.

Regards,

Santhosh.C

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Brooks,

1. You can create the PDF files in a folder (eg. C:\Brooks\Output) in your WAS server.

2. Create a http alias as "brooks" and point it to the output folder.

3. On click of a link or button, open URL of the PDF file.

I hope this is clear, if you need any further clarification do let me know.

Regards,

Santhosh.C

Former Member
0 Kudos

The downside to that is the reports are publicly accessible. I may not want everyone to be able to download all reports. Although I could limit what links are visible to the user, there is nothing stopping them from guessing or otherwise getting hold of links meant for others.

In the past I have written servlets that validate the user's ability to access the file and then set the appropriate content type and transfer the file without the user ever knowing the file name, path on the server, or anything else the file may have come from.

But thank you, that will probably be the route I go. If I do I will come back and give you the full points.

Former Member
0 Kudos

Hi .. You don't have to create any Http Alias , Here is my suggestion ...

1. Create PDF file ( using iText Lib or Fileupload .. ) to a specific folder in WAS server

2. Use the FileDownload UI component to get the file in your WebDynpro Application . Of course , you have to turn on the Authentication property of your WebDynpro Application if you want to know who is using your application and he or she has the right to get the file or not

Sorry for my poor English .. Have a nice day _

Former Member
0 Kudos

Hi,

I tried creating a PDF through ITEXT, it is not working.

Any one has sample code written for WebDynpro Application please let me know,

Thanks

Senthil

Former Member
0 Kudos

Hi,

Its working. I had issues in generating the URL. Now its fixed.

Thanks

Senthil