Reputation: 3113
I tried to be the most descriptive I could.
Ok, so since I've never done anything like this before, I guess it's better to ask before starting at all to just don't get the whole process wrong.
We have a report that has to be called from an ASP.NET application, it could be a simple button. Through the code-behind, I gotta pass in a paramater, render the report, and don't save it anywhere, just open it to the user, as a .pdf file so he could save or print it. So please, give me links or tips, I'm reading MSDN documentation right now...
If you have any suggestion on other technologies, as for the report, I'd like to hear it, but it has to be called from ASP.NET.
Thanks in advance!
EDIT:
Now I've got the report done, I just need to know the best aproach to call it. It can't be done directly from an URL because that allows the user to save or close the pdf file, which is not what I want.
I'm starting to think that the best aproach to achieve this would be the following: I render the PDF programatically, and create the .PDF file in a temporary folder inside my app structure, then start a new thread to open the file, and wait for the user to close it, when he does, I delete the file and the thread is dead.
What do you guys think? Do y'all have a better option?
Upvotes: 2
Views: 13756
Reputation: 3113
If you check the edit history, you'll see that I changed this completely.
Again, answering my own question:
The aproach I considered the best for doing this was:
Hope this helps if someone has to do the same.
Upvotes: 2
Reputation: 38238
Well, if the report's on the report server, probably the easiest way is just to send the user to a URL that will generate the report as needed. Try something like this in your browser 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
See this knowledge base article on Report Server URLs for more details. Edit: Starting here on MSDN might help.
Upvotes: 9