Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: setting data source location at runtime Post Reply Post New Topic
Author Message
ishan
Newbie
Newbie
Avatar

Joined: 16 Dec 2008
Location: Nepal
Online Status: Offline
Posts: 19
Quote ishan Replybullet Topic: setting data source location at runtime
    Posted: 30 Nov 2009 at 9:50pm
I m using vb6 as frontend, crystal report 9.0 as reporting tool, oracle 8i as backend and odbc as connection interface

Let's say my application is being used in two companies. And for each company i used separate odbc, user and password.(user as schema in oracle). But I have same code and reports for both companies.
I just use setting file to switch between company database which consist of dsn name, user name and password.
The problem is when I develop a report I need to create two separate reports and set the data source location manually in crystal report 9 IDE and place them in separate folders companywise.

How can I use the same report for two different schema when all database structure is same, without having to change the datasource location manually everytime I develop a new one.
How can i do it at run time.

I hope I get an answer this time.

Thankx in advance


Ishwor
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 01 Dec 2009 at 6:16am
I don't know about vb6 and CR 9, but I would look into pushing the data to the report and making it independent the obdc driver.  In .Net and CR XI, I use ADO.Net to pass the data to the report from my application.  I am guessing that this is not a 'new' technology for CR XI.  It would be simplest if the report runs from a stored proc, then have you app call the stored proc and pass the results to CR.
 
HTH
IP IP Logged
ishan
Newbie
Newbie
Avatar

Joined: 16 Dec 2008
Location: Nepal
Online Status: Offline
Posts: 19
Quote ishan Replybullet Posted: 01 Dec 2009 at 8:17pm
No I just pass selection criteria to the report. How are Reports are designed independently of odbc driver and how can data be pushed to the report. When u design the report u need to define the connection, don't u? I think so. So when u design the report using a specific connection, it becomes rigid to that particular connection information. So when connection information is changed in the application, it doesn't work.
Ishwor
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 02 Dec 2009 at 6:06am
that's why you use something like ado.net which is a disconnected recordset.  Another way to do this is to set the dataconnection as OLE and then set the connection at runtime, we've done this as well, but the disconnected recordset is way easier. I would try searching the internet for crystal reports and push method. I know it can be done in XI disconnected recordset, I not sure about CR9.
 
HTH
IP IP Logged
ishan
Newbie
Newbie
Avatar

Joined: 16 Dec 2008
Location: Nepal
Online Status: Offline
Posts: 19
Quote ishan Replybullet Posted: 02 Dec 2009 at 8:24pm
Does that mean there is no solution for my problem?
It's so frustrating, I don't get any solution for my problem.
Anyway thanx. At least u took some time for me.

I hope if you can ask others in this forum to help me out.

Thanx a lot.
Ishwor
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 03 Dec 2009 at 6:09am

No, I gave a solution, use an ole driver and set the connection via your app. 

You could also have your app get the dataset or datatable and pass the datatable to the report.  You don't need to have the report get the data, but if that is the method that you want to use, then you can use the ole driver. 
 
Or you can progammatically change the values in the ODBC driver.  This last one, I haven't done personally, but I have seen it done, I don't like it, but it works.
 
CR doesn't care 'where' the data comes from, just that 'looks' like what it expects it to (data schema).
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.