Solved

crystal reports hardcoding hell

Posted on 2015-01-06
1
148 Views
Last Modified: 2015-01-09
I am trying to create a route driver settlement report in Crystal reports, but I am making a lot of formulas to try and get it working.  I was wondering if there was a way to maybe combine these formulas so it's not such a daunting task.  

We have over 100 stockcodes that we sell.  Here are the formula names and formulas to just one stockcode in one section.

101CG - IF {PurchaseOrderDetail.ItemNo} = "101GSF" THEN  {@Extended}

101CR - WHILEPRINTINGRECORDS;
SHARED numbervar CASH101;
tonumber(CASH101 + Sum ({@101CG}));

101 - GROUP - IF {PurchaseOrderDetail.ItemNo} = "101GSF" THEN  {@Weight}

101 - REPORT - WHILEPRINTINGRECORDS;
SHARED numbervar GSF101;

IF (tonumber(GSF101) + tonumber(Sum ({@101 - GROUP}))) <> 0 THEN
 "101GSF     " & tonumber(GSF101 + Sum ({@101 - GROUP}))

ELSE

"101GSF     "


CASHPO101 - SHARED numbervar CASHPO101;
shared numbervar CASH101;

CASHPO101 := tonumber(CASH101 + Sum ({@101CG}))


PO101 - SHARED numbervar PO101;
shared numbervar GSF101;

PO101 := tonumber(GSF101 + Sum ({@101GSF - GROUP}))


That is 6 different formulas  for 1 stockcode.  You can see how this can get out of hand.
Anyway to condense this, so when I make a new stockcode, it doesn't take forever to get it put in?
0
Comment
Question by:TomBalla
1 Comment
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 40534461
Some general observations on the formulas
Do you have a subreport?
If not, then you don't need to use SHARED variables.  You can use GLOBAL variables.

Why the need for ToNumber?
There should be no need for it since the fields are numbers.

Depending on what these are calculating you may be able to change them and just use summaries.
The formulas seem to be calculating values and totals based on the ItemNo.

If there is a subreport then I think you may be stuck using the formulas you have.  WIth sureports to total the values returned requires 3 formulas in the main report.
  Declare the shared variable
  Calculate the total
  Display the total

mlmcc
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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

12 Experts available now in Live!

Get 1:1 Help Now