It is currently 15 December 2018, 2:59 Advanced search

Column Total from 2 Reports

Questions and answers on how to best use Instant Developer

Column Total from 2 Reports

Postby Gaby_h » 16 March 2014, 21:36

I have 1 Book with 2 independent reports, each has its own filter ie 1 MasterPage with 2 Bodyparts. Each report has a column total in its report footer. Also I have 2 spans (yellow boxes) outside the body parts, 1 yellow span for each report to store column totals.
- Left yellow box shows the column total from green report as it should. Right box does not render the col total from brown report, it's always empty. Why? What should I do to show both totals?
Attachments
2rpts.JPG
2rpts.JPG (58.6 KiB) Viewed 3424 times
Gaby_h
 
Posts: 888
Joined: 17 July 2013, 18:22
Location: Vancouver, Canada

Re: Column Total from 2 Reports

Postby lucabaldini » 17 March 2014, 14:28

The "total" get's computed by each report (actually by each section that can count the total, like a GroupHeader/Footer, ReportHeader/Footer...) so it should't depend on the other report.

So probably it depends on how you print/show the totals...

How are you showing them? Are you using a mastro box or a section box? I immagine there are two more boxes on the mastro page (one for each yellow total)... the I immagine there are two reportfooter sections that renders exactly in those boxes and inside the boxes there is a span that shows the total for its report...

Is that the configuration? Can you post an image of the design-time configuration?
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 3341
Joined: 1 October 2010, 17:03
Location: Bologna

Re: Column Total from 2 Reports

Postby Gaby_h » 17 March 2014, 16:09

Yes in the above example I have a report footer in each report to show column totals, these are fine. The yellow boxes should show the same totals as in report footers.
In this example I didn't show totals in report footer.
The yellow boxes are created in the master page each having a span. Each span has the expression that computes the column total. The left box (total for Green report) always show the column total, the right yellow box (total for Brown report) is always empty. As you can see in this pic the procedure to compute the column totals is exactly the same. Why is it that one works the other does not?

I also noticed the following: currently in the tree view the Green report comes before the Brown report. If I move the Green report down below the brown report, the yellow total of the green report disappears, the yellow total of the brown report gets computed.
Attachments
2reports.JPG
2reports.JPG (114.31 KiB) Viewed 3400 times
Gaby_h
 
Posts: 888
Joined: 17 July 2013, 18:22
Location: Vancouver, Canada

Re: Column Total from 2 Reports

Postby lucabaldini » 17 March 2014, 16:35

I suspect that the probem is due to the fact that you are reading the Sum function in a Page-span.

I would do the following:
- delete the two span from the page boxes
- create a new box with a new span in the two report footer sections and use the expression you just used in your page boxe's span
- connect the two report footer sections with the two boxes on the page

In this way it should work.

The fact is that the Sum function (like any other report's aggregate function) can't be called at any time...
The system does the following: it asks all reports if they want to print. The first that answers is the Greenrpt that asks for a OneMasterPage page. The system creates that page and creates all the boxes and spans... at this time only the first report is able to answer the question: "what's the sum of field XXX?"... the second report is unable to answer because is not started yet... then the system tells the first report to print everything it needs on the page just created... then it asks the second report if it needs to print something on that page... and the second report stars printing by executing the query and formatting its sections...

That's why only the first gets printed... I hope I explained in a human readable way :-)
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 3341
Joined: 1 October 2010, 17:03
Location: Bologna

Re: Column Total from 2 Reports

Postby Gaby_h » 17 March 2014, 18:19

Yes it worked great, that's fantastic. Once again thank you very much for your help :) :)
Gaby_h
 
Posts: 888
Joined: 17 July 2013, 18:22
Location: Vancouver, Canada

Re: Column Total from 2 Reports

Postby lucabaldini » 18 March 2014, 7:40

You are welcome :-)
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 3341
Joined: 1 October 2010, 17:03
Location: Bologna


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 5 guests

cron