Call SSRS package from Stored Procedure or From SSIS?

  • Hello,

    Can anyone help me in calling SSRS package from Stored Procedure or From SSIS? We need to execute the SSRS in loop. how this can be achieved?

    Thanks in Advance

    Vijayraj

  • Hi! Did you ever find out how to do this?

  • I have not tried this, but have considered it for an upcoming project. Can you create a one-time subscription, which would then create a SQL job.. Then execute that job from your proc/SSIS?

  • I can provide you some tried & tested snippet to call a SSIS Package from SP. You may have to enable the command shell scripting as shown in the snippet since in SQl2008 it is disabled by default.

    filePath & filename are user variables in the SSIS package, on which the package is dependendant on.

    You could try calling a SSRS on similar lines if you haven't yet got what you were looking for.

    Cheers !

    declare @cmd varchar(1250)

    declare @ssispath varchar(1250)

    declare @filePath varchar(1250)

    declare @fileName varchar(1250)

    set @ssispath = 'C:\SAPImport\AutomatedZ23Processing.dtsx'

    set @filePath = 'C:\ExportFileFolder\\'

    set @fileName = 'test.Xlsx'

    select @cmd = 'dtexec /F "' + @ssispath + '"'

    select @cmd = @cmd + ' /SET \Package.Variables[User::filePath].Properties[Value];"' + @filePath + '"'

    select @cmd = @cmd + ' /SET \Package.Variables[User::fileName].Properties[Value];"' + @fileName + '"'

    EXEC sp_configure 'xp_cmdshell', '1' --- Enable Command Shell

    RECONFIGURE

    exec master..xp_cmdshell @cmd

    EXEC sp_configure 'xp_cmdshell', '0' --- Disable Command Shell

    RECONFIGURE

  • What l have been able to do do is create a script task using VB.Net that calls an SSRS report passes in the user name, password, parameter then save it as a specified password. However this is done using SSIS 2005 calling SSRS 2008. The previous code l had worked for SSRS 2005 🙁

    Is this what you where looking to do?

  • I did something similar to this by setting up a subscription to the SSRS report that occurred once (in the past so it wouldn't actually run) then created a SQL Agent job which has a step in it that executes sp_start_job 'name of SSRS report'. It works well and can be integrated in an SSIS package as well.

  • To call SSRS reports from SSIS package, refer one of my blog post.

    [/url]

    Let me know if you face any issues while developing.

    Thanks

    Sunil Reddy

    sunilreddy
    http://msbimentalist.wordpress.com 🙂

  • hi

    the process u have provide is working on visual studio 2008.if i want to call in visual studio 2005. there is no option to add web reference.then how we will add web reference.

  • Please go through the below link, you could get something.

    http://msdn.microsoft.com/en-us/library/bb408520(v=exchg.140).aspx

    Regards

    Sunil Reddy Enugala

    sunilreddy
    http://msbimentalist.wordpress.com 🙂

Viewing 9 posts - 1 through 8 (of 8 total)

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