Hi
I've created my report with a parameter and a dependent cascading parameter, this all work fine when I preview the .rdl
It also works fine when I access it through my asp.net application.
When accessed the report via my asp,net application the report prompts the user for both parameters, which, when I enter them, also works fine.
I would like to call the report while passing the first parameter to it so that the user only has to select the second parameter, which is dependent on the first.
The first parameter is stored as a session variable, but I cannot figure out how to pass this as a parameter to the report.
I have embedded a report view as:
rsweb:reportviewer id="ReportViewer1" runat="server" processingmode="Remote" width="795px" Font-Names="Verdana" Font-Size="8pt" Height="764px" ShowExportControls="False" ShowFindControls="False" ShowRefreshButton="False" ShowParameterPrompts="true">
<ServerReport ReportPath="/SubSrvs Reports/SubscribedServices" DisplayName="Confirmation Invoices" />
</rsweb:reportviewer>
Is there a way to pass my session value as a parameter? If so where do I do this pls.
I am not using any code behind at the moment.
I have tried passing it in the url of the page I call e.g. Invoices.aspx?ClientId=?? and in thehttp://localhost/reportserver?ClientId=??? but no luck, oh yes I have also tried surpressing the ShowParameterPrompts of the report view, but again no luck
many thanks
string sessParam = Convert.ToString(Session["myparam"]);
RptParameters[0] =
new Microsoft.Reporting.WebForms.ReportParameter("ClientId", sessParam );
this.ReportViewer1.ServerReport.SetParameters(RptParameters);
this.ReportViewer1.ServerReport.Refresh();
Check a basic tutorial over here:
http://www.codeproject.com/sqlrs/ReportViewer2005.asp
HTH,
Suprotim Agarwal
--
http://www.dotnetcurry.com
--
muchas gracias! that worked a treat, used the C# equivalent and placed in the page load event with a !Page.IsPostBack.
also a very good articlehttp://www.codeproject.com/sqlrs/ReportViewer2005.asp
thanks again
No comments:
Post a Comment