locked
displaying datasource name within a report RRS feed

  • Question

  • I have a request to have my SSRS 05 reports display the datasource name in the report so users can see.
    Is there a way to accomplish this?

    Friday, April 24, 2009 2:59 PM

Answers

  • Look in the DataSources global collection.  You can reference the data source path via the expression =DataSources!dsName.DataSourceReference, where dsName is the name of the data source in the report.  For example:
    "=DataSources!dataSource1.DataSourceReference".

    See this article:
    http://msdn.microsoft.com/en-us/library/ms157274(SQL.90).aspx

    Specifically, this section:
    DataSources

    The DataSources collection represents the data sources referenced in a published report definition. You may get different values for these properties in preview mode than when you deploy and view a published report.

    The following table describes the variables within the DataSources collection.

    Variable Type Description

    DataSourceReference

    String

    The full path of the data source on the report server. For example, /DataSources/AdventureWorks.

    Type

    String

     

    - John Gallardo SQL Reporting Services Dev Team
    http://blogs.msdn.com/jgalla
    This information is provided 'AS IS' with no warranties, and confers no rights
    • Proposed as answer by Raymond-Lee Tuesday, April 28, 2009 2:40 AM
    • Marked as answer by Raymond-Lee Monday, May 4, 2009 3:14 AM
    Monday, April 27, 2009 3:13 PM

All replies

  • I don't think there is a global field that you can use for that.  I generally put the stored procedure name in the lower left corner of the report so I can track back to the data from a report if needed.  If you did this with the datasource you would just need to type it in for each report, or create a template for each datasource that was pre-populated.
    Derek Wilson | Blue-Granite.com
    Friday, April 24, 2009 6:43 PM
  • I dod't know wheter this help you or not. In general when i want to display the datasource name on the report. While designing the report i will create one datasourcename parameter and it will bind to the some textbox control. While generetaing the report we will pass the datasource name parameter value dynamically. Even i did't find any globalfield for datasourcename.

    hope this help you.


    Saturday, April 25, 2009 6:40 AM
  • Hi,

     

    How about write hardcode data source name in report. Set each data source name for each report. And if you are using dynamic data source by parameter, you can directly use parameter value in report to display datasource name.

     

    Hope this helps.

    Raymond

    Monday, April 27, 2009 7:49 AM
  • Look in the DataSources global collection.  You can reference the data source path via the expression =DataSources!dsName.DataSourceReference, where dsName is the name of the data source in the report.  For example:
    "=DataSources!dataSource1.DataSourceReference".

    See this article:
    http://msdn.microsoft.com/en-us/library/ms157274(SQL.90).aspx

    Specifically, this section:
    DataSources

    The DataSources collection represents the data sources referenced in a published report definition. You may get different values for these properties in preview mode than when you deploy and view a published report.

    The following table describes the variables within the DataSources collection.

    Variable Type Description

    DataSourceReference

    String

    The full path of the data source on the report server. For example, /DataSources/AdventureWorks.

    Type

    String

     

    - John Gallardo SQL Reporting Services Dev Team
    http://blogs.msdn.com/jgalla
    This information is provided 'AS IS' with no warranties, and confers no rights
    • Proposed as answer by Raymond-Lee Tuesday, April 28, 2009 2:40 AM
    • Marked as answer by Raymond-Lee Monday, May 4, 2009 3:14 AM
    Monday, April 27, 2009 3:13 PM