Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Report mapping to specific DB based on Parameter Post Reply Post New Topic
Author Message
cwar
Newbie
Newbie


Joined: 28 Mar 2012
Online Status: Offline
Posts: 2
Quote cwar Replybullet Topic: Report mapping to specific DB based on Parameter
    Posted: 28 Mar 2012 at 8:01am
Hi all,

New to the forum and crystal reports as well, so this question shouldn't be too hard to answer but I've searched and browsed the forum for a bit and haven't found an answer.

I am using an application that defines an ODBC datasource which should be the database that the queries and stored procedures are run against.

I have had issues previously when using Database Expert (or at least I assume it was when I used database expert). It seems that sometimes when I used this feature, the queries would be run instead of "rep_StoredProcedure" it is run as "DB"."rep_StoredProcedure" and thus when I attempt to run the report against DB1 DB2 DB3 etc it would generate the SP query as "DB"."rep_StoredProcedure" and only hit this one DB. To get around this I re-created the report one step at a time, testing each time to see if the query had changed from "rep_StoredProcedure" to "DB"."rep_StoredProcedure". Inconvenient and time consuming, but it was the best I could come up with at the time.

Now I am having a problem with one of these reports that is actually generating the query fine most of the time, except when one specific report setting is set. Then it generates the query mapped to the specific DB.

TL;DR - Need my report to use ODBC connection defined in the application, when one report setting is set from the application it is mapped to a specific DB.

Can anyone point me in the right direction here? It's very confusing to me how these DB mappings are created, especially for just one case.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 05 Apr 2012 at 5:37am
what I have seen is changing the database that the ODBC connection is pointing to, otherwise you need to change things in the report that cannot be done dynamically.
 
As an alternative, I have used an OLE connection which changed more easily, but the best option, if you can manage it is:
  have an application that gathers the data (it is probably much easier to gather this information correctly) and then 'push' the data to the report. Report doesn't know or care where the data came from.
 
HTH
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.