Crystal Reports via WebService Dynamic datasource

R

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!
 
S

Steven Cheng[MSFT]

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.)
 
R

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
 
S

Steven Cheng[MSFT]

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.AppSettings["name"];
VB.NET
dim item as string =
System.Configuration.ConfigurationSettings.AppSettings("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-us/dnadvnet/html/vbnet04222003.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.)
 
R

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
 
S

Steven Cheng[MSFT]

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.aspx?scid=kb;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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top