471,328 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,328 software developers and data experts.

Formula error using Crystal Reports for VS.NET 2003

I have a report created in Crystal Reports 8 that I'm attempting to use in a
..NET application. I have the following formula that works in the Crystal 8
designer and when the report is run using the Crystal 8 OCX in a VB 6
application:

WhilePrintingRecords;
Numbervar nTaxAdjTotal;

if OnFirstRecord then
nTaxAdjTotal := ToNumber
({TaxLiabilityAnalysisSQLFieldDef.RoundingAdj}) + ToNumber
({TaxLiabilityAnalysisSQLFieldDef.TaxAdj}) + nTaxAdjTotal
else
if {TaxLiabilityAnalysisSQLFieldDef.RtnCode} +
{TaxLiabilityAnalysisSQLFieldDef.RtnSeq} <>
Previous({TaxLiabilityAnalysisSQLFieldDef.RtnCode} ) +
Previous({TaxLiabilityAnalysisSQLFieldDef.RtnSeq}) then
nTaxAdjTotal := ToNumber
({TaxLiabilityAnalysisSQLFieldDef.RoundingAdj}) + ToNumber
({TaxLiabilityAnalysisSQLFieldDef.TaxAdj}) + nTaxAdjTotal

When I attempt to run this report in my .NET application (C# using the
Crystal Reports Engine) I get the following error:

Error in formula <IncTaxAdjustment>.
'WhilePrintingRecords;
'
A string is required here.

I'm baffled. Any help will be greatly appreciated.

Thanks.

bb
Jul 21 '05 #1
1 3764
I found the cause of my problem. I have to wrap RtnCode and RtnSeq in
ToText().

bb

"B. Broadwell" wrote:
I have a report created in Crystal Reports 8 that I'm attempting to use in a
.NET application. I have the following formula that works in the Crystal 8
designer and when the report is run using the Crystal 8 OCX in a VB 6
application:

WhilePrintingRecords;
Numbervar nTaxAdjTotal;

if OnFirstRecord then
nTaxAdjTotal := ToNumber
({TaxLiabilityAnalysisSQLFieldDef.RoundingAdj}) + ToNumber
({TaxLiabilityAnalysisSQLFieldDef.TaxAdj}) + nTaxAdjTotal
else
if {TaxLiabilityAnalysisSQLFieldDef.RtnCode} +
{TaxLiabilityAnalysisSQLFieldDef.RtnSeq} <>
Previous({TaxLiabilityAnalysisSQLFieldDef.RtnCode} ) +
Previous({TaxLiabilityAnalysisSQLFieldDef.RtnSeq}) then
nTaxAdjTotal := ToNumber
({TaxLiabilityAnalysisSQLFieldDef.RoundingAdj}) + ToNumber
({TaxLiabilityAnalysisSQLFieldDef.TaxAdj}) + nTaxAdjTotal

When I attempt to run this report in my .NET application (C# using the
Crystal Reports Engine) I get the following error:

Error in formula <IncTaxAdjustment>.
'WhilePrintingRecords;
'
A string is required here.

I'm baffled. Any help will be greatly appreciated.

Thanks.

bb

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by p | last post: by
reply views Thread by =?Utf-8?B?Q29ubnVsbA==?= | last post: by
2 posts views Thread by =?Utf-8?B?Um9iZXJ0?= | last post: by
reply views Thread by =?Utf-8?B?Q2FybG9z?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.