Creating Complex Reports, and Sub Reports
So, any suggestions would be appreciated. I have tried several options and can't quite figure it out. This is very complicated.
Read through 93,000 records and calculate total.
Go back to the beginning and sort Ascending.
Display a summary, on each group.
Group 1, Data Totals
Data Totals
Summary Group 1
Totals, containing Data
Sub Totals
Total for Group 1
Group 2 Data Totals
etc...
SO I am trying to process, and re-process and then repocess per group, with a group summary.
Any suggetions on how to process 30 records sorted one way, then re-process data another way. Then counitue to the other records
Read through 93,000 records and calculate total.
Go back to the beginning and sort Ascending.
Display a summary, on each group.
Group 1, Data Totals
Data Totals
Summary Group 1
Totals, containing Data
Sub Totals
Total for Group 1
Group 2 Data Totals
etc...
SO I am trying to process, and re-process and then repocess per group, with a group summary.
Any suggetions on how to process 30 records sorted one way, then re-process data another way. Then counitue to the other records
Comments
Then you will think: but it's 93K records, it will get too slow!
Then you should use temporary or memory tables.
I use to have something similar. The idea is: prepare all the data first, design the report afterwards.
Try something like:
Drop tbltmp1;
Drop tbltmp2;
Drop tbltmp3;
Select * from db1
into tbltmp1;
Select * from db1
group by field1
into tbltmp2;
select * from db1
sort by field23
into tbltmp3;
Just in case you don't know this, you can run all of the lines above in 1 single SQL command in any major comercial database (in fact, I don't know any that can't)
So, after executing that, you have tbltmp1, tbltmp2, and tbltmp3 ready for you, just use them in your report.
If you want to go hardcore, and use only 1 dataset in your entire report, you still can do this:
Select * from tbltmp1
union
Select * from tbltmp2
union
Select * from tbltmp3
In other words, ALL your records in one query, sorted as you want, all you have to do now is group them properly.
(you may or not want to drop the tmp tables after the report is closed)