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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drill Down rebuilds Variables

Status
Not open for further replies.

hwwagen

Programmer
Nov 2, 2004
10
CA
I'm using Crystal Reports 8.5 and have had some difficulty debugging why drill down information is different than the group info. I now see what happens, but don't see how to fix it.

While reading records I build an array that sums the amount of inventory in stock for each item. While printing, I allocate material to shop orders and decrement the quantity in the array. If the quantity is less than required on the shop order the shop order is flagged as not fillable.

I have discovered that if I show the detail information everything works as expected. However, if I hide the section and drill down the array is rebuilt. It seems that the WhileReadingRecords functions are done again when drill down is performed. How can I work around this?
 
Please provide more detail about the layout of your report, more specifically sections, groups and formulas indicating which sections the formulas are placed in.



Gary Parker
MIS Data Analyst
Manchester, England
 
Thank you for your response. I hope the following clarifies my situation.

In my report header I have a function called BuildArrays that runs while reading records. This function accumulates all inventory levels.

There are a number of groups in this report, but the primary ones of concern surround the details section. Group 4 is by shop order. Since there are multiple detail records per part number Group 5 is by part number. This group footer is suppressed allowing drill down. A shop order contains multiple records for material requirements. During printing, there is a function in the details section that decrements the required quantity from the array mentioned above. In the group footer for the part I have a function that returns an asterisk if there is not enough inventory to fulfill this part's requirements. This function also toggles a boolean variable that is used in the next group footer (shop order). In the shop order footer I display an asterisk if any of the parts have insufficient quantities. This is done by checking the boolean value mentioned above.

I'm confident that the level of the report that initially prints is correct. However, I can't convince the user because when they drill down into a shop order that has an asterisk there are no parts displaying with asterisks.

In my debugging, I placed a formula that displays the inventory array value for the part number. If I show the part section the report still functions perfectly with all of the short parts displaying asterisks as well as the shop order. However, when I suppress the section and drill down into it the inventory value is back to the full amount originally calculated in the report header before any decrements.

It appears that the original array has been rebuilt upon drill down. Do I have to set something somewhere that this doesn't happen or am I doing something incorrectly?
 
Do you have "Show all sections in Drill Down" turned on?
It would be repeating the Report Header.
Also, formulas with global variables should usually be evaluated in the WhilePrintingRecords pass.

Bob Suruncle
 
No, I don't have "Show all sections in Drill Down" turned on.

If I only use global variables in the printing pass is there another method to build an array before that pass and subsequently using it in the printing pass?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top