1 (edited by CDB 2020-03-10 21:33:30)

Topic: [SOLVED] Difficulty getting a Group and Subreport section

A plea for some help again please.


I am trying to persuade Fast Reports to output the following.


In a group:


Supplier Name
Information about orders pertaining to that supplier
Person the order is for.
(repeat all orders and tech names for that supplier)
(move on to next supplier)


I have had some success, I can get the Supplier and information to display, I'm having a problem displaying the person the order is for.


I did manage to show just one person, but only for the first entry. I've now managed to lose even that capability.

So, my current problem is:

1. getting the person name to print or show.

2. Prevent printing of Suppliers who have no current orders .


I have used  Dmitry's SubReports example as reference and have read the Fast Reports user guide for FR 4.0 but don't seem to be able to achieve the results that I'm looking for.

So just to recap, I'm looking for this result.

Supplier 1
item A_1
item B_1
item C_1
person name 1


item A_2
item B_2
person name 2


etc


Supplier 2


repeat as necessary


Supplier who has no orders - should not appear in the list. In the test case this would be Harbournes Haulage and Gametek.


I've attached a screen shot of what I'm currently achieving which is almost correct.


The code I'm using in FR4.0 is:


procedure MasterData2OnBeforePrint(Sender: TfrxComponent);
begin
    MasterData2.Visible := <Technician."id">=<Requests."id_techname">;
    // MasterData2.Visible := <Requests."id_techname">=<Technician."id">;        
end;


procedure MasterData3OnBeforePrint(Sender: TfrxComponent);
begin
    MasterData3.Visible := <Supplier."id">=<Requests."id_Supplier">;  
end;
Post's attachments

Attachment icon fast Report example.png 47.84 kb, 2 downloads since 2020-03-08 

On a clear disk you can seek forever

Re: [SOLVED] Difficulty getting a Group and Subreport section

The design page layout attached

Post's attachments

Attachment icon report_design.PNG 133.38 kb, 3 downloads since 2020-03-08 

On a clear disk you can seek forever

Re: [SOLVED] Difficulty getting a Group and Subreport section

I've just seen JoshuA's post,

This looks very similar to what I'm trying to achieve - I'll investigate his and Derek's example

On a clear disk you can seek forever

Re: [SOLVED] Difficulty getting a Group and Subreport section

After some nutting out and looking at JoshuA's Derek solution, I have revamped everything and now have everything where I want it (almost).

I can see no way to have the Person name show at the bottom of each list, so have changed that to the top of each list.

I'd like to know if it is possible to have my demarcation dotted line only appear at the bottom of each supplier instead of after each Person name group.  I have had a fiddle with footers and child bands, to no joy.

I can live with the result I'm getting if i have to.

Now all that remains is to restrict the printing to a date range, rather than the whole DB each time I print.

I've attached my latest effort.

Post's attachments

Attachment icon latest_report.PNG 25.2 kb, 2 downloads since 2020-03-08 

On a clear disk you can seek forever

Re: [SOLVED] Difficulty getting a Group and Subreport section

Hello CDB,
If you want to show the techname at the bottom, you could add a group footer and move the techname down from the group header (but I think it might mess up your sorting so you might need to fiddle around with that).
Putting a line at the bottom of each supplier is, again, possible by adding another group footer (please see the attached (an old version of your project).
Derek.

Post's attachments

Attachment icon prq2.zip 346.74 kb, 32 downloads since 2020-03-08 

Re: [SOLVED] Difficulty getting a Group and Subreport section

Well thank you Derek,

I thought I had tried another group footer and couldn't get it to work. Anyhow, your solution has solved my problem.

On a clear disk you can seek forever