Splitting up report based on a value
EPML
UK
(Using D7 Ent)
Hi All,
Still learning how to use Fr4 at the moment and was wanting to get some guidance on how I can make a report start a new page when the month changes in the data results I get from the query populating the report.
I have a Date field in the select statement of my query so I can always work out the month and the query is ordered by the Date field too.
At the moment the report continuously displays data from the Master Data block over numerous pages. What I need to do is make sure a month change in the returned data, starts a new page in the report.
Can anyone shed some light on how I can achieve this please.
Many thanks for any help in advance.
Hi All,
Still learning how to use Fr4 at the moment and was wanting to get some guidance on how I can make a report start a new page when the month changes in the data results I get from the query populating the report.
I have a Date field in the select statement of my query so I can always work out the month and the query is ordered by the Date field too.
At the moment the report continuously displays data from the Master Data block over numerous pages. What I need to do is make sure a month change in the returned data, starts a new page in the report.
Can anyone shed some light on how I can achieve this please.
Many thanks for any help in advance.
Comments
something like
var PreviousMonth : Integer;
MasterData1.OnbeforePrint;
begin
if (<mainquery."month">) <> PreviousMonth then
Engine.NewPage;
PreviousMonth := <mainquery."month">;
end;
Obviously this is just an (non-working) example, you need to extract the month from your query and store it somehow, I assume you could use integer.
Maybe you can create a function (if there isn't one already) like ExtractMonthFromDate.
Another option is to use a GroupHeader object, just fill in all the fields and it will do it for you. Read the User Manual.pdf, it's all there
Thank you Anu de Deus for your help with this. [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> I will try it out and let you know how I get on![/img]
Just wanted to let you know that your example helped me achieve what I needed! Many thanks again.