468,251 Members | 1,391 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,251 developers. It's quick & easy.

Crystal Reports via WebService Dynamic datasource

Ron
I have a bunch of Crystal Reports (v9) published as WebServices and use a
ReportViewer to display the reports on the ASPNET page. Everytime we move
the reports from dev to production we have to open the reports and manually
change the datasouce to the production database. Is there a way to set the
datasouce on the webserviced reports dynamically?

(A datasource property or something?) cant seem to find anything.

Thanks!
Nov 18 '05 #1
5 2716
Hi Ron,

From your description, you're using some crystal reports on asp.net pages
and these reports use asp.net webservive to provide the datasource.
However, since the webservice's deployment server will change , you're
wondering how to speicfy the webservice's target url dynamically ,yes?

As for the webservices, how are you consuming them, are you use the add
webreference in vs.net (or use the wsdl.exe) to create the client proxy
class? If so, you can have a look at the proxy class 's "Url" property
which is used to speicfy the webservice's target url such as
"http://servername/virutual dir/service.asmx"
We can change it at runtime programly.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #2
Ron
Sry, I had a bad explanation of the probelm.

I do have the dynamic url assigned to the proxy on the webserver, but what
I'm tring to do is have the webservice "report" that is called looking at a
dynamic datasource (pulled from the web.config)

Our situation is that when we are deploying from the staging server to the
production. When we're testing, the report is pointing to the developement
database. When the deployment to production is made I have to open up
Crystal Reports (v9) and adjust the datasource through going to
MainMenu ->Database->SetDatasourceLocation. After the reports DataSources
are updated then the reports are "Published as Web Services" and the project
re-compiled and deployed. This method leaves a gap for human error;
forgetting to update the Datasource to the production database. It seems
that a dynamic datasource for a CrystalReport WebService would be there; I
just can't find any info on it.

Thanks!

Ron

"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:cZ**************@cpmsftngxa06.phx.gbl...
Hi Ron,

From your description, you're using some crystal reports on asp.net pages
and these reports use asp.net webservive to provide the datasource.
However, since the webservice's deployment server will change , you're
wondering how to speicfy the webservice's target url dynamically ,yes?

As for the webservices, how are you consuming them, are you use the add
webreference in vs.net (or use the wsdl.exe) to create the client proxy
class? If so, you can have a look at the proxy class 's "Url" property
which is used to speicfy the webservice's target url such as
"http://servername/virutual dir/service.asmx"
We can change it at runtime programly.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #3
Hi Ron,

Thanks for your response and the further detailed explanation. As for
dynamically retrieving datasource information from web.config file, I think
you can try using the <appSettings> element in the web.config to store
simple custom configuration datas. For example, we store the following
items in web.config file

<configuration>
<appSettings>
<add key="key1" value="value1">
<add key="key2" value="value2">
</appSettings>
<add key="key1" value="value1">
<system.web>

....

</system.web>
</configuration>
Then, we can get the items' value via the following code:

string item1 =
System.Configuration.ConfigurationSettings.AppSett ings["name"];
VB.NET
dim item as string =
System.Configuration.ConfigurationSettings.AppSett ings("name")

And there is tech article in MSDN which has explained detailed on using the
configuration files:

#Application Configuration Files Explained
http://msdn.microsoft.com/library/en...22003.asp?fram
e=true

Hope helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #4
Ron
Yes, I understand how to get the values out of the config file but where on
the CrystalReport WebService can I assign the dynamic datasource? Is there
a property to override? Something like a ConnectinoString property or
something

Thanks for your help

Ron

"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:rx**************@cpmsftngxa06.phx.gbl...
Hi Ron,

Thanks for your response and the further detailed explanation. As for
dynamically retrieving datasource information from web.config file, I think you can try using the <appSettings> element in the web.config to store
simple custom configuration datas. For example, we store the following
items in web.config file

<configuration>
<appSettings>
<add key="key1" value="value1">
<add key="key2" value="value2">
</appSettings>
<add key="key1" value="value1">
<system.web>

...

</system.web>
</configuration>
Then, we can get the items' value via the following code:

string item1 =
System.Configuration.ConfigurationSettings.AppSett ings["name"];
VB.NET
dim item as string =
System.Configuration.ConfigurationSettings.AppSett ings("name")

And there is tech article in MSDN which has explained detailed on using the configuration files:

#Application Configuration Files Explained
http://msdn.microsoft.com/library/en...22003.asp?fram e=true

Hope helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #5
Hi Ron,

Thanks for your followup. From your further description, it seems that
you're looking for some proerpty on the Crystal report which can
dynaimically change the datasource. Since the problem may need some
further researchs on the Crystal Report components, I suggest that you try
asking the Crystal Guys to see whether it is possible to support provide
such as dynamic datasource. Here are two kb articles maybe helpful for you
to contact the crystal supports:
#How To Get Help with Crystal Reports - International and U.S.
http://support.microsoft.com/default...b;en-us;100368

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Stephan | last post: by
3 posts views Thread by FeveZ | last post: by
3 posts views Thread by David P. Donahue | last post: by
1 post views Thread by =?Utf-8?B?VGVycnk=?= | last post: by
2 posts views Thread by =?Utf-8?B?Um9zcyBNYXNvbg==?= | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.