Page 1 of 2
Connectionstring
Posted: Thu Mar 19, 2009 5:41 pm
by nabilfaouzi
hi, i want to ask how to give a dynamic connectionString to stimulsoftwebDesigner like the one gaves in VB.NET "|DataDirectory|/db.mdf" which enable to us place anywhere our project without change the connectionString thanks for all.(Excuse me for my bad language cause i'm not english)
Connectionstring
Posted: Fri Mar 20, 2009 12:49 am
by Jan
Hello,
You can use following code:
Code: Select all
report.Databases.Clear();
report.Databases.Add(new Stimulsoft.Report.Dictionary.StiOleDbDatabase("NameInReport", ConnectionString);
Thank you.
Connectionstring
Posted: Fri Mar 20, 2009 7:18 pm
by nabilfaouzi
My ConnectionString in Report Designer is AttachDbFilename=H:\Projet\notes\App_Data\gestion_notes.mdf. if i move my database to another directory (E : for exemple) the connection of report is failed cause it can't find database. i want to give a default directory like asp.net the string of sqlconnection is |data directory|/db.mdf. thanks for your reply.
Connectionstring
Posted: Mon Mar 23, 2009 2:08 pm
by Jan
Hello,
You can use following code:
Code: Select all
string connectionString= string.Format("AttachDbFilename={0}\gestion_notes.mdf", Stimulsoft.Report.StiConfig.ApplicationDirectory);
report.Databases.Clear();
report.Databases.Add(new Stimulsoft.Report.Dictionary.StiOleDbDatabase("NameInReport", ConnectionString);
Thank you.
Connectionstring
Posted: Mon Mar 23, 2009 7:13 pm
by nabilfaouzi
thanks again for your reply, i want more details about the last message. i copy the code in report, i copy it into vb.net but it doesn't work. i don't know how it work.
Connectionstring
Posted: Tue Mar 24, 2009 12:34 am
by Jan
Hello,
You have compilation errors?
Thank you.
Connectionstring
Posted: Wed Mar 25, 2009 4:12 pm
by nabilfaouzi
thanks mrs jan i've resolved the probleme thank you for your help and for your service
Connectionstring
Posted: Thu Mar 26, 2009 1:15 pm
by Jan
Hello,
Let me know if you need any help.
Thank you.
Connectionstring
Posted: Sun May 03, 2009 10:23 pm
by anonay
Can you please explain in greater details about the "NameInReport".
We are currently using CR 8.5 Developer version for all our ASP.Net reporting and we are not happy with the licensing issue and frequent rebooting of the server to release the license should it hit the max - which is 5. Our database is MSSQL 2005 and uses SQLConnection for all reporting purposes. Don't mind using ODBC if it is appropriate. Anyway, we found your product easy to use and develop reports, however, 2 areas we seem to be lost at the moment.
1. Our applications allow user to choose the database they which to logon to. So, the database name changes, depending on the one the user chooses. So, the connection string for the Stimulus report.web must change accordingly. So, how can this be done? We supposed this is similar to the question posted earlier.
We have a lot of sub-reports. Do we need to connect the sub-report data sources as the way CR require us to though the main report is already connected?
2. How to programmatically pass values to filters and parameters?
We are seriously contemplating to change our report writer to others as long as we can have the answers for the above clearly stated how we can overcome it without must changes to our current web forms.
Regards,
KW
Connectionstring
Posted: Tue May 05, 2009 11:54 pm
by Jan
Hello,
Can you please explain in greater details about the "NameInReport".
It s name which you give to our connection in report.
1. Our applications allow user to choose the database they which to logon to. So, the database name changes, depending on the one the user chooses. So, the connection string for the Stimulus report.web must change accordingly. So, how can this be done? We supposed this is similar to the question posted earlier.
Yes you need similar code:
Code: Select all
report.Databases.Clear();
report.Databases.Add(new Stimulsoft.Report.Dictionary.StiOleDbDatabase("NameInReport", ConnectionString);
You can use name of connection in report and any connection string.
We have a lot of sub-reports. Do we need to connect the sub-report data sources as the way CR require us to though the main report is already connected?
You don't need do something with sub-reports.
2. How to programmatically pass values to filters and parameters?
Declare in report dictionary variable. After then in filter please use expression something like this:
customers.name == variable
After then you can use following code for variable initialization in report:
Thank you.