Multi pages report
Hello!
I need to make a report with 3 pages, 3 different bill for example, per each user (more than 10000 users). All the data to get the user and bills information are in tables or query. It should be in this order:
(User1-Page1)-(User1-Page2)-(User1-Page3)-(User2-Page1)-(User2-Page2)-(User2-Page3).....
I tryed a lot of convinations of reports, subreports, but nothing works. Can somebody help me?
I need to make a report with 3 pages, 3 different bill for example, per each user (more than 10000 users). All the data to get the user and bills information are in tables or query. It should be in this order:
(User1-Page1)-(User1-Page2)-(User1-Page3)-(User2-Page1)-(User2-Page2)-(User2-Page3).....
I tryed a lot of convinations of reports, subreports, but nothing works. Can somebody help me?
Comments
page1.visible := (UserVariable = 'user1') or (UserVariable = 'user2')
Check how to pass values to variables in the manual or in the other threads of the forum here
The easiets may be to have a query for the users and another one for the data on the 3 pages. However, this may be quite slow.
What is the real problem here? That it does not work at all, or that it takes too long?
(User1-Page1) (User2-Page1) (User3-Page1) (User4-Page1)....(User1-Page2) (User2-Page2).... <--This's not what i need
(User1-Page1) (User1-Page2) (User1-Page3) (User2-Page1)(User2-Page2) (User2-Page3) (User3-Page1) .... <--That is
I need to have the information grouped by customer, composed by 3 diferents pages.
Page1.OnBeforePrint(sender);
begin
page1.visible := yourcondition. This can be a function call, back to your Delphi code or FRscript. Read the manual for this
end;
My methods would use 4 queries, an outer one for the user, and 3 nested inner ones for the 3 pages, and there would be 3 reports.
while not customer_query.EOF do
begin
report_query_page1;
print_page1;
report_query_page2;
print_page2;
report_query_page3;
print_page3;
customer_query.next;
end;
Never having used a FR report with multiple pages (just subreports) there may be other ways of printing.
This method is not the most efficient and may be slow. 3 queries have to be run and 3 report have to be rendered for each customer. However, depending on the database used for storage some careful indexing might improve the data access time.