Add a Postgres SQL connection at runtime

Stimulsoft Dashboards.JS discussion
Post Reply
zemorango
Posts: 2
Joined: Tue Nov 19, 2019 12:20 pm

Add a Postgres SQL connection at runtime

Post by zemorango »

Hi,
My company is evaluating the stimulsoft products, so far we are very impressed by this great product. :D

But I'm trying to change the database connection string at run time using Javascript
I'm using this code

Code: Select all

            report.dictionary.databases.clear();
	    report.dictionary.databases.add(new Stimulsoft.Report.Dictionary.StiPostgreSQLSource("NAME","NAME","NAME","CONECTIONSTRING"));
  


The database connection is created but the connection string is not passed to the connection.


reportserr1.jpg
reportserr1.jpg (90.7 KiB) Viewed 2321 times



I also try with a SQl server connection and get the same problem.

Code: Select all

        report.dictionary.databases.add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("MyDatabase", "Myconnectionstring"));

We really need this feature to work well in order to adquire a license of stimulsoft.


Best Regards

Jose Morango
zemorango
Posts: 2
Joined: Tue Nov 19, 2019 12:20 pm

Re: Add a Postgres SQL connection at runtime

Post by zemorango »

Hi,

I figured it out , it's working now

I was using the wrong Method,
I replace the :

Code: Select all

StiPostgreSQLDataSource
with

Code: Select all

StiPostgreSQLDatabase
It's all working just fine now. :D :lol:
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Add a Postgres SQL connection at runtime

Post by Lech Kulikowski »

Hello

Please let us know if you need any additional help.

Thank you.
Post Reply