Page 1 of 1

rvitem to be exported as image

Posted: Thu Dec 01, 2016 4:49 pm
by cychia_n2n
Is there any way i can save the rvitem like TableItem into a image file?

Posted: Thu Dec 01, 2016 5:08 pm
by Sergey Tkachenko
You can make an image from a document, not from an item.
Copy this item to a new document, load it in TRVReportHelper, save as an image (Demos\DelphiUnicode\Assorted\Graphics\ToImage\)

Posted: Fri Dec 02, 2016 9:34 am
by cychia_n2n
I am going to have a feature to allow user to create table styles, after setting up the table styles, i am thinking to generate a thumbnail of the table style and it will be shown in the list box when choosing styles to apply to table.

I am using the ToImage demo as example, but I am struggling to work out a fixed table size with 5x5 col rows. I want my thumbnail to be around the size of 50x60.

Any guidance?

Thanks.

Posted: Fri Dec 02, 2016 2:23 pm
by Sergey Tkachenko
You can assign BestWidth and BestHeight properties of cells.
Note that the total cell width = (CellBorderWidth + CellHPadding)* 2 + Cell.BestWidth.
TotalTableWidth = (BorderWidth + BorderHSpacing) * 2 + TotalCellWidth * ColCount + CellHSpacing * (ColCount - 1).
You can use this equation to calculate the proper BestWidth for the given TotalTableWidth.
Height is calculated similarly.

PS: for the width, you can also simply assign Table.BestWidth; but for the height, this calculation is necessary.

PPS: Include rvtoIgnoreContentWidth and rvtoIgnoreContentHeight in table.Options

Update: of course, ColCount must be used for horizontal size, not RowCount.