Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using RecordNumber in groups and sections

Status
Not open for further replies.

Simon9999

Technical User
Oct 25, 2006
105
GB
Hi

I am using CR XI. I have a report that I need to include a sort order for i.e. a columns which starts from 1 upto maximum number. I was trying to use the recordnumber function but it does not give the desirede result.

The problem I have is that the report is grouped and then the details section is split, sometimes it shows one row, sometime 4 rows. It is therefore very difficult to show the actual row number because multiple rows relate to the same record number.

Any ideas how I can display the row number on the preview screen rather than the record number?

Thanks

Simon
 
Use a variable that is evaluated i the detail sections

In the highest group header (ie one before details are displayed) Insert this formul and suppress from display (right click object and in format check suppress)

@reset
whileprintingrecords;

global numbervar rec_count:=0;

In details place this formula in each detail section, so if you have split details into 4 sections it will be displayed 4 times.

@eval
whileprintingrecords;

global numbervar rec_count:=rec_count+1;

Hope I have understood what you want.

Ian
 
Thanks for the response

However I tried this and the number is just repeated in the details section. I placed @reset in group header 1 and then @eval in GH2 and Details a,b,c, and d.

Any ideas?
 
Sorry I thougt the whileprintrecords would force it to evaluate with each section. Seems its only evaluating per record.

Can these sections be conditionally suppressed.

If not why not just use text boxes with 1, 2, 3, 4 etc for each section.

Ian
 
Thanks

Unfortunately there will be a maximum of 4 detail sections, but could be anything from 1-4 displaying which makes it difficult as the text box idea wont work.

 
YOu can do something similar to my firts suggestion but will require 4 evaluate formula

I assume you have suppression rules for each of the detail subsections

@rec_count1
whileprintingrecords;

If {det sect1 suppression rule} = false then
global numbervar rec_count:=rec_count+1;
Place in details section 1

@rec_count2
evaluateafter(@rec_count1);
whileprintingrecords;

If {det sect2 suppression rule} = false then
global numbervar rec_count:=rec_count+1;
Place in details section 2

@rec_count3
evaluateafter(@rec_count1);
evaluateafter(@rec_count2);
whileprintingrecords;

If {det sect3 suppression rule} = false then
global numbervar rec_count:=rec_count+1;
Place in details section 3

etc

You will still need the reset fomula as discussed above.

Ian





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top