Invisible Cell Borders
Posted: Wed Oct 17, 2007 11:12 pm
Hello,
I am attempting to create a series of tables in a document. I want the border of the table to be visible but the borders of the individual cells to be invisible. I have tried several methods to hide the cell borders as documented in the code below. Please let me know what I'm missing.
Also, I need to output the document to RTF and have the tables be invisible there as well.
Thank you,
Karl
Code Snippet:
void __fastcall TForm1::Button2Click(TObject *Sender)
{
TRVTableItemInfo* rvTable = new TRVTableItemInfo(13,2, RichViewEdit1->RVData);
rvTable->BorderStyle = rvtbRaised;
rvTable->BorderWidth = 2;
rvTable->BorderVSpacing = 1;
rvTable->BorderHSpacing = 1;
// Attempt to get rid of the cell borders by setting width to 0
// rvTable->CellBorderWidth = 0;
// Attempt to hide cell borders by setting color to white.
// rvTable->CellBorderColor = clWhite;
for (int iRow = 0; iRow < rvTable->Rows->Count; iRow++)
for (int iCol = 0; iCol < rvTable->Rows->Items[iRow]->Count; iCol++)
{
TRVTableCellData* rvtCell = rvTable->Cells[iRow][iCol];
rvtCell->BestWidth = 100;
if (iRow == 0)
rvtCell->BestHeight = 20;
else
rvtCell->BestHeight = 10;
// Another attempt to hide the cell borders.
rvtCell->VisibleBorders->Left = false;
rvtCell->VisibleBorders->Right = false;
rvtCell->VisibleBorders->Top = false;
rvtCell->VisibleBorders->Bottom = false;
// One more attempt to hide the cell borders.
// rvtCell->BorderColor = clWhite;
}
// Put heading in row 0, col 0.
rvTable->Cells[0][0]->AddNL("Wafer/Summary Information", 1, -1);
// Now merge row 0 col 1 and 2.
rvTable->MergeCells(0,0,2,1,true);
// Lot ID row
rvTable->Cells[1][0]->AddNL("Lot ID:", 0, -1);
rvTable->Cells[1][1]->AddNL("Lot 1", 0, -1);
RichViewEdit1->InsertItem("", rvTable);
}
I am attempting to create a series of tables in a document. I want the border of the table to be visible but the borders of the individual cells to be invisible. I have tried several methods to hide the cell borders as documented in the code below. Please let me know what I'm missing.
Also, I need to output the document to RTF and have the tables be invisible there as well.
Thank you,
Karl
Code Snippet:
void __fastcall TForm1::Button2Click(TObject *Sender)
{
TRVTableItemInfo* rvTable = new TRVTableItemInfo(13,2, RichViewEdit1->RVData);
rvTable->BorderStyle = rvtbRaised;
rvTable->BorderWidth = 2;
rvTable->BorderVSpacing = 1;
rvTable->BorderHSpacing = 1;
// Attempt to get rid of the cell borders by setting width to 0
// rvTable->CellBorderWidth = 0;
// Attempt to hide cell borders by setting color to white.
// rvTable->CellBorderColor = clWhite;
for (int iRow = 0; iRow < rvTable->Rows->Count; iRow++)
for (int iCol = 0; iCol < rvTable->Rows->Items[iRow]->Count; iCol++)
{
TRVTableCellData* rvtCell = rvTable->Cells[iRow][iCol];
rvtCell->BestWidth = 100;
if (iRow == 0)
rvtCell->BestHeight = 20;
else
rvtCell->BestHeight = 10;
// Another attempt to hide the cell borders.
rvtCell->VisibleBorders->Left = false;
rvtCell->VisibleBorders->Right = false;
rvtCell->VisibleBorders->Top = false;
rvtCell->VisibleBorders->Bottom = false;
// One more attempt to hide the cell borders.
// rvtCell->BorderColor = clWhite;
}
// Put heading in row 0, col 0.
rvTable->Cells[0][0]->AddNL("Wafer/Summary Information", 1, -1);
// Now merge row 0 col 1 and 2.
rvTable->MergeCells(0,0,2,1,true);
// Lot ID row
rvTable->Cells[1][0]->AddNL("Lot ID:", 0, -1);
rvTable->Cells[1][1]->AddNL("Lot 1", 0, -1);
RichViewEdit1->InsertItem("", rvTable);
}