Render SSRS.RDL to PDF and just open it.
I tried to be as visual as I could.
Ok, since I've never done anything like this before, I think it's best to ask before starting at all, so as not to just make the whole process go wrong.
We have a report that needs to be called from an ASP.NET application, it could be a simple button. Through the code-behind, I have to go to paramater, make a report and not save it anywhere, just open it to the user as a .pdf file so that he can save or print it. So please give me links or advice, I am reading the MSDN documentation right now ...
If you have any suggestions for other technologies regarding the report, I would love to hear it, but it should be called from ASP.NET.
Thanks in advance!
EDIT:
Now I have a report, I just need to know what is the best way to call it. This cannot be done directly from the URL as it allows the user to save or close the PDF file, which I don't want.
I am starting to think that the best way to achieve this would be this: I make the PDF programmatically and create a .PDF file in a temporary folder inside my application structure and then start a new thread to open the file and wait for the user to close it when he this will do, i delete the file and the thread is dead.
What do you guys think? Do you have a better option?
a source to share
If you check the change history, you can see that I completely changed it.
Again, answering my own question:
The aproy that I thought was the best for this was:
- The presence of the report in the SQL Reporting Services report server;
- Exposing it through code written in .NET and grabbing an array of bytes as a response;
- Writing an array of bytes to Response.OutputStream;
- Adding an attachment header, so the file will be available for download to the user;
Hope this helps if someone needs to do the same.
a source to share
Ok if the report is on the report server, perhaps the easiest way is to just send the user a URL that will generate the report as needed. Try something like this in your browser's address bar to see what I mean:
http://SERVER_NAME/ReportServer/Pages/ReportViewer.aspx?%2fFOLDER_NAME%2fREPORT_NAME&rs:Command=Render&rs:Format=PDF&PARAMETER_NAME=VALUE
For more information, see this Knowledge Base article on Report Server URLs . Edit: Running here on MSDN might help.
a source to share