Get Running totals printed in middle of Master Data
Our company has a dataset which lists a bunch of numbers for data in the following format:
(Category) Line 1, No1, No2, No3 and so on.
(Category) Line 2, No1, No2, No3 and so on.
(Category) Line 3, No1, No2, No3 and so on.
...
(Type) Line 20, No1, No2, No3 and so on.
(Type) Line 21, No1, No2, No3 and so on.
...
(Special Type) Line 22, No1, No2, No3 and so on.
The category is a category of employee... and is always line 1 through 19.
The type is representative of a group of categories... and is always line 20 and 21.
The special type is another representative of a group of categories and is always line 22
I know... I would not have it in a dataset this way, but this is what I am being presented with.
So above is the table so it would be represented in the Master band.
However what they need to happen is when they get to line 20 they want a row displaying the running totals for lines 1 through 19.
So somehow I have to inject the running totals in the middle of the Master data.
Then at line 22 I need to inject a row that simply looks like a title header for that row.
What I thought I could do was put 3 master data bands.
1 to display the data, 1 to display the summary total when we hit line 19 and one to display the summary title when we hit line 22.
So it would look like this:
Category Line 1, 10, 5, 10
Category Line 2, 5, 10, 20
...
Category Line 19, 0, 0, 0
Total 15, 15, 30
Summary Title
Special Type Line 22.
I thought I could have the Master Data band for the summary totals to track the running totals and ONLY display at line 19, but it just prints at the bottom of all the master data.
It's like the Master data band runs fully for each band and not 1 after the other per record.
Any suggestions on how to make this work with the dataset I am being handed.
Worst comes to works I'll take that dataset and create 3 temp datasets breaking them into 3 pieces and do subreports or something similar, but at this point I would like to see if it can be done in the report as is just to see if can be done.
I'll continue playing and look forward to your thoughts on this.
Thanks,
Greg
(Category) Line 1, No1, No2, No3 and so on.
(Category) Line 2, No1, No2, No3 and so on.
(Category) Line 3, No1, No2, No3 and so on.
...
(Type) Line 20, No1, No2, No3 and so on.
(Type) Line 21, No1, No2, No3 and so on.
...
(Special Type) Line 22, No1, No2, No3 and so on.
The category is a category of employee... and is always line 1 through 19.
The type is representative of a group of categories... and is always line 20 and 21.
The special type is another representative of a group of categories and is always line 22
I know... I would not have it in a dataset this way, but this is what I am being presented with.
So above is the table so it would be represented in the Master band.
However what they need to happen is when they get to line 20 they want a row displaying the running totals for lines 1 through 19.
So somehow I have to inject the running totals in the middle of the Master data.
Then at line 22 I need to inject a row that simply looks like a title header for that row.
What I thought I could do was put 3 master data bands.
1 to display the data, 1 to display the summary total when we hit line 19 and one to display the summary title when we hit line 22.
So it would look like this:
Category Line 1, 10, 5, 10
Category Line 2, 5, 10, 20
...
Category Line 19, 0, 0, 0
Total 15, 15, 30
Summary Title
Special Type Line 22.
I thought I could have the Master Data band for the summary totals to track the running totals and ONLY display at line 19, but it just prints at the bottom of all the master data.
It's like the Master data band runs fully for each band and not 1 after the other per record.
Any suggestions on how to make this work with the dataset I am being handed.
Worst comes to works I'll take that dataset and create 3 temp datasets breaking them into 3 pieces and do subreports or something similar, but at this point I would like to see if it can be done in the report as is just to see if can be done.
I'll continue playing and look forward to your thoughts on this.
Thanks,
Greg
Comments
BUT... the totals will not print. Not sure if the totals are not calculating or the fact that the sum field is on the child table which doesn't print until it gets to the line it needs to be.
I added a footer and it will show the total, but of course it is at the bottom of everything and not where I want it.
Ok... so I was able to create a variable where I incremented it after each Master data print and then I print the child band when the appropriate (first line) comes up and it works and I get the totals.
But now I can't seem to have a second child set from the master band.
Ahhh... so others will no the answer... I was able to change the child band of the master at runtime when I hit the appropriate line number... now I have this working.
Been a while since I have had to work in Delphi with Fastreports so was a bit rusty. But good to remember the flexibility within FastReports.
Greg