cancel
Showing results for 
Search instead for 
Did you mean: 

Whilereadingrecords problem

0 Kudos

Hello everyone,

I am creating a report Showing "Branch wise Quantity.

Group hierarchy is:

GH1: Branch

GH2: Item

The Query Result Looks Like,

BRANCH      ITEM           QTY

    A                 I1                 11

    B                 I2                 22

    C                 I1               100

    C                 I2                200

NOTE: Here C is Central Location

On Report The desired Result is:

BRANCH      ITEM           Branch_QTY           C_QTY

    A                   I1                      11                      100

    B                   I2                      22                      200

For C_QTY, I have created 3 formulas:

RESET on GH1

WhileReadingRecords;

global numberVar g:=0;

EVAL on GH2

WhileReadingRecords;

global numberVar g;

if({Command_1.Location_id}=1) then

g:=g + {Command_1.Closing_QTY}

DISPLAY on GF2

WhileReadingRecords;

global numberVar g;

g;

BUT I AM GETTING 0 in C_QTY.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Devanshi,

Try this please:

1) Insert a subreport and place it beside 'QTY' field. The datasource of this subreport should be same as that of the Main

2) Right-click the subreport > Change subreport links > Move the 'Item' field to the 'Fields to link to' pane > Select the 'Item' field from the drop-down at the bottom right that says 'Select data in subreport based on field'.

3) Double click the subreport to edit it > Go to Report > Selection formulas > Record.

You should see something like this already:

{Item} = {?Pm-Item}

And an AND condition to this line:

{Item} = {?Pm-Item}

AND

{Branch} = 'C'


4) Add a record selection in the Main report to filter out branch = 'C'


Another way to do this is to create a SQL query and report off of it.


-Abhilash

0 Kudos

Thank you Abhilash.

This solution met my purpose.

But It's taking too much time even while changing a page.

And I also wanted to ask that, by using whilereadingrecords why Central location's QTY is coming zero.Is it possible to do it another way?

Answers (0)