Creating Complex Reports, and Sub Reports

edited 2:08AM in FastReport 4.0
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

Comments

  • Anu de DeusAnu de Deus Hampshire, UK
    edited 2:08AM
    I think you should have 1 separate dataset for each of your groups.
    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)


Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.