Hi
I'm doing a mailmerge with tables (fixed cell height and width). The problem occurs when the data(text) is too long to fit in a cell. In this case I should decrement font size until all text fits in.
And I'm doing this in XML first, than I load it in RV and print it with TRVReportHelper.
Any idea how to do this?
First I need to detect that the text is too long. But this can be done only after TRVReportHelper.FormatNextPage or ... I fact I don't know how to do it there either so ... help me out.
Thanks
Fit content in table cells (MailMerge)
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
There is no good solution for this problem, because a text size is known only after formatting.
All that I can suggest is loading cell in a separate RVReportHelper, format it, calculate a document width (I can give a code), change font size, calculate a document width again, and so on. Then modify a font size in the main editor.
All that I can suggest is loading cell in a separate RVReportHelper, format it, calculate a document width (I can give a code), change font size, calculate a document width again, and so on. Then modify a font size in the main editor.
Yes, something like that was on my mind also.
Can you give me a sample code (how to calculate width and height of formatted text)?
Or is this done like this:
- load cell data in separate RVReportHelper
- call Init -> set width to cell width (- padding)
- call FormatNextPage
- with GetLastPageHeight I get the formatted text height
Thanks
Can you give me a sample code (how to calculate width and height of formatted text)?
Or is this done like this:
- load cell data in separate RVReportHelper
- call Init -> set width to cell width (- padding)
- call FormatNextPage
- with GetLastPageHeight I get the formatted text height
Thanks
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: