Page 1 of 1

Add a Postgres SQL connection at runtime

Posted: Tue Nov 19, 2019 12:39 pm
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 3774 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

Re: Add a Postgres SQL connection at runtime

Posted: Tue Nov 19, 2019 1:45 pm
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:

Re: Add a Postgres SQL connection at runtime

Posted: Tue Nov 19, 2019 10:50 pm
by Lech Kulikowski
Hello

Please let us know if you need any additional help.

Thank you.