Export a crystal report
-
HI! does anyone out there knows what dll is needed in order to export a crystal report file to a txt file. i wrote this code, i can only export report to "PDF, Excel, Word Doc, RTF Doc,HTML 3.2, HTML 4.0 or CrystalReport" // The path/location where the exported file will be saved string exportFilePath = ALOHA_PATH+"\\RPTFOH\\Report1.DOC"; // Create an instance of the untyped report object ReportDocument oRpt = new ReportDocument(); // Load the report from disk oRpt.Load(@"C:\Aloha\RPTFOH\Report_1.rpt"); // Set the options for saving the exported file to disk DiskFileDestinationOptions oDest = new DiskFileDestinationOptions(); oDest.DiskFileName = exportFilePath; // Set the exporting information ExportOptions oExport = oRpt.ExportOptions; // Set the destination options oExport.DestinationOptions = oDest; // Set the location, this can be: // DiskFile, ExchangeFolder, MicrosoftMail or NoDestination oExport.ExportDestinationType = ExportDestinationType.DiskFile; // Set the Export type, this can be: // PDF, Excel, Word Doc, RTF Doc, // HTML 3.2, HTML 4.0 or CrystalReport oExport.ExportFormatType = ExportFormatType.WordForWindows; // Call the Export method to export the report oRpt.Export(); thx
-
HI! does anyone out there knows what dll is needed in order to export a crystal report file to a txt file. i wrote this code, i can only export report to "PDF, Excel, Word Doc, RTF Doc,HTML 3.2, HTML 4.0 or CrystalReport" // The path/location where the exported file will be saved string exportFilePath = ALOHA_PATH+"\\RPTFOH\\Report1.DOC"; // Create an instance of the untyped report object ReportDocument oRpt = new ReportDocument(); // Load the report from disk oRpt.Load(@"C:\Aloha\RPTFOH\Report_1.rpt"); // Set the options for saving the exported file to disk DiskFileDestinationOptions oDest = new DiskFileDestinationOptions(); oDest.DiskFileName = exportFilePath; // Set the exporting information ExportOptions oExport = oRpt.ExportOptions; // Set the destination options oExport.DestinationOptions = oDest; // Set the location, this can be: // DiskFile, ExchangeFolder, MicrosoftMail or NoDestination oExport.ExportDestinationType = ExportDestinationType.DiskFile; // Set the Export type, this can be: // PDF, Excel, Word Doc, RTF Doc, // HTML 3.2, HTML 4.0 or CrystalReport oExport.ExportFormatType = ExportFormatType.WordForWindows; // Call the Export method to export the report oRpt.Export(); thx
Here we go: Probably you'll need to add a reference to all of the following dlls: CrystalDecisions.CrystalReports.Engine CrystalDecisions.ReportSource CrystalDecisions.Shared And you'll be using the followings in your code: using CrystalDecisions.CrystalReports.Engine; using CrystalDecisions.Shared; Thanks.