Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1004
Export Chart as PDF with memorystream
posted

hello community,

I try to export Chart as PDF: when i write           

string documents =  System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
chart.RenderPdfFriendlyGraphics(g);

report.Publish(documents + "\\report.pdf", FileFormat.PDF); it works very well. But my problem i use asp.net mvc and want via Controller to export Chart:

var PieChart = new UltraChart();

........

var stream = new System.IO.MemoryStream();
new ExportToPDF().Export(PieChart, stream);
return new File(stream, "application/pdf", "report.pdf");

in my class ExportToPDF: report.Publish(stream, FileFormat.PDF) and with possibility i get empty File (report.pdf)

Thanks for reply and help

Parents
No Data
Reply Children