Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: How to keep fields on report when changing SP? Post Reply Post New Topic
<< Prev Page  of 3 Next >>
Author Message
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Jan 2009 at 11:00am
Kind of. And I could be wrong on this as I do not know exactly how it is doing what it is but...
You are not technically adding your SP#2, you are replacing your SP#1 with it. However, the names of your tables or vierws or SP in your report design won't change so it can get confusing.
To test the process make a copy of your report.
Go to Database menu and select Set Data Source location.
Highlight the SP name in the "Current Data Source" window.
It will look something like this
-Report
   +Properties
    +SPnamehere (select/highlight this)
Go under your Current connections or History or wherever your getting your new SP from in the "Replace with" window.
Select / highlight the new Store Procedure name there.
The Update button will become available.
Click on it.
Now look back into your Current Data Source and Expand the "SPname here" field and expand the properties.
You will see that the new table name = your SP#2 and the data is actually pointing back to it.
In your report it will always look like it is pointing to SP#1 but it is not.
Does this make sense?
IP IP Logged
hdjim69
Newbie
Newbie


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 24
Quote hdjim69 Replybullet Posted: 15 Jan 2009 at 11:34am
>>How about calling the stored proc from within a command?
I'm not sure how to do this.  Can you explain?  Thanks

hd
IP IP Logged
hdjim69
Newbie
Newbie


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 24
Quote hdjim69 Replybullet Posted: 19 Jan 2009 at 4:44am
>> DBlank
yes, that makes sense.  I will try it out today and let you know how it works.  thanks.
 
hd
IP IP Logged
ahaiken
Newbie
Newbie


Joined: 10 Mar 2009
Online Status: Offline
Posts: 8
Quote ahaiken Replybullet Posted: 11 Mar 2009 at 8:14am
Hi DBlank,

Is there a way to change the datasource from the dev to prod box when using a SQL command as the data, rather than selecting tables?  I would have to use the 'Add Command' under ODBC(RDO) host choice.  When I copy and past the SQL, it eliminates all of the report fields that I used from the original SQL. 

Thanks,
Amy
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Mar 2009 at 8:29am
Hi Amy,
Sorry but I am not sure about that one as I have never tried it.
IP IP Logged
ahaiken
Newbie
Newbie


Joined: 10 Mar 2009
Online Status: Offline
Posts: 8
Quote ahaiken Replybullet Posted: 11 Mar 2009 at 11:04am
I'm afraid that I'll have to redo a bit of the report formatting after changing the database with the same SQL command.  I googled it, and didn't seem to come up with a solution.  I'm surprised that CR didn't come up with a way to do that.  Most people using the SQL command would like to change just the database that it's pointing to when moving it from dev to prod.

Thanks for answering me so fast.

Amy
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Mar 2009 at 11:14am

I may be off base here but if you have an existing Command under a ODBC connection try this:

Select Set Data source Location.
In the Current Data source click on the highest level (dsn)
In the Replace with, find your new source (production box) dsn or create the connection to it
Highlight it by clciking on it
The UPDATE button should become active
Click on update and it should replace your source.
This is assuming that your SQL is just calling table names that are the same in the 2 differnt data locations.
IS this what you are trying to do?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Mar 2009 at 11:17am
Might want to make a copy of your report first
just in case Wink


Edited by DBlank - 11 Mar 2009 at 11:17am
IP IP Logged
ahaiken
Newbie
Newbie


Joined: 10 Mar 2009
Online Status: Offline
Posts: 8
Quote ahaiken Replybullet Posted: 11 Mar 2009 at 11:24am
Yes, that's what I did with my copy and it deletes all of the references from the dev. box.  Oh well, I guess that CR 9 didn't think that people would want it to work the way that I want it to.

Thanks!
Amy
IP IP Logged
Gremlin1708
Newbie
Newbie
Avatar

Joined: 22 Jun 2009
Location: South Africa
Online Status: Offline
Posts: 8
Quote Gremlin1708 Replybullet Posted: 22 Jun 2009 at 2:23am
Hi There...
I came across this post for the same reason you posted it :-) Well after a long struggle i think i mite have the answer for us. If you have a "Dev" server and a "Active" server and you want to post your reports to the Server that's got the live data then to change the ODBC you :
1. right click on the Table Name / Sp in the Field Explorer
2. Select Set Datasource Location from the Pop up Menu.
3. Expand from Report >> ODBC Conn >> Properties 
4. There you will see DSN
   4.1. Right Click and select "Edit"
   4.2. Rename the DSN and then select the ODBC that your active server is on.
 
This is what i did and it worked 100% it kept my Fields on the correct place and it showed me the "live" data.
 
Hope this is of help for you.
IP IP Logged
<< Prev Page  of 3 Next >>
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.047 seconds.