Hi all,
I need to get a report in PDF format.How to get that.I did the coding but am not getting.The following code i tried am not getting.what is the wrong in this coding.
WebMedRS.ReportingService rs = new WebMedRS.ReportingService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
parametersIn[0] = new ParameterValue();
parametersIn[0].Name = "claimid";
parametersIn[0].Value = Request.QueryString[0].ToString();
ParameterValue[] parametersOut = null;
byte[] result = null;
string reportPath = "/CMS/CmsFrom1";
string format = "Image";
string historyID = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
string[] streamIDs = null;
result = rs.Render(reportPath, format, null, null, parametersIn, null, null, out encoding, out mimeType, out parametersOut, out warnings, out streamIDs);
Response.ClearContent();
Response.AppendHeader("content-length", result.Length.ToString());
Response.ContentType = "application/pdf";
Response.BinaryWrite(result);
Response.Flush();
Response.Close();
Thanks In Advance,
Yours,
Senthil
You will have to change the format:
string format = "PDF";
Jens K. Suessmeyer.
http://www.sqlserver2005.de
No comments:
Post a Comment