Last post Aug 16, 2011 05:36 PM by TP
Aug 12, 2011 09:43 AM|HardingR|LINK
I have an ASP.NET app which uses the ReportViewer and the codebehind builds the parameters based on parameters selected in the ASP form. Some of these parameters are multi-select parameters. My code works fine when only one value for each parameter is selected,
but when any of the parameters have multiple items selected the ReportViewer does not generate anything.
I have three questions:
1) I build the parameters using the Microsoft.Reporting.WebForms.ReportParameter(parmname,
parmvalue) functionality and then issueing the
.ServerReport.SetParameters(rptParam) command. How can I get the entire URL that has been generated and print it to the Immediate Window? (See item 2 below)
2) How can I print the URL to the Immediate Window? Attempts to print other things to the Immediate Window have not produced any results. I have tried Debug.Print, Debug.Write, Command.Write, and a number of variations I have found on the internet. Nothing
3) Currently the ReportViewer is located on the form with the parameter selection values. I have a button which runs some validation code and then builds the report url and invokes the ReportViewer. I would like to place the ReportViewer on a seperate form
and open it in a separate window. How do I do this?
Aug 15, 2011 11:41 AM|HardingR|LINK
I have resolved Item 2 in my original post. I had to include "Imports System.Diagnostics.debug"
in my code.
I still do not know how to get the entire URL (server, path, and parameters) that is being passed
to the ReportViewer and I do not fully understand what I am going to have to do to open the ReportViewer in a new window.
Can anyone help?
Aug 16, 2011 08:01 AM|TP|LINK
It should be straight forward to open the webpage which contains the report viewer in a new page. To make things easy use this ResponseHelper class courtesy
http://yaneshtyagi.blogspot.com/2007/10/redirecting-to-new-window-in-c.html and do something like this :
ResponseHelper.Redirect("YourReportViewPage.aspx", "_blank", null);
Aug 16, 2011 02:09 PM|HardingR|LINK
The codebehind my current webpage, which contains the ReportViewer (MyReportViewer) object, builds the URL with required parameters using the following simplified code:
MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote
Currently the above code and the MyReportViewer object are located on TrSumReports.aspx web form, is it possible to get the TrSumReports.aspx to initiate a different aspx window and then issue the MyReportViewer commands above to this new object? If so,
can you give me some idea of the code needed to do this?
Aug 16, 2011 05:36 PM|TP|LINK
When you click on the button which generates the report (assuming this is a different page from the TrSumReports.aspx) ,
on the click event of the button , use reponsehelper to redirect to TrSumReports.aspx in a new window and it should be ok.