How to add columns by code like the button Retrieve columns

Stimulsoft Reports.JS discussion
Post Reply
sdrouet
Posts: 14
Joined: Wed May 24, 2017 8:32 am

How to add columns by code like the button Retrieve columns

Post 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 2171 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

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

Post by Alex K. »

Hello,

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

Thank you.
sdrouet
Posts: 14
Joined: Wed May 24, 2017 8:32 am

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

Post by sdrouet »

Hello,

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

Regards
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

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

Post by Alex K. »

Hello

Please let us know if you need any additional help.

Thank you.
Post Reply