Thursday, March 22, 2012

Can I define global or static variables?

Hi, I need to define a global or static variable, but I don't know how I can do it.
I need to number each "Detail" line, but I can't use the "Record Number" of "Special Fields" because each database record can create more than one detail line. I try to solve this problem using a global or static variable, but if isn't possible, what do you suggest me?

Thanks and sorry for my bad English.I've just done this very thing in a report I've been working on. The method I used is dependent on using a group header along with the details section.

1) Create a formula field (I called mine CounterReset) and use the following formula:
WhilePrintingRecords;
Global numbervar GroupRecCount;
GroupRecCount := 0;

2) Add this field to your group header. You can supress it if you don't want it to show on your report.

3) Crate another formula field (I called mine CountOfRecordsInGroup) and paste the following formula:
WhilePrintingRecords;
Global numbervar GroupRecCount;
GroupRecCount := GroupRecCount + 1;

4) Use this field in your details section as the line number. It will reset to zero when your groupnumber advances and *sounds* like what you are looking for from the description of your problem.

Hope this helps!

Z|||Thank you very much zilonox!! I've been asking this for several days and nobody could help me.
Greetings,
Christian J.

No comments:

Post a Comment