Page 1 of 1

Datagridview and Report designer

Posted: Thu Jun 04, 2009 8:55 am
by Stephan1
Hi there,

i have a question using Datagridview.

Let me say we have differents set of Datagridviews in our Form with different Columns

Firstname, Surename, Birthday, ColumnX

I want to give these rows and columns direct to the report designer.

Each Datagridview looks different, so i can't set a fix Column1, Column2 etc. in my Report design. This have to be done by code. Any hints ?

Is there a way to archieve this ?.

The need is our Application has different Views of Data where the number of Columns differ and we want our customers to be able to print the
Datagridview they see at the application direct as a kind of report.


Ok I found a sample called "PrintGrid" or "PrintTable". Problem is, the Size of the columns are calculated off total size of page / Numberofcolumns".

What if my Datagrid has 20 Columns then each column is only 1 cm width. Is there a way to get those columns on another page ?

like


Column1, Column2, Column3, Column4, -------- Page 1 Other Columns dont fit horizontally on first page so put them on the 2nd... etc.

Column5, Column6, Column7, Column8, ---- Page 2 ?

a kind like Execel does it ?


Thx

Stephan

Datagridview and Report designer

Posted: Fri Jun 05, 2009 8:03 pm
by Edward
Hi Stephan,

Yes, there is a possibility to do that.

Please set SegmentPerWidth property of the Page in 2. This allows you to 'extend' page to the left in the same manner as Excel does.

Thank you.

Datagridview and Report designer

Posted: Mon Jun 08, 2009 2:59 am
by Stephan1
Edward wrote:Hi Stephan,

Yes, there is a possibility to do that.

Please set SegmentPerWidth property of the Page in 2. This allows you to 'extend' page to the left in the same manner as Excel does.

Thank you.
Thx Edward,

another question is there also a property to check if a column fits on the page ?.

Now with setting SegmentPerWidth property a Column can be show a part on page 1 and the rest of column on page 2. is there something to set that if the column dont fit on
the page that it moves on to the next ?.

Also do i have to calculate myself how many Segements i have for setting the property "SegmentPerWidth" right?. Setting it to "2" means there are 2 pages. So i guess i have to calculate it.

thx stephan

Datagridview and Report designer

Posted: Mon Jun 08, 2009 5:39 pm
by Edward
Hi Stephan,

Yes, you absolutely write. You have to calculate free space according with the size of the page, orientation yourselves. Also number of necessary segments must be calculated 'by hand'. Sorry, there is no other way.

Thank you.