views:

306

answers:

1

I'm making a change to some legacy software to dump the contents of a CR7 report in the "Record Style" format, which basically dumps each visible data field into a fixed-length text file. This is all well and good, with one exception. All of my numbers are being rounded to the nearest whole number when I need some of the numbers to show two decimal places. In the report itself, the number fields are formatted correctly (set to display two decimal places and round to two places).

When I export the report from my VB6 program (using the Crystal Reports OCX control), the decimal part of these numbers is being truncated.

When I export the report from Crystal Reports 7 IDE, I get a prompt that I am not getting when I export the report using the Crystal Reports OCX control:

Number and date format dialog: Same number formats as in report, Same date formats as in report

When both of these options are selected, my exported file is PERFECT.

I cannot seem to find a way to set these options programatically, or set them as defaults in my report file. Is there a way to accomplish this?

Edited to add: The fields being truncated are of type single in an Access 2000 database, which still boggles me because the default format for a type single in CR7 is to always show two decimal places.

+2  A: 

The answer popped right out after I had abandoned this code fix in frustration:

CrystalRpt.PrintFileUseRptNumberFmt = True
CrystalRpt.PrintFileUseRptDateFmt = True

Hope this helps someone else in a similar situation.

Heather