Page 1 of 1
Tables in CBuilder
Posted: Tue Oct 16, 2007 9:36 pm
by KaptainKarl
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
Additional Information
Posted: Wed Oct 17, 2007 11:51 am
by KaptainKarl
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
More Info
Posted: Wed Oct 17, 2007 11:55 am
by KaptainKarl
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
Posted: Wed Oct 17, 2007 4:17 pm
by Sergey Tkachenko
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.
Posted: Wed Oct 17, 2007 7:14 pm
by KaptainKarl
I figured I was doing something stupid.
Thank you very much.
Karl