I have designed a Report in my ASP.NET web site now i need to provide options to export that report in PDF, HTML, and DOC formats, how do i achieve that?
crystal report has one button to do that but when ever i try to save that report its saved as .aspx format as i am viewing it in asp.net web page.
You have to do it by yourself: create a dropdown list with formats you want and a button to make a postback for exporting.
This is an example for the .Net 1.1 / CR9. When making a postback to the following:
MyReport.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;MyReport.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;You can also chooseWordForWindows,RichText,Excel,HTML40and more.Then do the following:
CrystalDecisions.Shared.DiskFileDestinationOptions fileOptions = new DiskFileDestinationOptions();fileOptions.DiskFileName = "someTmpFileName";MyReport.DestinationOptions = fileOptions;MyReport.Export();You can find more about
ExportOptionsclass here.And here is an example for VS 2005 / .Net 2