This is a migrated thread and some comments may be shown as answers.

Report export after second render with different parameters

1 Answer 24 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
IT
Top achievements
Rank 1
IT asked on 19 Jun 2013, 06:48 PM

i have created a reportserver. This allows to display several independant reports in the browser.
The initial reportparameters are filled in with values from the url
but those parameters can be changed.
when i export the second render result (with different parameter values) to pdf in the code behind, it always saves the document with the initial report parameters.
when i use the export function from the reportviewer, it is correct

Dim succesful As Boolean = False

try

 Dim reportProcessor As New Processing.ReportProcessor()

 Dim instanceReportSource As New InstanceReportSource()

 instanceReportSource = ReportSelection(true)

 Dim result As Processing.RenderingResult = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo)

 Dim fileName As String '= result.DocumentName + "." + result.Extension

 Dim directoryPath As String = servername.MapPath("../docs/")

 

 Dim contextDirectory As New DirectoryInfo(directoryPath)

 If contextDirectory.Exists Then

 Else

 contextDirectory.Create()
end If

 Using fs As New System.IO.FileStream(directoryPath & fileName, System.IO.FileMode.Create)

 fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length)

 fs.Close()

 

end Using


any suggestions?

 

 

 

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 24 Jun 2013, 04:42 PM
Hello Stijn,

From your code snippet it is not clear what is assigned to the InstanceReportSource and how parameters are passed to the report definition. Notice report parameters values can be passed through the report source object. Also if you use the parameters in the report's events, their current values can be taken from the processing equivalent of the report as explained in the Using Report Events help article.

If you need further help, let us know the report definition, how report parameters are used and set.

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Tags
General Discussions
Asked by
IT
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or