erzfezsf

hello

the scenario is the folloing :
i have designed a report with several subreports and input parameters. it is deployed to the report server.

the main report only renders the subreports and only has datasources for the multi valued parameters.
now I would like to run and export this report as PDF from within a WinForms application programmatically.

I am looking for any examples, sample code or reference, that could help.

thanks



Re: Visual Studio Report Controls programmatically render and export as PDF

Donovan Smith - MS

One option is to use URL Access to request the PDF file from the report server. For example:

http://server/ReportServer /Folder/Report&rs:Command=Render&rs:Format=PDF&Param1=Value1

Thank you.






Re: Visual Studio Report Controls programmatically render and export as PDF

erzfezsf

thanks for your help,

so it's only a question of building the url string with all the needed parameters

i suppose the Param1 stands for a report parameter

thanks





Re: Visual Studio Report Controls programmatically render and export as PDF

jfkrueger

I don't see how calling up a URL programatically exports a report, I would think this would just bring it up for viewing and the user would have to manually export. Isn't there a way to actually export the report to a .pdf file programatically I could be wrong, but would like some clarification.

Thanks!





Re: Visual Studio Report Controls programmatically render and export as PDF

erzfezsf

i have found the folliowing article
http://www.codeproject.com/sqlrs/PDFUsingSQLRepServices.asp




Re: Visual Studio Report Controls programmatically render and export as PDF

jfkrueger

Very nice,

I will have to try to convert to vb.net but I'll update the post here with my results.

Thanks again!





Re: Visual Studio Report Controls programmatically render and export as PDF

Brian Hartman - MSFT

You can render programmatically by calling ReportViewer.LocalReport.Render() or ReportViewer.ServerReport.Render() and specifying "PDF" as the render format. www.gotreportviewer.com has a sample that exports to Excel, but the code is essentially the same, just a different format parameter.



Re: Visual Studio Report Controls programmatically render and export as PDF

jfkrueger

Thanks Brian,

That is a much better solution! I am not exactly to the point where I can try it yet but should be there this week sometime. All references I saw that used the "render" method stated that it was being rendered as an image, so if I can pass in the format as a parameter that is great! I will update my post on here and mark the answer that works best for me, which I really hope is this one!

Thanks again!

Joe





Re: Visual Studio Report Controls programmatically render and export as PDF

jfkrueger

The link to the code project article was a great start, however I am getting a MissingSessionIdException error when using the InvokeWebService activity to call the SetExecutionParameters method of the ReportExecutionService. I have two InvokeWebService activities that call the same web service but different methods. I have the same GUID as the SessionID property of both of the InvokeWebService activities, but I still get this error on the second activity. Why is it throwing this error when the SessionID is supplied I can even step through the invoking handler and add the SessionID of the activity to the watch list and it shows up as the entered GUID, but it still throws this error.

Both of these activities need to share a session in order for it to work, how can I accomplish this

Thanks again!