Crystal Reports via WebService Dynamic datasource

Discussion in 'ASP .Net' started by Ron, Oct 10, 2004.

  1. Ron

    Ron Guest

    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!
     
    Ron, Oct 10, 2004
    #1
    1. Advertising

  2. 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.)
     
    Steven Cheng[MSFT], Oct 11, 2004
    #2
    1. Advertising

  3. Ron

    Ron Guest

    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]" <> wrote in message
    news:...
    > 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.)
    >
     
    Ron, Oct 11, 2004
    #3
  4. 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.)
     
    Steven Cheng[MSFT], Oct 12, 2004
    #4
  5. Ron

    Ron Guest

    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]" <> wrote in message
    news:...
    > 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.)
    >
    >
    >
     
    Ron, Oct 12, 2004
    #5
  6. 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.)
     
    Steven Cheng[MSFT], Oct 13, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Versteijn
    Replies:
    1
    Views:
    5,092
  2. Peri
    Replies:
    1
    Views:
    3,095
    =?Utf-8?B?Um90aGFyaWdlcg==?=
    Jul 21, 2005
  3. Replies:
    2
    Views:
    952
  4. Rod
    Replies:
    2
    Views:
    1,853
  5. Replies:
    0
    Views:
    557
Loading...

Share This Page