Re: Save PDF Report to web server without any user interaction
ActiveReports for .NET 3.0 Support
Save PDF Report to web server without any user interaction
03-04-2010, 9:32 PM
I have a report that currently output to pdf and everything works great. But know I would like to save the pdf document to our web server and then have the pdf document email out of our system to our client. I know how to do the email portion, but I can not figure out how to save the file to the web server.
I saw a few posts that describe how to ask the user if they would like to open the file, save it to the clients machine or cancel. I am looking for a way to not ask the client any questions and to just save the pdf report to the web server. Is this possible?
If it is possible could you please show me an example on how to do this.
Any help that anyone can provide would be greatly appreciated.
Thank You,
Pat
Re: Save PDF Report to web server without any user interaction
03-05-2010, 4:06 AM
Hello,
If you wish to save the file on the webserver then I recommend you to use Export method of the
PdfExport
object.
For example:
rptMain rpt = new rptMain();
DataDynamics.ActiveReports.Export.Pdf.PdfExport p = new DataDynamics.ActiveReports.Export.Pdf.PdfExport();
rpt.Run();
p.Export(rpt.Document, Sever.Mappath(""));
Other possible way to Email the PDF would be to export the PDF to stream and then email the stream as attachment using the
SmtpClient
class.
Here
is more help on the same.
Please feel free to reply any more questions that you may have.
Regards,
Aashish
.