to the SSRS server?
I see ways to get the reports in other formats (html, pdf, etc.), but not a way to get the report in a format that can later be opened with the ReportViewer component.
Thank you in advance for any help!
I see ways to get the reports in other formats (html, pdf, etc.), but not a way to get the report in a format that can later be opened with the ReportViewer component.
Thank you in advance for any help!
I see ways to get the reports in other formats (html, pdf, etc.), but not a way to get the report in a format that can later be opened with the ReportViewer component.
Thank you in advance for any help!
HI All
I want to append current date in exported reported file name.
I am using report viewer to diplay report . when i exported report in pdf format it ask me to save file at this time file name is same what ever i uploaded in report server.
when it ask me to save i want append current date to the file name.
like report file name is "testingdetail" then i want "testingdetail-November-27-2006.pdf"
Please help me in this
Thanks
Alpesh
It appears you can only alter the filename when using subscriptions. (link to related post)
If you find another way to achieve that behavior please let me know.
|||
Hi All
I found another way to append current date to Expoting report file name.
We have to overide the Reder method of reporting service
first we have to add web reference of reporting service then
put below code in button click event
private void lnkexport_Click(object sender, System.EventArgs e)
{
ReportingService rs = new ReportingService();
string reportPath=/SampleDetail/TestingDetail;
// TestingDetail report must uploded in SampleDetail folder in ReportManager
TestingDetailReport testingDetailParams =this.reportParams as TestingDetailReport;
ParameterValue[] parameters = new ParameterValue[1];
parameters[0] = new ParameterValue();
parameters[0].Name="parameterName";
parameters[0].Value=parameterValue;
Byte[] result = this.LoadReport(reportPath,parameters);
string fname = "TestingDetail" + " - " +DateTime.Today.ToString("MMMM-dd-yyyy");
Response.ClearContent();
Response.AddHeader("Content-Disposition","attachment; filename=" + fname);
Response.AddHeader("Content-Length", result.LongLength.ToString());
Response.ContentType="Application/pdf";
Response.BinaryWrite(result);
Response.Flush();
Response.Close();
}
private Byte[] LoadReport(string reportPath,ParameterValue[] parameter )
{
ReportingService rs = new ReportingService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
string[] streamIDs;
string optionalString = null;
ParameterValue[]optionalparams =null;
Warning[] warning = null;
Byte[] output= rs.Render(reportPath,"PDF",null,null,parameter,null,null,out optionalString,out optionalString,out optionalparams,out warning,out streamIDs);
return output;
}
Thanks
Alpesh
sql server tools,sql server