Hello. I have implemented your example of converting all tables in a richviewedit to text in BCB2007. I have replaced your ; column delimiter with a tab using rv->AddTab instead of rv->AddNLATag in the example. It works great except that the columns do not align once converted to text. The table will look similar to
HISTOLOGIC TYPE: Superficial spreading
SURGICAL MARGIN STATUS: Positive, peripheal
TNM CODE: pT1a pNX
while the text conversion will look similar to
HISTOLOGIC TYPE: Superficial spreading
SURGICAL MARGIN STATUS: Positive, peripheal
TNM CODE: pT1a pNX
Is there some way to align the columns of the text conversion using tabs when the text contents of the table cells vary in length as they do in this table?
Thanks.
Table to Text Column Alignment
-
- Site Admin
- Posts: 17565
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17565
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Thanks. I ended up using rv->GetItemText(rv->ItemCount-1) to get the contents of the cell and getting the contents.Length() to determine how many tabs to add. This method works only for fixed fonts like courier new, however. Contents.Length() just returns the number of characters in the cell and does not account for them being different widths, as is the case for proportional fonts. Are there functions other than Length() that would work better with proportional fonts? Failing that, how would I set only the table style to a fixed font. Currently, I am using
for (i = 0; i<rv->Style->TextStyles->Count; i++)
rv->Style->TextStyles->Items->FontName = "Courier New";
but it sets the entire richedit and not just the tables inside.
Thanks.
for (i = 0; i<rv->Style->TextStyles->Count; i++)
rv->Style->TextStyles->Items->FontName = "Courier New";
but it sets the entire richedit and not just the tables inside.
Thanks.
-
- Site Admin
- Posts: 17565
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
The text is inserted into the tables from a word processor as a proportional font. It looks
good on printouts but I am needing to convert it to a pdf using a Rave report and the table is not rendering properly (it only showsWidth1Width0Width0, etc). It is not really a RichView problem at all but a Rave issue. While I have had some success with the fixed font replacement, it is really not the solution I need and am now looking at a different approach to creating a pdf using print drivers (currently pdfcreator). Thanks for all of your help and for a great product.
good on printouts but I am needing to convert it to a pdf using a Rave report and the table is not rendering properly (it only showsWidth1Width0Width0, etc). It is not really a RichView problem at all but a Rave issue. While I have had some success with the fixed font replacement, it is really not the solution I need and am now looking at a different approach to creating a pdf using print drivers (currently pdfcreator). Thanks for all of your help and for a great product.