Page 1 of 1
save report befor view in webviewer in pdf file
Posted: Sun Jan 16, 2011 7:36 am
by farsia
hi
i want to save report to pdf as binary to insert this report save in the database (sqlserver) such as one field of record.
plz help me .
sorry for bad English.
save report befor view in webviewer in pdf file
Posted: Mon Jan 17, 2011 8:45 am
by Alex K.
Hello,
You can load a report, render it and then export it to the memory stream, and then, convert the stream into the necessary format and insert it into the database.
Code: Select all
//Load report, Render
StiReport report = new StiReport();
report.Load("e:\\Report.mrt");
report.Render(false);
//Export fotmat Pdf to stream
MemoryStream stream = new MemoryStream();
report.ExportDocument(StiExportFormat.Pdf, stream);
//Your code for insert into database stream.ToArray()
...
Thank you.
save report befor view in webviewer in pdf file
Posted: Wed Jan 19, 2011 12:38 am
by farsia
Hi Aleksey,
Excellent, your code does exactly what I want.
More thanks
save report befor view in webviewer in pdf file
Posted: Wed Jan 19, 2011 1:02 am
by Andrew
Ok!
Have a nice day!
Thank you.