Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Need help on array Post Reply Post New Topic
Author Message
Bill
Newbie
Newbie
Avatar

Joined: 14 Dec 2007
Location: United States
Online Status: Offline
Posts: 6
Quote Bill Replybullet Topic: Need help on array
    Posted: 18 Dec 2007 at 10:06am
Here is a report I am working on I may need to use array but not sure how to do it. Please advice:


      Item     price1    price2    price3    Itemcode
Category 1
       Book        2        3          4        b1
   Notebook      3        4          5        b1
       Pen          5        6          7        p1
       stapler     8        9          10        s2
Category 2
          Book     5        4          1        b1
          Pen       9        6          17        p1

Sumary by Item Code;
           b1               10          11        10
           p1               14          12        24
           s2               8            9        10
   Total                   32          42        44

I have trouble to bring up the sumary by itemcode part. Thanks in advance.



Edited by Bill - 18 Dec 2007 at 10:11am
Thanks,
Bill
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 19 Dec 2007 at 5:36am
There are three basic ways to approach this.

If you have no need to see the detail data in the report, or can use the drilldown function to view the detail data, then you can do this very simply with grouping.  Simply group on the item code field, put in your desired summaries, and suppress the details section.  (However, I note that you seem to want to group the data two different ways, by category and by item code, so this approach may not be entirely feasible.)

The second approach is to use a cross-tab.  I realize that this doesn't look like a cross-tab, because you aren't trying to change the orientation of the data.  But, trust me, this can work.  Create a cross-tab using the expert.  Along the side, put your item code.  In the summaries section, put the three price summaries.  Select your total options to get the output formatted in the way you want.

The third approach is to use conditional formulas.  Now, this only works if you know ahead of time that the range of possible values for the item code is limited and fairly static.  Create a formula for each item code (this is why you need to know all the possible codes ahead of time).  The formula should look like:
     IF {ItemCode} = "XXX" THEN price1 ELSE 0
In the report footer, you can summarize based on this formula, and it will give you the results you are looking for.


IP IP Logged
Bill
Newbie
Newbie
Avatar

Joined: 14 Dec 2007
Location: United States
Online Status: Offline
Posts: 6
Quote Bill Replybullet Posted: 19 Dec 2007 at 3:30pm
Thanks Lugh, I have it resovled by doing a sub report. Appreciate your help.
Thanks,
Bill
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.