| | |
Crystal report setconnection and parameter problem
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2007
Posts: 1
Reputation:
Solved Threads: 0
Hi All,
I am trying to open a crystal report which is using OLEDB (ADO) connection and stored procedures to retrieve data.
I am trying to change the database connection information dynamically from the vb.net code. The method I have used is:
1. create a new crystal report(crystalreport1.rpt) in vb.net project and load the crystal report which is already developed.
2. place a crystal viewer in form1 and choose the rystalreport1.rpt as the source
3. Now if from anywhere I try to change the cnnection info using setconnection as below
the report whilerunning does not ask for parameter and throws error
Me.DataSourceConnections.Item(0).SetConnection("aceR", "SAP_SP_DB", False)
If I am trying to pass the parameter through the code , the report does not take the parameter value. The code which I use for passing parameter is correct since when this code is executed without the connection info code( commenting that part of code) is working fine.
I have also tried he belowcode but no success.
Me.CrystalReport11.DataSourceConnections.Item(0).IntegratedSecurity = False
Me.CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.IntegratedSecurity = False
Me.CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.AllowCustomConnection = True
Me.CrystalReport11.DataSourceConnections.Item(0).ServerName.Replace("192.168.10.157","Acer")
Any Idea why this happens. I just need to give the databse server connection information dynamically.
Regards,
Priya
I am trying to open a crystal report which is using OLEDB (ADO) connection and stored procedures to retrieve data.
I am trying to change the database connection information dynamically from the vb.net code. The method I have used is:
1. create a new crystal report(crystalreport1.rpt) in vb.net project and load the crystal report which is already developed.
2. place a crystal viewer in form1 and choose the rystalreport1.rpt as the source
3. Now if from anywhere I try to change the cnnection info using setconnection as below
the report whilerunning does not ask for parameter and throws error
Me.DataSourceConnections.Item(0).SetConnection("aceR", "SAP_SP_DB", False)
If I am trying to pass the parameter through the code , the report does not take the parameter value. The code which I use for passing parameter is correct since when this code is executed without the connection info code( commenting that part of code) is working fine.
I have also tried he belowcode but no success.
Me.CrystalReport11.DataSourceConnections.Item(0).IntegratedSecurity = False
Me.CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.IntegratedSecurity = False
Me.CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.AllowCustomConnection = True
Me.CrystalReport11.DataSourceConnections.Item(0).ServerName.Replace("192.168.10.157","Acer")
Any Idea why this happens. I just need to give the databse server connection information dynamically.
Regards,
Priya
![]() |
Similar Threads
- problem in exporting crystal report (ASP.NET)
- Crystal Report & Code based Dataset (VB.NET)
- Issue about passing parameter to Crystal Report 11.. (Visual Basic 4 / 5 / 6)
- Problem with Crystal Report in ASP.NET (ASP.NET)
- problem connection vb6 & crystal report 11 (Visual Basic 4 / 5 / 6)
- How to pass parameter in Crystal report 9 (ASP.NET)
- ASP.NET Crystal Report ODBC MySQL (ASP.NET)
- Crystal Report Problem (ASP.NET)
Other Threads in the VB.NET Forum
- Previous Thread: problem with vb.net 2003
- Next Thread: Checkbox on database
| Thread Tools | Search this Thread |
"crystal .net .net2008 2008 access add advanced application array assignment basic beginner box browser button buttons center click code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationtopic dosconsolevb.net eclipse editvb.net employees excel exists firewall forms html images isnumericfuntioncall listview map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity open pan pdf picturebox picturebox2 port print printpreview record regex reuse right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure temp textbox timer timespan transparency txttoxmlconverter upload useraccounts usercontol vb vb.net vb.nettoolboxvisualbasic2008sidebar vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web wpf wrapingcode xml





