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?