I am using this code to generate the pdf from ssrs report. Now i need that after it is being exported it should be shown automatically in any jquery pdf viewer plugin
Code :
public void ExportToPDF(string path, List<ReportParameter> reportParams,string fileName)
{
Warning[] warnings;
string[] streamIds;
string mimeType = string.Empty;
string encoding = string.Empty;
string extension = string.Empty;
// Setup the report viewer object and get the array of bytes
var viewer = new ReportViewer();
viewer.ProcessingMode = ProcessingMode.Remote;
viewer.ServerReport.ReportServerUrl = new Uri("http://localhost/ReportServer");
viewer.ServerReport.ReportPath = "/"+path;
viewer.ServerReport.SetParameters(reportParams);
byte[] bytes = viewer.ServerReport.Render("PDF", null, out mimeType, out encoding, out extension,
out streamIds, out warnings);
// Now that you have all the bytes representing the PDF report, buffer it and send it to the client.
Response.Buffer = true;
Response.Clear();
Response.ContentType = mimeType;
Response.AddHeader("content-disposition", "attachment; filename="+fileName+"." + extension);
Response.BinaryWrite(bytes); // create the file
Response.Flush(); // send it to the client to download
}
jQuery PDF Viewer plugins can be seen here :
http://www.jqueryrain.com/2012/09/best-jquery-pdf-viewer-plugin-examples/
Please help/