can i reference the shared data source in my Code in SSRS?

  • Hi Experts,

    I need to write a function in Code part of SSRS i'll be using later that requires connecting to the back end.

    i dont want to hard-code the connection string because i'll have to change it each time the report is being deployed into QA server and into a Production Server.

    I would rather read it from my shared data source of my Report Project, if i can do it.

    then, i'll be a very easy maint. each time report gets deployed, right?

    thank you.

  • In the script transformation editor dialog, there is a connection managers section that you will have to add your connection manager to.

    You must use a .Net connection manager, not an OLEDB connection manager.

    In your script, you will need to override the AcquireConnections procedure with something like:

    Public Overrides Sub AcquireConnections(ByVal Transaction As Object)

    connMgr = Me.Connections.Connection

    sqlConn = CType(connMgr.AcquireConnection(Nothing), SqlConnection)

    End Sub

    Don't forget to override ReleaseConnections as well.

  • Oh, i am not working with SSIS, i am working with SSRS that has several reports that shares one data source (=shared). it's a sql server type connection that shared across all reports (rdl files) and their datasets. how can i do the same thing, please? can i?

    thanks for writing me.

  • It would be helpful to get an idea of what you're attempting to do, but a suggestion:

    Create your shared data source and the dataset you're looking for. Create a table attached to your data set, then you can call your function form the table cells (passing the appropriate values). I think you should be able to hide the control, and still have it run / process.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply