PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Jul 01, 2024 10:17 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: RowVisibility on demand
PostPosted: Wed May 11, 2011 4:03 pm 
Offline

Joined: Wed Apr 13, 2011 6:39 pm
Posts: 21
Hi,

with help from Thomas I created now with MigraDoc and PDFSharp the image below.

The first line shows how this table should react if a long text has to placed into the last column.
To get this behaviour I added an additional row and a 'MergeDown = 1' for the last cell.

The second line shows the same behaviour although the text fits into one line.
I would like to have this additional line in these cases complety invisible.

I tried somthing like that:
Code:
FüllZeile = tbl.AddRow
FüllZeile.Height = 0
FüllZeile.HeightRule = RowHeightRule.Exactly

The result looks quite good, but in all cells whithout 'MergeDown=1' set I get a double-border.
I tried a lot of combinations to get rid of the thick line, without success.
The best result yet worked with 'FüllZeile.Height = -1' but then the tables outer border has an edge.

So here my question:
Is there a simple way to expand the last cell on demand without getting the borders double?
How do borders-settings on one object change the border-settings on another?
Code:
    FüllZeile.Borders.Top.SetNull()
    FüllZeile.Borders.Bottom.SetNull()

These two lines inserted bring some left or right borders of that line into visible range.

Thank you for helping me.


Attachments:
RowVisibility.jpg
RowVisibility.jpg [ 57.47 KiB | Viewed 4728 times ]
Top
 Profile  
Reply with quote  
PostPosted: Thu May 12, 2011 7:02 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
Hi!

I'm afraid I don't understand what you want to change about your table.

For the border between two cells, both borders of both cells will be drawn (bottom border of upper cell and top border of lower cell, same for left and right respectively).
Padding applies to empty cells (empty rows), too.

It seems the big cell at the end is centered and not top-aligned.

A MigraDoc DDL file of your table might help us to improve your table.
http://www.pdfsharp.net/wiki/MigraDocDDL.ashx

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu May 12, 2011 7:32 am 
Offline

Joined: Wed Apr 13, 2011 6:39 pm
Posts: 21
Hi,

there is an empty row below 'Outside canopy' which isn't needed if the text in the last cell fits into one line.

But I found a solution on my own.
For the empty rows I set the height to negativ value:
Code:
FüllZeile = tbl.AddRow
FüllZeile.Height = (- FüllZeile.Borders.Width.Point)
FüllZeile.HeightRule = RowHeightRule.Exactly


The result is shown below.
In this case the borders of the upper row and of the empty row are drawn at the same position, I think.

However, thanks for trying to help.


Attachments:
RowVisibility2.jpg
RowVisibility2.jpg [ 51.67 KiB | Viewed 4721 times ]
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 60 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group