How to export crystal report directly to pdf in c# 2010?

强颜欢笑 提交于 2021-02-08 09:13:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!