Hello,
This is newbie question.
How do I instantiate a table in CBuilder?
The Help file refers to a function called CreateEx which does not seem to exist. I attempted a "new" of a table object and got an exception.
Sorry for such a simple question, but I cannot seem to find the answer on my own.
Karl
Tables in CBuilder
-
- Posts: 5
- Joined: Tue Oct 16, 2007 9:22 pm
Additional Information
I have scoured the help and tried many different things. I'm sure I am missing something very easy. Here is the code I have tried:
These will not compile:
TRVTableItemInfo rvTable;
TRVTableItemInfo *rvTable = new TRVTableItemInfo();
These throw an exception:
TRVTableItemInfo *rvTable = new TRVTableItemInfo(0);
TRVTableItemInfo *rvTable = new TRVTableItemInfo(this);
TRVTableItemInfo *rvTable = new TRVTableItemInfo(rvDoc);
This (as expected) also throws and exception:
TRVTableItemInfo *rvTable;
rvDoc->AddItem("Lot Table", rvTable);
I listed all the methods associated with TRVTableItemInfo by entering TRVTableItemInfo:: and clicking Cntrl-Space. The methods "Create" and "CreateEx" do NOT show in the list of methods.
Using formated text in addNL lines is not an option for me since I need three columns of information and the tabs are not consistent between RTF output and PDF output. I also would like to put some borders around some of the fields.
If there is a simple CBuilder example of how to instantiate a table, please let me know.
Thanks,
Karl
These will not compile:
TRVTableItemInfo rvTable;
TRVTableItemInfo *rvTable = new TRVTableItemInfo();
These throw an exception:
TRVTableItemInfo *rvTable = new TRVTableItemInfo(0);
TRVTableItemInfo *rvTable = new TRVTableItemInfo(this);
TRVTableItemInfo *rvTable = new TRVTableItemInfo(rvDoc);
This (as expected) also throws and exception:
TRVTableItemInfo *rvTable;
rvDoc->AddItem("Lot Table", rvTable);
I listed all the methods associated with TRVTableItemInfo by entering TRVTableItemInfo:: and clicking Cntrl-Space. The methods "Create" and "CreateEx" do NOT show in the list of methods.
Using formated text in addNL lines is not an option for me since I need three columns of information and the tabs are not consistent between RTF output and PDF output. I also would like to put some borders around some of the fields.
If there is a simple CBuilder example of how to instantiate a table, please let me know.
Thanks,
Karl
-
- Posts: 5
- Joined: Tue Oct 16, 2007 9:22 pm
More Info
I left this attempt out of my previous post:
TRVTableItemInfo *rvTable;
rvTable = TRVTableItemInfo::CreateEx(2, 3, rvDoc->RVData);
This will not compile with the error "Undefined symbol 'CreateEx'".
Karl
TRVTableItemInfo *rvTable;
rvTable = TRVTableItemInfo::CreateEx(2, 3, rvDoc->RVData);
This will not compile with the error "Undefined symbol 'CreateEx'".
Karl
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Delphi constructors are converted to C++ constructors with the same parameters (but without name, because C++ constructors do not have names).
So the code is:
rvTable = new TRVTableItemInfo(2, 3, rvDoc->RVData);
For example of creating tables, see Demos\CBuilder\Editors\Editor 1\, commands in "Table" menu.
So the code is:
rvTable = new TRVTableItemInfo(2, 3, rvDoc->RVData);
For example of creating tables, see Demos\CBuilder\Editors\Editor 1\, commands in "Table" menu.
-
- Posts: 5
- Joined: Tue Oct 16, 2007 9:22 pm