How to perform crystal report import from word?

Asked By 20 points N/A Posted on -
qa-featured

Hi guys,


How to perform crystal report import from word? There are some times that we needed crystal reports, how can be crystal reports properly imported from a Microsoft word document? Share with me your ideas regarding this issue, a step by step process is highly needed.


Expecting some help, thank you.

SHARE
Best Answer by Baker Mich
Answered By 0 points N/A #168939

How to perform crystal report import from word?

qa-featured

Follow the instructions below to import an MS Word file into a Crystal Report:

1) Make a new Crystal report.

2) From the Insert menu, click OLE object.

3) Click Create from file.

4) Click Browse and open the Word document.

5) Put the OLE object in the section where you want to see it.

Best Answer
Best Answer
Answered By 5 points N/A #168940

How to perform crystal report import from word?

qa-featured

Hi Jonn,

Alternatively you can also export your crystal report into a Microsoft document. There are basically two ways to do that. One is to do it manually and another is to do it automatically which would need some programming skills of the VB language in crystal report. Following is the code that you can try for automatic export of your CR.

  ReportDocument cryRpt = new ReportDocument();
            cryRpt.Load(@"CrystalReport1.rpt");//please change location of the crystal report file 
            
            try
            {
                ExportOptions CrExportOptions;
                DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
                PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
                CrDiskFileDestinationOptions.DiskFileName = "c:\crystal.doc";
                CrExportOptions = cryRpt.ExportOptions;
                {
                    CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
                    CrExportOptions.ExportFormatType = ExportFormatType.WordForWindows;
                    CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
                    CrExportOptions.FormatOptions = CrFormatTypeOptions;
                }
                cryRpt.Export();
            }
            catch (Exception ex)
            {
              //Console.WriteLine(ex.ToString());

You can also export it manually. For exporting just go to File->Export and then choose an MS word from the drop down box.

Hope it helps.

Thanks

Baker

Related Questions