Display limited amount of data per page???

Stimulsoft Reports.NET discussion
abhi0410
Posts: 47
Joined: Fri Sep 26, 2008 12:42 pm
Location: bombay

Display limited amount of data per page???

Post by abhi0410 »

How to show specific amount of row or data per page??
i mean when my datasource is returning 20 rows then i want to show 12 in first page then remianing in 8 in another page..

rows can be of any number..like 30... then i wan to show 12 in first page, 12 in second page and the rest 6 in third page...

how to Do this???

Urgent...reply soon.

Thanks
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Display limited amount of data per page???

Post by Edward »

Hello.

In the 2008.2 official release version you can put the following code in the BeforePrintEvent of the DataBand component:

Code: Select all

if (LinesOnPage>=12)
{
	LinesOnPage = 0;
	this.Engine.NewPage();
}
LinesOnPage++;
LinesOnPage is an int type variable which must be added into the Dictionary of the report.

Thank you.
abhi0410
Posts: 47
Joined: Fri Sep 26, 2008 12:42 pm
Location: bombay

Display limited amount of data per page???

Post by abhi0410 »

I am using Stimulsoft Reports.Net 2007.2 for .Net 2.0.

How to do in that?????

Thanks
abhi0410
Posts: 47
Joined: Fri Sep 26, 2008 12:42 pm
Location: bombay

Display limited amount of data per page???

Post by abhi0410 »

i am getting error becoz of the word "engine"...
How to solve this???/

plz reply soon.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Display limited amount of data per page???

Post by Edward »

You have received this error because I told you about new feature of 2008.2 build and EngineV2.

In previous versions you can use StartNewPageIfLessThan property of the band. This property will start rendering of the DataBand from new page when amount of empty space after rendering the band is that value, e.g.:
MyDataBand.StartNewPageIfLessThan = 20 and new page will be started when 20% of the page's height are free after rendering of the DataBand's row.

Unfortunately in previous version there is no other more elegant solution.

As a variant you can create a special field in the DataSource which can be used in condition of the GroupHeader. Height of the GroupHeader can be set to zero and each group can be rendered on the new page.

Thank you.
abhi0410
Posts: 47
Joined: Fri Sep 26, 2008 12:42 pm
Location: bombay

Display limited amount of data per page???

Post by abhi0410 »

ok...Thanks...Actually i have created and designed around 40 different reports with old version.....

If i switch to the new version ie, 2008 then will it create any problem?????

because those reports are working fine.....except with few less functionality....

Thanks....
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Display limited amount of data per page???

Post by Edward »

If you open previously created reports in new 2008.2 version and run them, they will work the same way, because report.EngineVersion = EngineV1 is used by default for earlier created templates.

For that new feature you have to select 'Report' object in the 'Properties' window and set EngineVersion to 'EngineV2' value.

Thank you.
sector7g
Posts: 26
Joined: Tue Apr 29, 2008 9:32 am
Location: Germany

Display limited amount of data per page???

Post by sector7g »

Hello,

I used this feature in a GroupHeader BeforePrintEvent:


if (PageNumber!=1 && PSystem_Sys_Client.PrintOption1)
{
this.Engine.NewPage();
}
MessageBox.Show(PageNumber.ToString());



The PageNumber is always -1 ???

I also tried IsFirstPage. Nothing works.
Any Idea?

regards Ralf
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Display limited amount of data per page???

Post by Edward »

Hello.

This code will work only with EngineV2.

If it does not work, please send the report template with this issue to support[at]stimulsoft.com for analysis.

Thank you.
sector7g
Posts: 26
Joined: Tue Apr 29, 2008 9:32 am
Location: Germany

Display limited amount of data per page???

Post by sector7g »

Of course it works only with V2.

I testet with V1:

MessageBox.Show(PageNumber.ToString());

in the BeforePrint Event. It works.

Not in V2?

My report ist a little bit complex. So I try to make an easier one.

Thanks Ralf
Post Reply