Page 1 of 2

Display limited amount of data per page???

Posted: Mon Oct 20, 2008 4:19 am
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

Display limited amount of data per page???

Posted: Mon Oct 20, 2008 4:45 am
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.

Display limited amount of data per page???

Posted: Mon Oct 20, 2008 4:56 am
by abhi0410
I am using Stimulsoft Reports.Net 2007.2 for .Net 2.0.

How to do in that?????

Thanks

Display limited amount of data per page???

Posted: Wed Oct 22, 2008 5:06 am
by abhi0410
i am getting error becoz of the word "engine"...
How to solve this???/

plz reply soon.

Display limited amount of data per page???

Posted: Wed Oct 22, 2008 5:25 am
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.

Display limited amount of data per page???

Posted: Wed Oct 22, 2008 5:29 am
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....

Display limited amount of data per page???

Posted: Wed Oct 22, 2008 5:38 am
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.

Display limited amount of data per page???

Posted: Tue Nov 04, 2008 12:37 pm
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

Display limited amount of data per page???

Posted: Tue Nov 04, 2008 7:37 pm
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.

Display limited amount of data per page???

Posted: Tue Nov 04, 2008 11:47 pm
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