Table layout (RDMLX)
Posted: Fri May 11, 2012 1:10 am
I have a table that will scroll right if the columns cannot all be displayed on the screen. The problem is that the column headings do not scroll right also. I am using col_width(Fit) for all my columns and Layout_Width('Fill, 700') for my table. The column headings will scroll right if I make my columns have specific widths, or even if I limit my "Fit" to a single column. Any ideas for setting this up? Here is the code for the Set_Table and the Set_Label for the columns in the row:
#COM_OWNER.Set_Table Name(Products) Layout_Height(Fill) Border_Thickness(1) Border_Color('#dddddd') Layout_Col(1) Layout_Row(1) Border_Cornerradius(15)
#com_owner.set_Table Name(Products) Col_N(1) Col_Name(ORDER) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(2) Col_Name(ODATE) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(3) Col_Name(CUSTOMER) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(4) Col_Name(QTY) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(5) Col_Name(PRICE) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(6) Col_Name(EXTENSION) Col_Width(Fit)
* Set up Column Headers
#com_owner.set_Label Name('Products.Col#1.HEADER') Text('Order #') Textalign(right)
#COM_OWNER.Set_Label Name('Products.Col#2.HEADER') Text('Date') Textalign(right)
#COM_OWNER.Set_Label Name('Products.Col#3.HEADER') Text('Customer')
#COM_OWNER.Set_Label Name('Products.Col#4.HEADER') Text('Qty') Textalign(right)
#COM_OWNER.Set_Label Name('Products.Col#5.HEADER') Text('Price') Textalign(right)
#COM_OWNER.Set_Label Name('Products.Col#6.HEADER') Text('Extension') Textalign(Right)
* Basic Table set up
#uEntry := 0
Select Fields(#prodsales) From_File(oetoil92) With_Key(#ITEM)
Fetch Fields(#prodsales) From_File(oetohp) With_Key(#COID)
#uEntry += 1
*
#TableRow := 'Products.Row%' + #uEntry.AsString
#COM_OWNER.Set_Label Name(#TableRow + '.ORDER') Text(#COID.AsString) Textalign(right)
#COM_OWNER.Set_Label Name(#TableRow + '.ODATE') Text(#OHRFDT.AsDate( CCYYMMDD ).AsDisplayString( MMsDDsYY )) Textalign(right)
#COM_OWNER.Set_Label Name(#TableRow + '.CUSTOMER') Text(#CUSID)
#COM_OWNER.Set_Label Name(#TableRow + '.QTY') Text(#OIQTNY.AsString) Textalign(right)
#COM_OWNER.Set_Label Name(#TableRow + '.PRICE') Text(#OIPRC.AsString) Textalign(right)
#COM_OWNER.Set_Label Name(#TableRow + '.EXTENSION') Text(#VOIEXNTS.AsString) Textalign(right)
Endselect
#COM_OWNER.Set_Table Name(Products) Layout_Height(Fill) Border_Thickness(1) Border_Color('#dddddd') Layout_Col(1) Layout_Row(1) Border_Cornerradius(15)
#com_owner.set_Table Name(Products) Col_N(1) Col_Name(ORDER) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(2) Col_Name(ODATE) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(3) Col_Name(CUSTOMER) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(4) Col_Name(QTY) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(5) Col_Name(PRICE) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(6) Col_Name(EXTENSION) Col_Width(Fit)
* Set up Column Headers
#com_owner.set_Label Name('Products.Col#1.HEADER') Text('Order #') Textalign(right)
#COM_OWNER.Set_Label Name('Products.Col#2.HEADER') Text('Date') Textalign(right)
#COM_OWNER.Set_Label Name('Products.Col#3.HEADER') Text('Customer')
#COM_OWNER.Set_Label Name('Products.Col#4.HEADER') Text('Qty') Textalign(right)
#COM_OWNER.Set_Label Name('Products.Col#5.HEADER') Text('Price') Textalign(right)
#COM_OWNER.Set_Label Name('Products.Col#6.HEADER') Text('Extension') Textalign(Right)
* Basic Table set up
#uEntry := 0
Select Fields(#prodsales) From_File(oetoil92) With_Key(#ITEM)
Fetch Fields(#prodsales) From_File(oetohp) With_Key(#COID)
#uEntry += 1
*
#TableRow := 'Products.Row%' + #uEntry.AsString
#COM_OWNER.Set_Label Name(#TableRow + '.ORDER') Text(#COID.AsString) Textalign(right)
#COM_OWNER.Set_Label Name(#TableRow + '.ODATE') Text(#OHRFDT.AsDate( CCYYMMDD ).AsDisplayString( MMsDDsYY )) Textalign(right)
#COM_OWNER.Set_Label Name(#TableRow + '.CUSTOMER') Text(#CUSID)
#COM_OWNER.Set_Label Name(#TableRow + '.QTY') Text(#OIQTNY.AsString) Textalign(right)
#COM_OWNER.Set_Label Name(#TableRow + '.PRICE') Text(#OIPRC.AsString) Textalign(right)
#COM_OWNER.Set_Label Name(#TableRow + '.EXTENSION') Text(#VOIEXNTS.AsString) Textalign(right)
Endselect