PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

RowVisibility on demand
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1652
Page 1 of 1

Author:  ReinerWolff [ Wed May 11, 2011 4:03 pm ]
Post subject:  RowVisibility on demand

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 4723 times ]

Author:  Thomas Hoevel [ Thu May 12, 2011 7:02 am ]
Post subject:  Re: RowVisibility on demand

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

Author:  ReinerWolff [ Thu May 12, 2011 7:32 am ]
Post subject:  Re: RowVisibility on demand

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 4716 times ]

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/