I want to make a report from ASP.Net, in Crystal Report. I want, when user click on print, it should simply show a browser dialog of Save,Open,Save as, and PDF should be saved, or Crystal Report print preview should appear, I don't want to display report first in Viewer then click on button to get print or PDF, I want simply from clicking on asp button, I have all the idea of parameters and know how to make report, my question is just to not to show viewer and take report from asp button in a form of PDF or print preview dialog to print. I have used the Export method of .Net for Crystal Report, but it does not work.
Visual-studio – Crystal Report direct saving as PDF, instead of viewing
asp.netcrystal-reportscrystal-reports-2008visual studio
Best Answer
You can generate a PDF by Using a Crystal Report and piece of code....
First: Generate a Crystal Report as per your requirements.
Second: Use the below code to generate the PDF:
Place the following name spaces at the top of the code page
Variable Declaration
Set the destination path and file name
Specify a page range (optional)
Set export options
Trap any errors that occur on export
Thats it.... Now you are ready to create a PDF of the Report.