Results 1 to 6 of 6

Thread: **RESOLVED ** exporting report to Word For Windows

  1. #1

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    **RESOLVED ** exporting report to Word For Windows

    I am experiencing a strange problem. I am trying to export a report to Word For Windows (2000) from my VB6 CR8.5 program (code follows). The document gets there, but when I bring it up in Word, it is blank, until I change the view to "print layout". Then the data is there, but it is grayed out. Any ideas?

    Set Report = crxApplication.OpenReport("C:\CertificateofCompliance.rpt", 1)
    Report.ExportOptions.FormatType = 14 'Word For Windows
    Report.ExportOptions.DiskFileName = "C:\CertificateofCompliance.doc"
    Report.ExportOptions.DestinationType = crEDTDiskFile
    Report.Export False
    Last edited by Pasvorto; Jan 30th, 2004 at 10:40 AM.

  2. #2

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    I have tried using this code instead:

    Report.ExportOptions.FormatType = crEFTPortableDocFormat
    Report.ExportOptions.DiskFileName = "C:\Certificate_of_Compliance_" & jobinx & ".pdf"
    Report.ExportOptions.DestinationType = crEDTDiskFile
    Report.Export False

    However, when I run it with this code I get:

    An error occurred: [-2147190908] Failed to export the report. - Source: Crystal Reports Active X Designer

    I have checked and I have Exportmodeller.dll and Crtslv.dll and U2FwordW.dll present and registered. This is 8.5 Developer (I also have 9.0 installed on the same machine).

    The problem with using the WordFor Windows export is that the text comes out "greyed" and uneditable. In addition, the bottom half of the page doesn't export at all.

  3. #3
    Lively Member
    Join Date
    Jul 2001
    Location
    New Hampshire, USA
    Posts
    127
    The reason it is grayed out may be because it is being exported as a header/footer. You may want to try exporting to RTF and see what results you get.
    Andrew Divers

  4. #4

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    I believe I tried that first, with the same result. In fact, an interesting thing. When you bring up Word to look at the document, it is blank. You must change to Printer View in order to see anything. And then it is greyed out.

  5. #5
    New Member
    Join Date
    Jan 2004
    Posts
    1
    Hi There,

    I am new to this forum, just seen your problem, though not sure whether my late reply will yield something positive for you.

    The same problem i had in past and i found this due to structure of crystal report. See if we design some report in Crystal and we put some data in Page Header/Footer. Now if we try to export this report at run time Crystal Report Engine checks in which format we are going to export, in ur case it is word format, then it puts everything writtern in Page Header/Footer into MS Word's page Header/Footer and also inherit all the related properties of MS Word's header and footer thats why you will see that grey area problem.
    I had fixed this problem by moving the contents of Crystal Reports Page Heade/Footer into Group Header/Footer at design time then it wont create problem while exporting into Word format.

    I hope this will help you!

    Bob

  6. #6

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    Actually I solved the problem by upgrading to CR9 and exporting to PDF.

    Report.ExportOptions.FormatType = crEFTPortableDocFormat
    Report.ExportOptions.DiskFileName = "C:\Certificate_of_Compliance_" & jobinx & ".pdf"
    Report.ExportOptions.DestinationType = crEDTDiskFile
    Report.Export False

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width