Javascript RDLC生成PDF
我正在寻找通过RDLC报告生成PDF而不使用Javascript RDLC生成PDF,javascript,c#,angularjs,Javascript,C#,Angularjs,我正在寻找通过RDLC报告生成PDF而不使用reportviewer的指导或想法。PDF必须保存在本地指定的路径中。我已经尝试了一周,但仍然找不到解决方案。希望此链接有帮助 这是如何渲染为pdf。。。为了完整性而更新 private void CreatePDF(string fileName) { // Variables Warning[] warnings; string[] streamIds; string mimeType = string.Empt
reportviewer
的指导或想法。PDF必须保存在本地指定的路径中。我已经尝试了一周,但仍然找不到解决方案。希望此链接有帮助
这是如何渲染为pdf。。。为了完整性而更新
private void CreatePDF(string fileName)
{
// Variables
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
ReportViewer viewer = new ReportViewer();
viewer.ProcessingMode = ProcessingMode.Local;
viewer.LocalReport.ReportPath = "YourReportHere.rdlc";
byte[] bytes = viewer.LocalReport.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
}
解决方案?亲爱的探员,非常感谢你的帮助。我总共有2700名学生。我想为每个学生生成单独的PDF报告。首先,我从表中检索数据并绑定到datasource(类似于生成RDLC的正常过程)。之后,我可以运行下面的代码仪式?虽然这个链接可能有助于案件,链接往往死亡,在这种情况下,你的答案将变得无用。建议添加一点关于链接如何帮助解决我的问题的细节(agent5566)。无论如何,谢谢。该链接帮助我将RDLC转换为PDF。剩下的就是我刚才做的标准代码。