Dynamic connection with database

Stimulsoft Reports.PHP discussion
Post Reply
thiagorente
Posts: 8
Joined: Thu Feb 24, 2011 2:46 pm
Location: Santos

Dynamic connection with database

Post by thiagorente »

Hello,

I wanna know if I can use a parameter in the connection with the database, because my system create other databases and I have to change this in connection.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Dynamic connection with database

Post by Vladimir »

Hello,

Please tell us what parameters do you want to change? The Request User Name and Password option exists to manage the username and password. Also you can completely change the connection string in a 'sti_get_connection_string' function, which is placed in the 'index.php' script file.

Thank you.
thiagorente
Posts: 8
Joined: Thu Feb 24, 2011 2:46 pm
Location: Santos

Dynamic connection with database

Post by thiagorente »

Hi Vladimir,

I'm not using this connection, I'm setting a connection in the API, the Designer.html. I don't know how to enter on a report with index.php.

I wanna change the database where my reports will access. There's no way in the API to put a variable in the connection, just like parameters in querys?
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Dynamic connection with database

Post by Vladimir »

Hello,

Unfortunately, at this moment you cannot use parameters and variables in the connection string.

Thank you.
Demo_S
Posts: 6
Joined: Tue Jul 17, 2012 2:47 pm

Re: Dynamic connection with database

Post by Demo_S »

please can you specify, how do you set connection in api? i do need exactly this to implement
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Dynamic connection with database

Post by HighAley »

Hello.
Demo_S wrote:please can you specify, how do you set connection in api? i do need exactly this to implement
You could completely change the connection string in a 'sti_get_connection_string' function, which is placed in the 'index.php' script file.

Thank you.
Demo_S
Posts: 6
Joined: Tue Jul 17, 2012 2:47 pm

Re: Dynamic connection with database

Post by Demo_S »

but if i have no connections at all, then sti_get_connection_string will not be called.
i do need to add some values to dictionary.connections beforehand
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Dynamic connection with database

Post by HighAley »

Hello.
Demo_S wrote:but if i have no connections at all, then sti_get_connection_string will not be called.
i do need to add some values to dictionary.connections beforehand
Unfortunately, it's impossible now.
This task is in our to-do list. We are planning to add this feature in our next release in September.

Thank you.
Post Reply