Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export Reports to Word Doc through Access Viewer 1

Status
Not open for further replies.

muddy1

Technical User
Jan 27, 2004
14
AU
I am currently viewing my crystal 9.0 reports through the ActiveX Viewer in Access2000. There is an export to pdf option which I wish to change to export to word doc. How do I go about it..

The pdf code is as follows:

Private Sub Image47_Click() 'Exporting to PDF
'Defines report's format type
Me.crxReport.ExportOptions.FormatType = crEFTPortableDocFormat
'Defines report's destination type
Me.crxReport.ExportOptions.DestinationType = crEDTDiskFile
'Defines report's file name
Me.crxReport.ExportOptions.DiskFileName = "H:\Common\Pioneer Lab DB\Myfile.pdf"
'exports without calling the exporting dialog window
Me.crxReport.Export False

End Sub

This works fine.. however when I try to Change the format type to crEFTWord, I get the "variable not defined" error. I can't find where the crEFTPortableDocFormat is defined either. Am I just using the wrong file type name?
Any help would be appreciated..

Jenny.

 
Here's the list of export Format Types for CR 9, with their corresponding values:

crEFTCharSeparatedValues 7
crEFTCommaSeparatedValues 5
crEFTCrystalReport 1
crEFTExcel21 18
crEFTExcel30 19
crEFTExcel40 20
crEFTExcel50 21
crEFTExcel50Tabular 22
crEFTExcel70 27
crEFTExcel70Tabular 28
crEFTExcel80 29
crEFTExcel80Tabular 30
crEFTExcel97 36
crEFTExplorer32Extend 25
crEFTHTML32Standard 24
crEFTNetScape20 26
crEFTNoFormat 0
crEFTODBC 23
crEFTPaginatedText 10
crEFTRecordStyle 3
crEFTRichText 4
crEFTTabSeparatedText 9
crEFTTabSeparatedValues 6
crEFTText 8
crEFTWordForWindows 14

-dave
 
Thanks Vidru,
When I changed the code I got a runtime 91 error.. "Object variable or With Block Variable not set". What does this mean?
How do I fix it with the following code? The third line is the problem..

Private Sub Image59_Click() 'Exporting to Word
'Defines report's format type
Me.crxReport.ExportOptions.FormatType = crEFTWordForWindows
'Defines report's destination type
Me.crxReport.ExportOptions.DestinationType = crEDTDiskFile
'Defines report's file name
Me.crxReport.ExportOptions.DiskFileName = "H:\Common\Pioneer Lab DB\Myfile.doc"
'exports without calling the exporting dialog window
Me.crxReport.Export False

End Sub

Any ideas??

Thanks,

Muddy
 
Hi Vidru,

On expert suggestion, I rebuilt the expression, and the above text worked...

Thanks heaps for your help...

Jenny.
 
Glad it worked out for you Jenny, and thanks for the * ...

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top