Page 1 of 1

Keep with next-functionality

Posted: Wed Apr 24, 2013 6:42 am
by olaodling
I have tried to find a "keep with next"-functionality (like the property you can set in Word on a paragraph) when creating reports, without any success.

The reports we're creating shows a number of header + text-pairs, where the header is a fixed text and the text-part is the value from one column in the data source table.

Ex:
Name
John Doe

Address
Unknown Street 51

The problem is that at page breaks, the header line can end up on the bottom of one page, and the text part starts at the top of the next page (the text parts can occationally be very long, sometimes more than a page).

Is there some way I can configure the report to make the header lines to be printed on the same page as the corresponding text (like the "keep with next"-property in Word)? Or is there any other work-around to achieve the same result?

Thanks!

Re: Keep with next-functionality

Posted: Wed Apr 24, 2013 9:08 am
by Alex K.
Hello,

Please try to use the additional Panel component on which put your two Text component and set the CanBreak property to false for panel component.

Thank you.

Re: Keep with next-functionality

Posted: Wed Apr 24, 2013 9:51 am
by olaodling
Hello Aleksey,

and thanks for your reply. The solution you propose I have tried, and it works splendid, as long as the second text component doesn't contain so much text that it spans more than a page. In that case, the output gets really bad :? (with empty pages).

And since some of the second text components can contain much text, there will certainly be occasions where it will contain more than one page of data, and then the output will not be accepted by out customer.

Do you have any other idea?

Thanks.

Re: Keep with next-functionality

Posted: Thu Apr 25, 2013 7:06 am
by olaodling
Hello again,

Is there any possibility to add my own event handler to some event in the rendering process to examine the text in the second text box and change the CanBreak-property of the textbox and its parent depending on how much text there will be rendered in the textbox?

Thanks!

Re: Keep with next-functionality

Posted: Thu Apr 25, 2013 12:51 pm
by HighAley
Hello.

Could you send us your report template with sample data to reproduce the issue?
We will try to provide you a solution.

Thank you.

Re: Keep with next-functionality

Posted: Fri Apr 26, 2013 8:26 am
by olaodling
Thanks for looking into my problem.

I have attached six files, report file, schema file, two data files and two pdf-files with the rendered reports from the two data files.

As you can see, the report file is simple, but will show the problems I have implementing a "keep with next"-functionality.

Viewing the first pdf, one can notice that the header "Fourth Data" will keep to the next text field, and that's good. But notice the big, empty space at the lower part of page one, which will not be acceptable to my customer (the big empty space is due to the CanBreak-property set to false for the Panel).

The second pdf is just for showing the behaviour when having a text field bigger than a page in the Panel, with an extra blank page in the middle.

And to summorize my need, I want to make sure that the header line (e.g. "Fourth Data") will always be stuck with the following text field, and not having the risk of the header line being the last line on a page (with the following text field starting at the next page).

Thanks!

Re: Keep with next-functionality

Posted: Fri Apr 26, 2013 11:23 am
by Alex K.
Hello,

As a way, you can try to use the Child component.
Please check the modified report in attachment.

Thank you.

Re: Keep with next-functionality

Posted: Tue Apr 30, 2013 9:29 am
by olaodling
Hello.

I tried with the Child component, and though the result was better, it is not good enough.

Scanning the documentation once more, I found the RenderTo property (or ReportTo as the documentation says) which looks promising.

Question: MUST the two connected text components be in the same container(e.g. Panel)?

In my efforts to implement the "keep with next"-functionality, I need to keep the two text components in different containers.

Thanks

Re: Keep with next-functionality

Posted: Tue Apr 30, 2013 12:50 pm
by olaodling
Hello.

Finally I solved the problem (at least I think so), and it was equally easy as hard to find out ;)

If I make the header line text component so big that it covers the first line of the next text component, and sets the CanBreak-property to false, the rendering engine will keep the header line text component unbroken. The following text component has the CanBreak-property set to true which means that it can be broken anywhere. But since the two overlaps, the engine will guarantee that at least the first line from the latter text component always will be printed on the same page as the header.

So simple, but still hard to find out :)

Thanks for all the effort you have put into my questions!

Regards Ola

Re: Keep with next-functionality

Posted: Wed May 01, 2013 6:55 am
by Andrew
Hello,

Great!
Thank you for letting us know about this.

If you have additional questions. do not hesitate to contact us.
Thank you.