Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: how to prevent subreports from overlaping Post Reply Post New Topic
Page  of 2 Next >>
Author Message
JRCharlie
Newbie
Newbie
Avatar

Joined: 25 Apr 2015
Online Status: Offline
Posts: 15
Quote JRCharlie Replybullet Topic: how to prevent subreports from overlaping
    Posted: 14 Oct 2020 at 5:14pm
Hi
I have a report with 4 subreports.
These subreports hold the order category and their due dates.
Each Category holds orders for an entire week
I have a page break after each day on each sub report.
I have tried placing the 4 subreports in a group section on the main report but they overlaped, then I created a second group to place c and d but they only show after all the orders of A and B have rendered.
I want to follow the format below and having each day in a seperate page,

Category A       Category B

Category C       Category D

Thanks
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 19 Oct 2020 at 4:43am
Are each of the sub-reports in their own section.  They should not overlap if they are.
IP IP Logged
JRCharlie
Newbie
Newbie
Avatar

Joined: 25 Apr 2015
Online Status: Offline
Posts: 15
Quote JRCharlie Replybullet Posted: 19 Oct 2020 at 2:59pm
They overlap when I place them on the same section.
I also placed them on seperate group sections, section 'A' and 'B'
subreport A and B side by side in Section 'A' and Subreport C and D also side by side in Section 'B'.
This way it displays all the orders of the fist group for the entire week one day per page than does the same for the second group.
But I would like to display subreport A and B then C and D below A and B printing all one day per page or two if the report is longer than one page
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 20 Oct 2020 at 4:16am
Unfortunately I do not think you can detect if a section is longer than one page other than somehow using the pagenumber function.  Not sure how that would work.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 20 Oct 2020 at 5:42am
Since you want only 1 day per page, I would add a parameter the subreports for the day desired. The different sections will help, but it sounds like what you are saying is that subreport A prints 3 days of info and then subreport D is printing those same 3 days, and the data is jumbled (just looking at dates)...

This might require some refactoring so that you can pass the dates that you want to subreports.

It is the only idea the comes to my mind.

HTH
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 20 Oct 2020 at 5:44am
As a follow-up to what kevlray is saying...a subreport is just that, it is a complete report, and it is going to render in full before another report starts rendering.

you can count lines to determine if section is longer than 1 page...and that is only an estimate.

HTH
IP IP Logged
JRCharlie
Newbie
Newbie
Avatar

Joined: 25 Apr 2015
Online Status: Offline
Posts: 15
Quote JRCharlie Replybullet Posted: 21 Oct 2020 at 4:01pm
I have an idea, accept if it works I dont know how to do it.
So far the subreports are printing one day per page the only thing is, it prints subreport A and B for the entire week before starts to print subreport C and D.
Now my idea is, could the main report send a date paramater to all the sabreports, this way instead of printing the entire week it would print one day at a time.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 22 Oct 2020 at 1:11pm
I will give a qualified yes. If there is a data in the main report that has a date, you could use that.

If you have a date range parameter for the report, you should be able to increment the date and send it to the subreports.

I can see a start date parameter and in a group header keep incrementing it until it is larger than the end date.

It's an idea.
HTH
IP IP Logged
JRCharlie
Newbie
Newbie
Avatar

Joined: 25 Apr 2015
Online Status: Offline
Posts: 15
Quote JRCharlie Replybullet Posted: 22 Oct 2020 at 2:53pm
Yes, the same data that exist in the subreport also existes in the main report.
I also was thinking by gouping the date and when the date would change I would pass it to the subreports.
Since I don't have much experience I would need more detail on how to do this.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 23 Oct 2020 at 12:09pm
Sounds promising...
I would create a group based on the date.
Then in the group header section for the date, you can call you subreports and link the subreports using the date field in the main report to map to the date parameter in the subreport.

of course you would have multiple group header sections, one for each subreport.

HTH
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.