Hi,
Currently, im changing my report designer from crystal report to StimulReport, and
Im using VB.net 2007 as my development tool.
But here is the problem,
I would like to change the:
1) SQL Database connection info (e.g: Server Name, DB Name, Login Name, Password ... etc)
2) SQL Table Location
3) Record Selection Formula (previously im using Crystal Rpt which provide this )
in programatically for each table instead of using the default connection ( The SQL database connection when designing report).
Can someone pls help me?? im a newbie in stireport. thanks!
Programatically change SQL database connection
-
- Posts: 10
- Joined: Sat Jul 21, 2007 6:18 am
- Location: Malaysia,KL
Programatically change SQL database connection
You can use following code, for example:
Instead Crystal Formula you can use a "variables":
Thank you.
Code: Select all
Dim database As StiSqlDatabase = TryCast(report.Dictionary.Databases.Item("Connection"), StiSqlDatabase)
If (Not database Is Nothing) Then
database.ConnectionString = "Password=;Data Source=SQLEXPRESS;Integrated Security=True;Initial Catalog=Northwind;User ID="
End If
Code: Select all
report.Dictionary.Variables.Add("MyVariable", GetType(Integer))
report.Dictionary.Variables("MyVariable").Value = "1000"
-
- Posts: 10
- Joined: Sat Jul 21, 2007 6:18 am
- Location: Malaysia,KL
Programatically change SQL database connection
Thanks for advice, its helps a lot. :biggrin: