Skip to Content
0
Former Member
Jun 16, 2009 at 01:55 PM

Variable/Group/Footer question

12 Views

I have been tasked with creating a text report (ie an ascii, tab-delimited) file from a developed crystal (XI) report. It's going to used to extract data to feed a state application.

In their requirements, they have a field that is sequential (001, 002.. like a line number). Normally this would be a piece of cake but I don't want to increment for each row in the result set. I have a group set on the employee id and suppressed the detail lines. I have three separate group footers for the three records (Employee, Deduction and Work) that I need. So I want it to be like this:

001 E ....

002 D .....

003 W .....

BUT (there's always one of these).. The data is returned from a stored procedure and it's not grouped by any of these. In fact in each row of the data I need fields in all three footers. I created a global variable and incremented "whilereadingrecords". The problem is that that when it got to the footers, I already had 13 rows of data>

013 E.... (should be 001)

013 D (and this should be the next number)

How do I use a global variable that's just incremented when I want (when I go to create the 'E'/'D'/'W' rows ) rather than 'whilereadingrecords'? Do I create a string variable as well as a counter and only add when I'm 'on' a E/D/W row? How would I do this?