on 09-09-2010 12:14 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.