User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 456,552 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,459 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 2364 | Replies: 0
Reply
Join Date: Oct 2007
Posts: 1
Reputation: priyaram_c is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
priyaram_c priyaram_c is offline Offline
Newbie Poster

Crystal report setconnection and parameter problem

  #1  
Oct 18th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb VB.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 5:16 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC