Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Details section printed twice before/after page Post Reply Post New Topic
Author Message
Bibo
Newbie
Newbie


Joined: 15 Oct 2012
Online Status: Offline
Posts: 4
Quote Bibo Replybullet Topic: Details section printed twice before/after page
    Posted: 15 Oct 2012 at 6:33am
I have a problem with page breaks in a CR report. And yes, I have searched anywhere else for a solution or answer - unfortunately with no luck so far.

The situation is: Using CR 2008 or CR 2010 (version 14.0.1.287 RTM) I created a report for an invoice. It's quite complex with several report headers, page headers, group headers, detail sections etc. It contains some subreports (in the details sections), too.

The problem is that the report, if printed (or shown as a preview e.g. in SAP Business One), repeats the last detail section of a page on the next page without being "told" to do so. The problematic area is:

... group header

  • detail section A / contains just a dotted line
  • detail section B / contains a formular field to init variables (field suppressed) option "suppress empty section" is ticked
  • detail section C / contains a subreport that can grow in size and contains a picture
  • detail section D / contains fields that can grow
  • detail section E / contains fields that can grow
  • detail section F / contains fields that can grow
  • detail section G / contains fields that can grow
  • detail section H / contains fields that can grow
  • detail section I / contains just a dotted line
  • detail section J / contains fields that can grow
  • detail section K / contains fields that can grow
  • detail section L / contains fields that can grow
  • detail section M / contains fields that can grow
  • detail section N / contains a text field that can grow
  • detail section O / contains a text field that can grow
  • detail section P / no content, just a "space bar" between printed lines
  • detail section Q / contains two subreports that can grow
  • detail section R / contains a text field that can grow
  • detail section S / contains a text field that is fix

group header ...

Depending on the data to print, some of the listed detail sections are suppressed by conditions/formulas. The suppressed detail sections are not always the same: Sometimes they are suppressed, sometimes not. This works without problem.

The complete report works fine and the page break itself works/is done - the only problem is that the very last detail section of a page (at the bottom of the page, next section is the footer) is printed correctly at the bottom of one page and then repeated at the top of the next page.

I do not want it to be repeated. I need a simple 'soft' page break when the page is full and then the remaining detail sections should be printed on the next page.

I tried everything I could think of (keep together for complete detail section, just for some detail sections, rearranging the order of the sections, putting the subreports elsewhere in the order, formatting the subreports with/without keep together and so on). Unfortunately nothing helps.

It's not possible to force a page break after X lines as I do not know how high/long a complete detail section is (how much details sections are printed [e.g. a - s, just a - m etc.]), it always varies, due to the data.

Is there a solution to this?

The problem already costed me some nights of work and testing. Thank you for a tip or hint!

Dead
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 16 Oct 2012 at 4:44am
the only idea that pops to mind is Keep Together being set...doesn't necessarily make sense, as it I wouldn't think that CR would do that, but it's the first thing that comes to mind.
IP IP Logged
Bibo
Newbie
Newbie


Joined: 15 Oct 2012
Online Status: Offline
Posts: 4
Quote Bibo Replybullet Posted: 17 Oct 2012 at 7:08am
Hm, that's what I thought, too. But unfortunately that didnot help. I tried everything: NOT keeping together all detail sections and the complete detail section; the opposite, keeping just several detail sections together, keeping/NOT keeping the subreport (placed in one detail section) together... Nothing really helped. The last detail section (at the bottom of a page = out of paper) is always repeated on top of the next page. (The report is printed on a laser, not on endless paper.)
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 18 Oct 2012 at 4:33am
sorry, nothing else comes to mind.  All the standard ways to force a page break are useless with the can grow sections.
 
i'm trying to think of a way to 'see' what cr is thinking as far as the duplication and nothing is coming to mind.  all that I have is the vague notion of counting lines when a section prints (since they are conditionally suppressed) and see if there is any pattern...or page each section 'thinks' its on.
 
Sorry I can't be of more help.
IP IP Logged
Bibo
Newbie
Newbie


Joined: 15 Oct 2012
Online Status: Offline
Posts: 4
Quote Bibo Replybullet Posted: 19 Oct 2012 at 5:33am
Lockwelle, thank you for your comments + efforts so far. I, too, tried to find a more or less regular pattern in CR's behaviour. Though I tried everything I could think of I found none. Somewhere I read that someone had a similar problem and solved it by calculating how much space on a page (from top down) has been used (in mm) and forced a page break after X mm. Besides that this sounds like a monstrous heap of programming work I cannot do this in my case as the detail sections contain fonts in various pt-sizes and a picture.

Seems that this problem will stay unsolved...
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 19 Oct 2012 at 5:43am
believe it or not, the point sizes and picture wouldn't be an issue, as each section would be a fixed size (it's akin to counting lines) where the difficulty arises for your report specifically is the can grow...that would require lots of programming as you can't just count how long the string is and how much it wrapped since not all letters are the same width...and CR doesn't provide any facility to determine how big an object is after printing...
 
so we can never know how much of the page has been used...
 
we could guestimate, but that is never satisfactory, at least to me...the reports always mess up somewhere...
 
alas, I think that you correct in that will stay unsolved.
 
Sorry I couldn't provide any new insight
IP IP Logged
jlees
Newbie
Newbie


Joined: 26 Jul 2013
Location: United Kingdom
Online Status: Offline
Posts: 5
Quote jlees Replybullet Posted: 30 Jul 2013 at 3:12am
Did you ever find a resolution to this problem?

I'm experiencing something similar with Crystal Reports 9 whereby I have a report with seven detail sections, each containing a single subreport (and nothing else). I have each subreport set to suppress if no data and each section set the same.
This works fine as long as all subreports have data. However, if a subreport doesn't then the section doesn't print (so far so good)...BUT the next section/subreport prints twice!!

It's causing me an awful headache and, like you, requiring many out-of-hours attention to try and find a reason / resolution.
IP IP Logged
Bibo
Newbie
Newbie


Joined: 15 Oct 2012
Online Status: Offline
Posts: 4
Quote Bibo Replybullet Posted: 06 Aug 2013 at 8:31am
No, unfortunately not Dead

The problem is still unsolved and though I asked some other CR experts the problem remains - they all shrugged their shoulders. What you describe is very similar to what I experienced with my report.

Someone told me that the cause may be the different pdf-engines CR (or other programs) are used to show or print the report. In my case the report is designed in CR 2011 and printed via SAP Business One. If I print the report directly from CR 2011 everything works fine, no problem.

If I print it via the print function from SAP Business One the problem occurs.

Even SAP support could not find a solution or explanation. They just recommended to re-design the report Confused
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.031 seconds.