Breaking the page after printing certain number of lines

Stimulsoft Reports.NET discussion
Post Reply
Aidin Gharibnavaz
Posts: 2
Joined: Mon Sep 13, 2010 1:10 am
Location: Tehran

Breaking the page after printing certain number of lines

Post by Aidin Gharibnavaz »

Hi!

I have a report with one page and a single Data Band in it.

I want the data band to break the page after printing certain number of lines. For example, after printing 30 lines of data, it should print the others in the next page.

The problem is, number of lines in the page (30 in the example above) sets from outside the report, and It's not a fix number. Also I don't know how many rows I've got in the data source. Thus pages have to be create at the run time.

Is it possible? Any ideas?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Breaking the page after printing certain number of lines

Post by Alex K. »

Hello,

You can add the following code in metod "After Print" on DataBand component:

Code: Select all

if (Line % Variable1 == 0) Engine.NewPage();
Please see the sample report in attachment.


Thank you.
Attachments
591.Sample Report.mrt
(16.7 KiB) Downloaded 390 times
Aidin Gharibnavaz
Posts: 2
Joined: Mon Sep 13, 2010 1:10 am
Location: Tehran

Breaking the page after printing certain number of lines

Post by Aidin Gharibnavaz »

Thanks a lot for the quick answer! That's solved my problem.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Breaking the page after printing certain number of lines

Post by Alex K. »

Hello,

We are always glad to help you!
Let us know if you need any additional help.

Thank you.
Post Reply