我已经在asp.net中开发了一个小应用程序,我已经根据Telerik报告来获取数据,在aspx中我使用了telerik报告查看器,当我运行并单击按钮时它会生成“ .pdf “文件很好。但是,我想生成.csv文件
这是我的代码(c#)
protected void btndayreport_Click(object sender, EventArgs e)
{
// Clients client = new Clients();
ScheduleReport dayreport = new ScheduleReport();
dayreport.date = Convert.ToDateTime(System.DateTime.Now.ToShortDateString());
ReportProcessor reportProcessor = new ReportProcessor();
RenderingResult result = reportProcessor.RenderReport("PDF", dayreport, null);
string reports = System.DateTime.Now + "DayReport.pdf";
FileStream fs = new FileStream(Server.MapPath("/Reports/") + reports, FileMode.Create);
// FileStream fs = new FileStream("BeforeMergeReport.pdf", FileMode.Create);
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
fs.Flush();
fs.Close();
// ReadPdfFile();
}
请帮助我,我已经尝试在RenderingResult中替换.csv替换.pdf它显示错误是否还有其他解决方案?请
答案 0 :(得分:0)
尝试改变: