ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Setting arbitrary column widths in a CDML table
Posted by Daniel on Feb-07-2018 18:58
Attachments:
Hi all,

Just started to use the CDML table via the addtable API call. Works greats (see attachment one). Very easy to use. Functionality is great and more than enough for the need we have.

Column widths are auto-calculated based the defined style. Smart and working great!

However using the column size I can find no documented way to set the column width to an arbitrary LARGER value than the one defined except via margins or padding blanks.

Some code à la VB such as:

oHeader = oTable.getRowStyle(0)
oHeader.setBackground(0x00CCCCCC,0x00555555,oManager.glassEffect(1,,0))

oHeader.Setwidth(MyDefinedWidth)

Setwidth would not operate. Which means that we may not set arbitrary dimensions for the table when building dynamic content.

We are building grid charts with multiple CD entries. The table content will be dynamic and thus with arbitrary sized strings and would like to make sure the size is exactly the same on each subplot.

The best solution we found was "blank padding" one of the string to grow the column until size is appropriate. Am I missing something simple ?

Daniel
default_view.PNG
arbitrary_column_size.PNG

  Re: Setting arbitrary column widths in a CDML table
Posted by Daniel on Feb-07-2018 19:52
Hi all, forget my post!

The solution is easy. Just making sure that the string on display within the cells of the table is defined as a CDML-tagged block such as:

<*block,width=100*,halign=center*>Category<*/*>

That will force the column size to adjust. Thanks for this wonderful API!

Daniel

  Re: Setting arbitrary column widths in a CDML table
Posted by Peter Kwan on Feb-07-2018 20:22
Hi Daniel,

You can also set the width using the column style:

oColStyle = oTable.getRowStyle(0)
oColStyle.setWidth(100)

In a table, the row can only be used to set the height of the row, while the col is for the width of the column.

Hope this can help.

Regards
Peter Kwan

  Re: Setting arbitrary column widths in a CDML table
Posted by Daniel on Feb-08-2018 01:26
Hi Peter,

I indeed used:
oColStyle = oTable.getColStyle(0)
oColStyle.SetWidth(100)

It did the trick in the "orthogonal" way it should. I could should certainly possibly have figured it by myself! But the your support is so kind and helpful.

Thanks a lot. The answer was to the point and fast as always on ASE forums.

This table functionality is definitely great. I like the sheer simplicity. SetCell is definitely great as well as the handling of "styles".

Having the possibility to define CDML tables in a recursive way would be even slightly better. But the current API already fits the bill in a very effective manner:-)

Kind regards,
Daniel