I have develop a small application in asp.net and i have genarate Telerik reports to get data,in aspx i took the telerik report viewer and when i run and click the button it genarate ".pdf" file it's fine.But,i want generate the .csv file
Here is My code(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();
}
please help me ,i have try replace .csv insted of .pdf in RenderingResult it showing error is there any other solution? please
Try to change: