问题
How to export crystal report to pdf directly, instead of saving on disk, it open and user has to save it through pdf file option.
I have tried , export to disk , export functions but none work as required...
I have taken reference from these pages
http://www.tek-tips.com/viewthread.cfm?qid=1398387 http://www.tek-tips.com/viewthread.cfm?qid=1028856 http://social.msdn.microsoft.com/Forums/en/vscrystalreports/thread/3201734e-8e88-4b04-b7f5-848ac1ce4fb5 http://forums.asp.net/t/1585859.aspx/1
Any help will be appreciated. Thanks.
I am Currently using vs 2010 c# and sql server 2005 and Sap Crystal Report.
回答1:
In order to open the crystal report in PDF format, you first need to save it. You should export the PDF to a temp folder (eg: System.IO.Path.GetTempPath()
), then open it.
If your user wants to keep it, he can save it where he wants.
In fact, if you look at the Crystal Report Viewer, it does the same exact thing. It saves the .rpt using a guid then open it.
来源:https://stackoverflow.com/questions/12057841/how-to-export-crystal-report-directly-to-pdf-in-c-sharp-2010