Print Page | Close Window

Cross Tab and line Numbers

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=8074
Printed Date: 26 Apr 2024 at 5:40pm


Topic: Cross Tab and line Numbers
Posted By: WillieK
Subject: Cross Tab and line Numbers
Date Posted: 21 Oct 2009 at 2:11am
Hi there,

We have a cross tab report and the user is requesting line numbers to be added to the detail.
It is a report that is generated based on groups, so the counter needs to be reset per group.
Would it be easier to achieve this through the Stored Procedure (Data Source), or can this be easily done in Crystal?

Any help and steps on how to achieve this would be greatly appreciated!

Thank you.

(I inherited the code so I'm not sure how the process works, but let me know if more info is needed and I'll gladly supply it.)



Replies:
Posted By: DBlank
Date Posted: 22 Oct 2009 at 11:30am
I you really using a CrossTab or just a Report with Grouping that looks like a crosstab? Generally you do not have detail rows appearing a crosstab so I am guessing it is the just grouping.
If So you can use a Running Total or Variable. There aer tons of exampls on these but here is  the gyst:
Create a Running Total as 'GroupedRowCount' (or whatever):
Field to summarize=anyfield that is not NULL on EVERY row (e.g. PrimayKey field)
Type of SUmmary= COunt (disctinctCount can often also be used on a PK field)
Evaluate=For Each Record
Reset = On Change of group (select the group required for your reset to 0)
Place on the detail row to see incrimental counting and on the Groyup Footer to see the total for that group (will be the same as the last row in the group)


Posted By: WillieK
Date Posted: 22 Oct 2009 at 10:51pm
Hi there,

Thanx for the reply!
I am not too familiar with Crystal, as I've only been working with it for 4 months, so please excuse me if I do not use the right terminology...

It is definitely a cross tab report, because we have a similar report (similar in the data, not the structure) and it works with grouping.  So, with that I used a running total to number the detail lines.  I need to achieve this for the cross tab report as well, but as you stated, it does not have detail lines, so I do not know how to generate the line numbers on the final report.
As a solution for the time being, I have changed the stored procedure to include the line numbers, instead of generating them in the report.

So, technically the problem is solved, but I would like to know whether or not this can be achieved in the cross tab report?


Posted By: wetpalm
Date Posted: 29 Oct 2009 at 8:15am

Right click on the field in front of which you want the recordnumber to appear, select format field, a new dialog box appears, towards the bottom of the dialog box there is an option that says display string, click on button that says x-2 in front of display string and write the following codes inside

numbervar e;
e:=e+1;
totext(e,'#') + ". " + CurrentFieldValue;
 
the above would put serial number in front of the selected field
again, you have to put column total on top so as not to invert the serial number. hope this helps


-------------
Many heads are not always better than one, trust your instinct


Posted By: ramiahragu
Date Posted: 03 May 2010 at 7:19pm
how can i reset the number within the groups. my cross tab is below the group


Posted By: erickentry
Date Posted: 25 Apr 2011 at 10:58pm
Column total? Not row total? Considering that every page has different row total...


Posted By: patpat
Date Posted: 13 Jan 2021 at 4:58am
how can i sort the serial number ascending if i wanted to put the column total at the bottom



Print Page | Close Window