Page 1 of 1

How to add columns by code like the button Retrieve columns

Posted: Wed May 24, 2017 3:18 pm
by sdrouet
Hello,

I would like to add columns from query automatically like the button "retrieve columns" in edit data source.
button "retrieve columns"
button "retrieve columns"
Edit Data Source.jpg (67.04 KiB) Viewed 2174 times
I can add named column one by one, but that not a solution.

Here a sample of my code

Code: Select all

...
var ds1 = new Stimulsoft.Report.Dictionary.StiSqlSource("Connection", "DS1", "AliasDS1", "SELECT * FROM v_courrier_standard", true, false, 600);
//test add column by column
ds1.columns.add(new Stimulsoft.Report.Dictionary.StiDataColumn("agent_adresse1", "agent_adresse1", "agent_adresse1"));
//
report.dictionary.dataSources.add(ds1);
Thank you for your help,
Best regards.

Re: How to add columns by code like the button Retrieve colu

Posted: Sat May 27, 2017 8:22 am
by Alex K.
Hello,

Unfortunately, there is no others way.
You can use your code.

Thank you.

Re: How to add columns by code like the button Retrieve colu

Posted: Mon May 29, 2017 8:22 am
by sdrouet
Hello,

I thought it was possible.
Thank you for you're answer.

Regards

Re: How to add columns by code like the button Retrieve colu

Posted: Mon May 29, 2017 9:03 am
by Alex K.
Hello

Please let us know if you need any additional help.

Thank you.