Solved

Crystal Variable Problem

Posted on 2011-03-01
7
336 Views
Last Modified: 2012-08-14
I have to update several shared variables based on the scrap code:

if {bsp_Quality.FaultCode}="99" then
    M99:= M99 + {bsp_Quality.Qty}; 
    TotalScrapM99:= TotalScrapM99 + {bsp_Quality.Qty};
    TotalMatScrap:={bsp_Quality.Shot}*{bsp_Quality.Qty};
else if {bsp_Quality.FaultCode}="M01" then ...

Open in new window


I get an error after this line M99:= M99 + {bsp_Quality.Qty};  stating the rest of the text is not part of the formula.
What am I missing?
0
Comment
Question by:RickCooper
7 Comments
 
LVL 25

Accepted Solution

by:
reb73 earned 500 total points
ID: 35007959
If I'm not mistaken a multi-statement block has to be enclosed within brackets ()

if {bsp_Quality.FaultCode}="99" then
(    M99:= M99 + {bsp_Quality.Qty};
    TotalScrapM99:= TotalScrapM99 + {bsp_Quality.Qty};
    TotalMatScrap:={bsp_Quality.Shot}*{bsp_Quality.Qty};
)
else if {bsp_Quality.FaultCode}="M01" then ...
0
 
LVL 1

Author Comment

by:RickCooper
ID: 35008001
I get the ) is missing and TotalScrapM99: is highlighted
0
 
LVL 77

Expert Comment

by:peter57r
ID: 35008090
The syntax for such code is a bit difficult.
Remove the ; on the line before the )

In your Else structure you need ...

else
(
firstline;
secondline;
thirdline
);
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 100

Expert Comment

by:mlmcc
ID: 35008148
What is the full code?

The variables don't appear to be declared.
All variables used in a formula must be declared in the formula.
Unlike some languages you must declare the variable in each formula not just in a formula at the start of the report.

mlmcc
0
 
LVL 1

Author Closing Comment

by:RickCooper
ID: 35008460
The Variable TotalMatScrap was not declared correctly.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 35009511
Since you had to change the declaration, why wasn't my comment selected as part of the answer.  The ( ) being required was part of the answer though not to the actual error.

mlmcc
0
 
LVL 1

Author Comment

by:RickCooper
ID: 35010185
mlmcc,

 There was a typo in the variable. It had been declared, I checked the code before I read your post. Even without the typo the error was the same no ( )

Sorry.

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now