it takes me back to the page where I can enter the parameter value and view the report.
I want to avoid this. When I click the back button it should automatically go back to the page I came from.
Any ideas?
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("http://servername/ReportServer?%2ffolder1%2ffolder2%2fMyReport&empType=2");
}You'd have to hit back twice i'd believe. Since the report results is from postback.|||Thats what I wanted to avoid. I don't want to hit back button twice. Any workaround?|||You could render the report on the server side using the SSRS Web Service and just display the results there. I think that would do the trick. But you probably won't be able to enter other parameters.|||Could you elaborate more on this.. what is SSRS Web Service? Could you please explain.|||You use .net code to render the report and write it to the screen. There is a web service that comes with reporting services that allows you to do this.|||
I think you are talking about the code as below.. But I don't want to specify the format.
I want the users to select the format.
// Render arguments
byte[] result = null;
string reportPath = "/My Reports/ReportSample";
string format = "HTML4.0";
string historyID = null;
string devInfo = @."<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
// Prepare report parameter.
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string[] streamIDs = null;
SessionHeader sh = new SessionHeader();
rs.SessionHeaderValue = sh;
try
{
result = rs.Render(reportPath, format, historyID, devInfo, parameters, credentials,
showHideToggle, out encoding, out mimeType, out reportHistoryParameters, out warnings,
out streamIDs);
sh.SessionId = rs.SessionHeaderValue.SessionId;
Debug.Write("SessionID after call to Render: {0}",
rs.SessionHeaderValue.SessionId);
Debug.Write("Execution date and time: {0}",
rs.SessionHeaderValue.ExecutionDateTime);
Debug.Write("Is new execution: {0}",
rs.SessionHeaderValue.IsNewExecution);
}
catch (SoapException ex)
{
Debug.Write(ex.Detail.OuterXml);
}
You can still achieve that. Just set some sort of variable for the format and pass it in as a parameter.
string format = "HTML4.0";
It can be "PDF", "EXCEL", "CSV", "HTMLOWC", and a few others. Just give the users a drop-down of the various choices and pass it as a parameter to the page that renders the report.
|||Go here:
http://forums.asp.net/thread/1412563.aspx
For code if you wish.
No comments:
Post a Comment