Dynamic data source columns

My report is bound to a datasource which has a table. This table has CarExpense details as below,

  1. ID
  2. Name
  3. TotalAmount
  4. Expense_Fuel
  5. Expense_Mainteneance

Here 4, 5 are dynamically added in case if data exist. So those columns may or may not exist. How can I add these into report?

Currently I have hardcoded it as below, hence in case 6, 7 columns are added to datasource, those are not displayed in report.

str$(DataSourceTable.ID) + “¶” +
DataSourceTable.Name + “¶” +
str$(DataSourceTable.TotalAmount,0,2) + " EUR" + “¶”

Thanks in advance,
Ramees

Dear Ramees,
thank you for your note.

In the designer it would be best to solve it on formula and conditions for the column, e.g.
Define some variables which defines the column witdh based on a condition then you can place the variables in a formula.

If you want a solution within your code we recommended to use the DOM API, in this case I would ask you to take a look at our DOM samples in the .NET Samples directory.

Kind regards

Erdal Alacali
Technical support
combit GmbH