DuncanSutcliffe
Technical User
I have a report displayed in a ASP.Net web page using the CrystalReportViewer. The report content depends on a set of parameters being passed in. The parameters are set using the ParameterValues and ParameterFieldsInfo, and I read in the contents of each parameter from a shared variable.
The shared variables themselves are set from dropdown lists. Selecting a new item from any dropdown does an AutoPostBack. I have proved (trace="true") that the session variables are correctly re-set on this event.
One first launch, the report works perfectly, reading the variables and displaying the correct data. But when a new item is selected and the page is posted back, the parameters do not get re-set and the parameter prompt appears instead. It seems the report source is set and the remainder of the code in the sub is ignored.
In an attempt to solve this, I moved all the report source and report parameter code into Page_Init instead of Page_Load - I think this is what Business Objects actual recommend anyway. I'm now presented with a different problem in that the existing parameters are re-used. But if I click the browser's refresh button, the viewer re-loads using the correct variables. It is as if the report viewer is cacheing the parameters. I've tried using ParameterFieldInfo.Clear at various places (after rendering the viewer, on page_unload, etc.) but to no effect.
In case it has any bearing, the parameter is required as an inbound parameter to the stored procedure (MS SQL Server) that the report is based on - it's not used in any report end Select Expert.
Any solutions or suggestions gratefully received.
TIA
Duncan
The shared variables themselves are set from dropdown lists. Selecting a new item from any dropdown does an AutoPostBack. I have proved (trace="true") that the session variables are correctly re-set on this event.
One first launch, the report works perfectly, reading the variables and displaying the correct data. But when a new item is selected and the page is posted back, the parameters do not get re-set and the parameter prompt appears instead. It seems the report source is set and the remainder of the code in the sub is ignored.
In an attempt to solve this, I moved all the report source and report parameter code into Page_Init instead of Page_Load - I think this is what Business Objects actual recommend anyway. I'm now presented with a different problem in that the existing parameters are re-used. But if I click the browser's refresh button, the viewer re-loads using the correct variables. It is as if the report viewer is cacheing the parameters. I've tried using ParameterFieldInfo.Clear at various places (after rendering the viewer, on page_unload, etc.) but to no effect.
In case it has any bearing, the parameter is required as an inbound parameter to the stored procedure (MS SQL Server) that the report is based on - it's not used in any report end Select Expert.
Any solutions or suggestions gratefully received.
TIA
Duncan