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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exporting to word with crystal

Status
Not open for further replies.

mayathebee

Programmer
Jun 24, 2003
16
0
0
ZA
Exporting to word gives the wrong results under certain conditions, although pdf and excel gives the right results always. Why would word be problematic and not excel and pdf for the same criteria?

 
refer to above post: we are running crystal reports 8.5 and windows XP.
 
"gives the wrong results" isn't a very comprehensive diagnosis of the problem, but I will make an assumption that you are not exporting using the 'Word (exact)' export option, which respects the same visuals as rtf/pdf/and rpt. If you don't have the option, download crxf_wordw.zip from Crystal's support site.

If this is not a solution to your problem, try to give us a little more specific account of your problem with your subsequent post.

Thanks,

Naith
 
Sorry if i didn't explain myself well. By wrong results I mean that the recordset is different to what I get in Excel and PDF. So format is not the problem, the actual records are wrong. It appears to ignore the recordselectionFormula, in other words the values selected by the user in the browser and passed in to crystal. What I don't understand is how we get the correct records in Excel and PDF.
 
Very strange. Once the report is brought back, the database connection is broken, and the connection is not reestablished merely to export, so it should be impossible for the data to change at all.

If your data is not too sensitive, post your email, and I will have a look at the report for you.

Naith
 
Make sure that you've applied all of the hotfixes.

I would think that the only way this is possible is if you are discarding the data prior to viewing it.

One thing to do immediately is to open the report and turn off the File->Save Data with Report.

So what external code are you using?

Consider posting the code you're using for the correct results, and for the incorrect results.

-k
 
I'm puzzled by lost records, but if you haven't got the latest dlls for export, you need to update. The export options for Excel should be [MS Excel], and [Word (extract)] for Word.

Madawc Williams
East Anglia, Great Britain
 
Sorry, this should have been:

I would think that the only way this is possible is if you AREN'T discarding the data prior to viewing it when it gives bad results.

-k
 
The strange thing is that this happens inconsistently..I'll look into the dll issue, The code is the code in the asp page to set the export options, not sure if this could be an issue at all?

Set ExportOptions = oRpt.ExportOptions
if (instrrev (outputfname,".pdf", -1, 1) > 0) then
ExportOptions.FormatType = CREFTPORTABLEDOCFORMAT
ExportOptions.PDFExportAllPages = TRUE
ExportOptions.DestinationType = CREDTDISKFILE
Response.ContentType = "application/pdf"
elseif (instrrev (outputfname,".doc", -1, 1) > 0) then
ExportOptions.FormatType = CREFTWORDFORWINDOWS
ExportOptions.PDFExportAllPages = TRUE
ExportOptions.DestinationType = CREDTDISKFILE
Response.ContentType = "application/msword"
elseif (instrrev (outputfname,".xls", -1, 1) > 0) then
ExportOptions.FormatType = CREFTEXCEL70
ExportOptions.PDFExportAllPages = TRUE
ExportOptions.DestinationType = CREDTDISKFILE
Response.ContentType = "application/msexcel"
else
Response.Write "File type not supported"
Response.End
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top