Skip to Content
0
Former Member
Sep 09, 2010 at 11:14 AM

Export to doc format . But it is actually rtf.

64 Views

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.