The Table component is very powerful and easy to configure. It is very flexible, allowing you to easily display your tabular data in a variety of ways. Important features include:
Basic Usage The basic usage of the Table is to use a SQL Query binding on its Data property to let the table display data from a database. Often this query will by dynamic or indirect. See the Property Binding section for more information. Binding to Selected Data It is common to want to bind other components to values in the selected row of the table. In order to do this safely, you need to write an expression binding that protects against the case when nothing is selected or there are no rows. An expression like this would bind a label to the selected row's value for a column named "ProductCode":
If you're binding to an integer, date, or other non-String type value thats inside a dateset, you'll need to cast the value to the correct type to make the expression parser happy. This binding would cast the selected "Quantity" column to an integer:
Changing the Column Widths To change a table's column's widths, simply switch into preview mode and use your mouse to resize the columns, and then switch back to design mode. To ensure that the changes to the column widths appear in the client, right-click on the table to open the table customizer and click OK without clicking anywhere else in the customizer. Clicking anywhere else in the customizer before clicking OK will reset the table column widths. Editable Table By setting any column to editable in the Table's customizer, the user will be able to double-click in the cell and edit the data. You can the respond to the resulting cellEdited event with an event handler and persist the data. See the Script Builders in Vision section for more information. Exporting to HTML You can export the table to an HTML file that retain's the table's formatting. To do this, use a script like this: (more about the table's export HTML function is here.)
Exporting to CSV You can export the table's raw data to a CSV file. To do this, use a script like this: (more about the fpmi.db.exportCSV function is here.)
Printing Printing a table is a snap! Simply use the table's built in print function like this: table = event.source.parent.getComponent("Table") # Get a reference to the table table.print()
|
|
|
The Table component has a Table customizer to manage column configurations and configure background color mapping. It allows you to customize how you want the table to look to users. |
|