Results 1 to 1 of 1

Thread: Dynamically Set Data Source Location

Threaded View

  1. #1

    Thread Starter
    Fanatic Member snufse's Avatar
    Join Date
    Jul 2004
    Location
    Jupiter, FL
    Posts
    912

    Question Dynamically Set Data Source Location

    I have an ASP application where user selects a site code from a drop down list. Each site code points to a different server. Now when I run my Crystal Report using the report viewer I would like to set the server name dynamically:

    Example:

    Site code RGWP equals
    Remote Server \\10.xxx.0.254:211
    Database: C:\Program Files\Astec Industries\WM2000\Data\WM2000DATA.add (data source location)

    Site code RGDF equals
    Remote Server \\10.yyy.0.254:211
    Database: C:\Program Files\Astec Industries\WM2000\Data\WM2000DATA.add (data source location)


    This is the code I have:

    Code:
    myCrystalReport1.SetDataSource("C:\Program Files\Astec Industries\WM2000\Data\WM2000DATA.add")
    myCrystalReport1.SetParameterValue("BatchGuid", BatchGuid)
    myCrystalReport1.SetDatabaseLogon(System.Configuration.ConfigurationManager.AppSettings("CrystalReport_UserId"), System.Configuration.ConfigurationManager.AppSettings("CrystalReport_Password"))
    CrystalReportViewer1.ReportSource = myCrystalReport1
    CrystalReportViewer1.Zoom(90)

    I don't know how and where to set the server name.
    Last edited by snufse; Apr 23rd, 2009 at 07:34 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width