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

VB6 & CR8.5 format problem

Status
Not open for further replies.

DanNorris2000

Technical User
Nov 10, 2000
186
US
I have Crystal 8.5 installed on my pc. When I open a particular report with crystal a formula that I have which strings 2 numeric field together displays as 3000370-00
If i call the report with visual basic 6.0 the field prints out as 3,000,370-00. Whats up? both run from same workstation

VB6 Code:
Set CrxReport = crxApplication.OpenReport("k:\vfp\reinsurance\reports\31pf.rpt")
CrxReport.DiscardSavedData
CrxReport.PaperOrientation = crLandscape
CrxReport.PrintOut False, 1, True, 1, 9999

 
Hmmm, sounds like a lil buglet there with how the default numerics are being handled.

You can resolve it by using formatting on the totext() function, as in:

totext({table.numericfield},"",0)

The "" states the thousands separator, and the 0 represents decimals.

It should be fine then.

-k
 
went from:

(cstr({LEDGER.claim},0)+"-"+cstr({LEDGER.clmsub},"00"))

to this with no success

totext((cstr({LEDGER.claim},0)+"-"+cstr({LEDGER.clmsub},"00")))

default system number format is -1123 so I have to format commas to be there

 
Neither of those are what I suggested.

Try:

totext((cstr({LEDGER.claim},"",0)+"-"+cstr({LEDGER.clmsub},"",0)))

-k
 
sorry,
I cut and pasted directly but that gave error
"bad number format string"
totext((cstr({LEDGER.claim},"",0)+"-"+cstr({LEDGER.clmsub},"",0)))



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top