Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Orphan / Widow Headers and or Footers Post Reply Post New Topic
Author Message
YSLGuru
Newbie
Newbie


Joined: 18 Nov 2009
Location: United States
Online Status: Offline
Posts: 6
Quote YSLGuru Replybullet Topic: Orphan / Widow Headers and or Footers
    Posted: 14 Dec 2009 at 2:38pm
Now that I better understand the terms used to describe this issue I believe I can better explain my issue then in my last post a few weeks back.
 
I've read posts about the Orphan/Widow issue (i.e  http://www.crystalreportsbook.com/Forum/forum_posts.asp?TID=5765&PID=17266 ) and I can't find an answer in these that works and so I'm hping a better explination might help.
 
Let's assume that I am using a DB that lists every State in the US and every county within each state and within each county every zip code and within each zip code a list of each sub-zip code, that additional 4 number extension recently added by the Postal service.  I'm using this data source because it provides me with 3 levels of grouping (State, COunty then ZIp code) and 1 detail level, all the 4 digit zip code extensions and its an easy to understand example that does not violate any NDA (which my company has with the maker of our software & the DB it uses.)
 
In this example I would have something like this:
 
H1 - ALASKA
  H2 - Aleutians East Borough
    H3 - 99612
            0001
            0002
    F3 - Total 99612 = 2
    H3 - 99661
           0001
           0002
           0003
           0004
    F3 - Total for 99661 = 4
  H2 - ABC County
    H3 - 12345
            0001
    F3 - Total 12345 = 1
  F2 - Total for Aleutians East Borough = 7
F1 - Total for Alaska = 7
 
 
Fore the sake of brevity I have listed a very limited set of data of which some I made up for time constraints.
 
In this example, when run for all states and countries and zip codes you will have a very large report with many groupings.  WHat happens for me is that no matter how I configure the various options I can't prevent at least 1 of the following from happening
 
1) An instance of F3 or F2 or F1 printing at the top of a page
 
2) An instance of H1 or H2 or H3 printing at the bottom of a page
 
 
When I look at this issue as a rpeorting issue in general it seems that there's no way to dynamically determine where to place a page break based on combinations of rows of DETQAIL and combinations of Headres & Footers.  To avoid #1 & #2 above we have been manually adding page breaks where needed which works until one or more rows in the DETAIL section changes so that the page breaks we had are shifted.  Imagine in this example if 1 county increased the number of xip codes while another (perhaps in a different state) lost the same number of more or less.  This is the kiind of change we run into that prohobots manual page breaks.
 
If Crystal Reports had some way of specifying what NOT to do like a "NO ORPHAN FOOTERS" option at the group level then I think I'd be god to go but atlas there is no such option.
 
The closest solution I;ve seen is one that requires obtaining in advance how many detail rows will fiti on a page and how many detail rows each heading & footer takes and keep a running total (reset at the start of each page) and when a section priints you calculate if the number of rows in that section plus it's header & Footer will push it past the remaining sapce on the page and if it does then enter a page break.  However I'm not sure thats even a realistic solution considering how much time and conmplexity it would take to implement something like that not to mention the changes required should the height change for any section which can happen when cosmetic changes occur.
 
 
Ideas?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 14 Dec 2009 at 3:02pm
You can probably get some of the Headers issues to go away if you use 'Keep Together'.  The one that seems to work is to right click on the section, select 'Change Group'. On the Options tab, select 'Keep Together'. Do this for all the groups.
 
At the same location as the 'Keep Together' is Repeat on each page. This will guarantee that H1, H2, H3 are always at the top of a page, and at the very worse, F1, F2, F3 will fall under the headers.
 
It probably won't solve all the issues, but I think that it will handle most.
 
 
IP IP Logged
YSLGuru
Newbie
Newbie


Joined: 18 Nov 2009
Location: United States
Online Status: Offline
Posts: 6
Quote YSLGuru Replybullet Posted: 14 Dec 2009 at 3:14pm
Originally posted by lockwelle

You can probably get some of the Headers issues to go away if you use 'Keep Together'.  The one that seems to work is to right click on the section, select 'Change Group'. On the Options tab, select 'Keep Together'. Do this for all the groups.
 
At the same location as the 'Keep Together' is Repeat on each page. This will guarantee that H1, H2, H3 are always at the top of a page, and at the very worse, F1, F2, F3 will fall under the headers.
 
It probably won't solve all the issues, but I think that it will handle most.
 
 
 
I have tried that and while we can elimiate various issues we never can get rid of them all and I can't convince my boos there's no option in Crystal Reports to prevent these Orphan/Widow sections.  He says in Adobe this would not be a problem and so logically it should be possible in Crystal as well.  I'm not sure if its true or if I just have not properly explained what the problem is.  
 
Does anyone know if any other softwrae (not just reporting software) like Acrobat or some book publishing software has some kind of Orhpan/Widow option that when eabled tells the software to disallow these upon creation of the output?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 14 Dec 2009 at 3:22pm
well, then the next question is, if the last detail is at the bottom a page, what should be seen on the next page, all that is left is the footer. 
 
Is there a minimum number of details lines that should appear on a page?
 
If it so easy in Adobe, export it to Adobe and have Adobe reformat it. Why reinvent the wheel. Please don't misinterpret this, Crystal cannot do everything, and if another piece of software can get it done in just a few clicks, it will probably save a lot of hair pulling to just do that.
 
HTH
IP IP Logged
YSLGuru
Newbie
Newbie


Joined: 18 Nov 2009
Location: United States
Online Status: Offline
Posts: 6
Quote YSLGuru Replybullet Posted: 15 Dec 2009 at 8:22am
Originally posted by lockwelle

well, then the next question is, if the last detail is at the bottom a page, what should be seen on the next page, all that is left is the footer. 
 
Is there a minimum number of details lines that should appear on a page?
 
If it so easy in Adobe, export it to Adobe and have Adobe reformat it. Why reinvent the wheel. Please don't misinterpret this, Crystal cannot do everything, and if another piece of software can get it done in just a few clicks, it will probably save a lot of hair pulling to just do that.
 
HTH
Lockwelle
 
I don't disagree at all with "if another software can.." but the problem is I don't have that option because the accounting software we use allows for using crystal and thats it.   We do have Adobe and could use it outside of our accounting software however that would not be aceptable for a variety of reasons with security being the biggest and so I'm stuck with making Crystal work in some way.
 
There is no minimum number of Detail lines on a page to answer your question.  I know this is a tough problem that many have run into and it kills me that Crystal has no clear way of dealing with it and Crysta was at least for many years the dominant reporting software.
 
Thanks for replying though.
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 15 Dec 2009 at 9:25am
I was thinking...export it to Adobe and manipulate it there.
 
So really the big question is what should a page that just has footer information look like?  Once you answer that, the report may not be too hard.  Maybe there should be a miminum number of details lines, then you can count and see how close you are....but you don't want to count lines.
 
Without a plan of how it should look, there is no solution, because nothing will ever be quite right.
IP IP Logged
YSLGuru
Newbie
Newbie


Joined: 18 Nov 2009
Location: United States
Online Status: Offline
Posts: 6
Quote YSLGuru Replybullet Posted: 15 Dec 2009 at 10:31am
Lockwelle,
 
Well I did come up with one way but its so complicated (setup wise) and not flexable (can't change the report afterwards without re-doing this too) that I did not embrace it and that is to calculate how much page space seach section requires and use a running variable that is reset to zero at the start of each page, and as each section prints, update this value and then check it and if the space consumed so far is within a range that varies based on the current section updating this variable, then it can choose to insert a page break and force the rest of the data to the next page.
 
I would need to calculate ideal values for various combinations of sections and the more groups the more ocmplex that would be but it would be a possible solution.  In short what I am trying to do is encapsulate in a formula the sssame logic used by the report viewer when determing where to split data if they were to export the data to a spreadhseet and make page break edits manually. 
 
Its the age old problem of how to you put into a formula or routine the same judgement call logic a user uses when manually creating the data in their favorite medium (often Excel).  And of course the asnwer is you really can't do that normally because judgement call logic has no pattern.  But in this particular case I can drive a pattern its just very complicated to caluclate and implement.
 
Crystal really needs a "No Orphan" option on its section expert for footer and a "No Widow" option for the Header sections.  While there still may be cases where Crystal can't honor those settings it would at least handle a good number of these widow/orphan issues.
 
Thanks again fro replying
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 15 Dec 2009 at 12:21pm
So basically you were counting lines.  Unfortunately, it is the only option currently open in CR.  We are using another reporting tool as well, and counting lines doesn't even work, at least not in setting values in other sections...very frustrating.  SSRS doesn't have a widow or orphan option.
 
In fact, I don't know of a single reporting tool that does (not that I know a lot of them). 
 
The way the Adobe probably does it pagination is looking at rules of English and not allowing a paragraph to print only 1 line at the bottom of a page, but it operates under different rules than reporting.
 
Sorry can't be of any help
IP IP Logged
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.016 seconds.