944,149 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 5660
  • VB.NET RSS
Oct 18th, 2007
0

Crystal report setconnection and parameter problem

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
priyaram_c is offline Offline
1 posts
since Oct 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in VB.NET Forum Timeline: problem with vb.net 2003
Next Thread in VB.NET Forum Timeline: Checkbox on database





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC