cancel
Showing results for 
Search instead for 
Did you mean: 

Export to doc format . But it is actually rtf.

Former Member
0 Kudos

I am using CR 12.2.0.290 in Win XP SP3 for a .net 2.0 win form application.

I am trying to export report to doc format from the code.

Problem : when I export and save the report , report is saved as .doc format. But when I open the report in office 2003, it is shows the status as ''Converting file " (in bottom status bar) for first few seconds and opens the file. In some machine , it even shows a dialog "Convert from" in which rtf is selected . You have to click 'Ok' on this dialog to open the file. So I assume that file is not saved as .doc format when I export using API. It is saved rtf. How to save the file as .doc rather than .rtf renamed as .doc file ?

My code :

PdfRtfWordFormatOptions wordOpts = new PdfRtfWordFormatOptions();

expOpts = lobjRpt.ExportOptions;

lobjRpt.ExportOptions.ExportFormatType = ExportFormatType.WordForWindows;

expOpts.ExportFormatType = ExportFormatType.WordForWindows;

exptOpts.FormatOptions = wordOpts;

expOpts.ExportDestinationType = ExportDestinationType.DiskFile;

diskOpts.DiskFileName = lstrFileName;//this will have extension .doc and full file name

exportOpts.DestinationOptions = diskOpts;

lobjRpt.Export();

Any pointers to solve this issue is appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hello,

It's always been this way. As long as I can remember ( CR 5 ) the Word Doc and RTF export types where identical. It's always been a RTF format. In CR 8.5 the RTC and DOC export dll's were identical except the file was saved with their respective extensions.

RTF is an easier format to use and less Word version specific so it's more generic when exporting, any version of Word can open RTF files.

I have not tested this in a long time but try renaming the file to *.doc and see if Word can open it up.

Otherwise your only option is to save it to DOC format once opened in Word. There may be WORD API's available that would allow you to export the RTF to word using Windows Office API's in your application.

You never said what the issue is other than having to click the OK button once the file is opened in Word? Is this the only issue?

Thank you

Don

Former Member
0 Kudos

Don,

Yes , the only issue is I have to click 'OK' in when open in word. No other problems. File opens without any issue. But my client is not happy about clicking the 'OK' button each time. Is any release note mentions this behavior ?

0 Kudos

I doubt it, I'll have a look though.

This may be something Word is doing so we have no control over it. I'll check with the PM group also.

Thank you

Don

Answers (0)