Fix number of record per page.

Stimulsoft Reports.NET discussion
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Fix number of record per page.

Post by Edward »

Hi

Please show the result you would like to achieve.

Thank you.
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Fix number of record per page.

Post by fkmfkm »

Edward wrote:Hi

Please show the result you would like to achieve.

Thank you.
I have

DataBand1 (max 5 records)
HeaderBand2
DataBand2 (max 5 records)
HeaderBand3
DataBand3 (max 5 records)

I would like to limit the number of records for each databand to 5 for each page. If its more than 5 then then it will move to the next page and so on. I want all the bands to be on every page.
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Fix number of record per page.

Post by fkmfkm »

Do you understand what I mean ?
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Fix number of record per page.

Post by Jan »

Hello,

Add following code to AfterPrintEvent of each databand:

Code: Select all

if (mydatasource.Position > 5)mydatasource.Last();
Thank you.
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Fix number of record per page.

Post by fkmfkm »

Jan wrote:Hello,

Add following code to AfterPrintEvent of each databand:

Code: Select all

if (mydatasource.Position > 5)mydatasource.Last();
Thank you.
but this way...it stops printing immediately. I wants it to continue to the next page...5 each page till no more records...
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Fix number of record per page.

Post by Jan »

Hello,

Try following:

1. Create integer variable in report dictionary;
2. In DataBand Rendering event add following script:

Code: Select all

myvariable++;
if (myvariable > 5)
{
  myvariable = 0;
  this.Engine.NewPage();
}
Thank you.
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Fix number of record per page.

Post by fkmfkm »

Jan wrote:Hello,

Try following:

1. Create integer variable in report dictionary;
2. In DataBand Rendering event add following script:

Code: Select all

myvariable++;
if (myvariable > 5)
{
  myvariable = 0;
  this.Engine.NewPage();
}
Thank you.
I have tested this method before....Edward has shown me this method before.

This method got problem..It will cause my subsequent Bands (Band2 and Band3) to be pushed away..

I want all my band1 band2 and band3 to be one every pages.....

Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Fix number of record per page.

Post by Jan »

Hello,

Band2 and Band3 have any joins to Band1?

Thank you.
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Fix number of record per page.

Post by fkmfkm »

Jan wrote:Hello,

Band2 and Band3 have any joins to Band1?

Thank you.
No there is no join to Band1.


I even tried without band2 and band3, the header2 and header2 also got pushed to next page.

Actually what does Engine.NewPage() actually do ? From the name of the method its doing exactly what my report does. ..Moves to New page...
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Fix number of record per page.

Post by Edward »

Hi

Engine.NewPage() starts a new page, so after calling of that command next element of the report will be rendering on the new page.

Thank you.
Post Reply