Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Show loop iterations in details line Post Reply Post New Topic
Author Message
chloecd
Newbie
Newbie


Joined: 21 Dec 2015
Online Status: Offline
Posts: 10
Quote chloecd Replybullet Topic: Show loop iterations in details line
    Posted: 03 Mar 2016 at 6:35am
Hello!

I am trying to get a report to show a detail line for each loop.

To start simply, I want for every employee I want 59 details lines, with each showing consecutive numbers. Once I've got this part working I can *hopefully* do the rest fairly easily. I've tried the following:

Local NumberVar test := 0;
Local NumberVar i;
For i := 1 To 59 Do
(
   Local NumberVar test := test+1;
);
test;

but just get the final iteration of 59. Which is great because it's showing the loop is working - just not how I want it to!

Any ideas would be much appreciated!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Mar 2016 at 7:47am
assuming this is a crystal formula it won't work that way.
What are you really trying to accomplish?
IP IP Logged
chloecd
Newbie
Newbie


Joined: 21 Dec 2015
Online Status: Offline
Posts: 10
Quote chloecd Replybullet Posted: 04 Mar 2016 at 12:30am
I'm trying to make a P & L report to export to CSV for a client. Each of the 59 lines will show a description, nominal code, and amount. The amounts are pulled in from multiple tables and company policy means I cannot just make a new table.

I then need to supress lines equal to 0, ideally without blank lines in the CSV.

My attempt this morning was to use multiple details sections which are conditionally suppressed, but that then causes blank lines in the CSV export.
IP IP Logged
chloecd
Newbie
Newbie


Joined: 21 Dec 2015
Online Status: Offline
Posts: 10
Quote chloecd Replybullet Posted: 04 Mar 2016 at 12:31am
I'm using Crystal Reports 2013 Support Pack 6 if that helps.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Mar 2016 at 2:47am
Why '59 lines'?
Because you have 59 unique 'items'?
Using multiple tables is quite common. You can either use a command or a stored procedure (if your company allows it) to create a data set that compresses your tables into one acceptable data source. Or you can usually use grouping in Crystal to replicate that. You then suppress the detail rows and use the group header or footer to show summarized data from that group.
IP IP Logged
chloecd
Newbie
Newbie


Joined: 21 Dec 2015
Online Status: Offline
Posts: 10
Quote chloecd Replybullet Posted: 07 Mar 2016 at 4:54am
There are 59 items that may or may not equal zero, and I need to only show those that don't equal zero.

I am already using multiple tables to calculate these values, but cannot create new tables - not for one report for one client.

I think we may just programmatically trim the csv to get rid of the suppressed blank lines....
IP IP Logged
chloecd
Newbie
Newbie


Joined: 21 Dec 2015
Online Status: Offline
Posts: 10
Quote chloecd Replybullet Posted: 07 Mar 2016 at 5:01am
I've found a way to filter the report so pay components are filtered if they are 0 - it's just the other bits (Tax, National Insurance, Pensions etc.) which are pulled in from a different table which are more complicated.


http://i6.photobucket.com/albums/y248/nutteratnutwood/Capture.jpg

I don't know if that makes what I'm saying make any more sense?

Each of the blank lines will be a zero suppressed line.


Edited by chloecd - 07 Mar 2016 at 5:03am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Mar 2016 at 4:31am
I am not clear on what your 'raw' data set looks like but do not fall into the trap of thinking that displaying the data to look like something (a desired output) actually alters the data set at all. Crystal never alters your data, it just changes the way you are displaying it to the eye of the report recipient. It is important to keep that in mind while working the design process as you can start o trick yourself into thinking that you have data to use that is not "real" data.
From the looks of it you might be able to group on person and then group on type and then sum the value for that group and exclude (or suppress) the entire group based on that group value result.
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.000 seconds.