none
When programmatically using SOAP to deploy a RDL to the Report Server and adding a subscription...does size matter?

    Question

  • I am programmatically sending a report to the report server then programmatically setting up a subscription all using SOAP. Does the potential report size play a role in how long that process takes. Say If I have a Customer report that will be 1000 records and another report that has 10000 records.

    In the mechanics of SSRS 2008 will one take longer than the other?


    Paul Mauriello

    Saturday, May 04, 2013 8:04 PM

All replies

  • Hello,

    In your descritpion, "Does the potential report size play a role in how long that process takes", did you meant the deploy processing?
    When deploying a report to Report Server, we just deploy the defination of the report and shared data source to the Report Server. The report data which displayed when render the report are stored in database. As pre my understand, the report data size will not affect the deploy processing. However,Report server processing performance is affected by  the amount of data in a report.

    Reference: Performance (Reporting Services)

    Regards,
    Fanny Liu


    Fanny Liu
    TechNet Community Support



    Monday, May 06, 2013 3:13 AM
  • So in another words...

    if I scheduled a Customer Report with 100 records

    then I schedule the same report with 10000 records

    both should take the same time to actually schedule.

    Does the report itself make an initial run before its scheduled to run the "first" time? It seems through testing...sometimes it does and sometimes it doesn't.

    If indeed the report is being scheduled to run at 8:30am and i schedule it at 8:00am. Does the report also run at 8:00am when it is scheduled as kind of a initialization? When I am using SOAP to programmatically deploy and schedule it?


    Paul Mauriello


    • Edited by pictureman Wednesday, May 15, 2013 7:59 PM
    Friday, May 10, 2013 10:21 PM
  • Here is roughly my code to deploy the RDL to the report server.

    Is their anything I am doing that is extra or wrong that is causing the Report to run on the report server as im scheduling it. I dont want the report to run until the time of schedule.

    'Use SOAP API to deploy reports to server

                lblerr.Text = ""
                ShowError("Server Report Creation Complete")

                Dim rs As New ReportService2005.ReportingService2005
                Dim rsExe As New ReportExecution2005.ReportExecutionService
                rsExe.Timeout = -1
                rs.Timeout = -1
                Dim netCredential = New System.Net.NetworkCredential(System.Configuration.ConfigurationManager.AppSettings("RS_NetID").ToString, System.Configuration.ConfigurationManager.AppSettings("RS_NetPass").ToString, System.Configuration.ConfigurationManager.AppSettings("RS_NetDom").ToString)
                rs.Credentials = netCredential
                rsExe.Credentials = netCredential
                rs.PreAuthenticate = True
                rsExe.PreAuthenticate = True
                rs.Url = asReportServer & "/ReportService2005.asmx"
                rsExe.Url = asReportServer & "/ReportExecution2005.asmx"
                Dim reportName As String = "/" & lsReportFileName
                Dim reportDefinition As Byte()
                Dim result As Byte()
                Dim format As String = "MHTML"
                Dim historyID As String = Nothing
                Dim devInfo As String = "<DeviceInfo><Toolbar>True</Toolbar></DeviceInfo>"
                Dim credentials As ReportService2005.DataSourceCredentials() = Nothing
                Dim showHideToggle As String = Nothing
                Dim encoding As String = ""
                Dim mimeType As String = ""
                Dim parameters() As ReportService2005.ParameterValue = Nothing
                Dim warnings As ReportService2005.Warning() = Nothing
                Dim execwarnings As ReportExecution2005.Warning() = Nothing
                Dim reportHistoryParameters As ReportService2005.ParameterValue() = Nothing
                Dim streamIDs As String() = Nothing
                Dim pages As Byte()() = Nothing
                '   Dim pageIndex As Integer
                Dim sh As New ReportExecution2005.ExecutionHeader
                Dim execInfo As New ReportExecution2005.ExecutionInfo
                rsExe.ExecutionHeaderValue = sh

                Dim oSQL As clsSQL
                oSQL = HttpContext.Current.Session("oSqlOB")

                'Define the data source defintion
                'Create a copy of the datasource on the destination server
                'Get the report definition of a report from the created report file
                'Create a copy of the report on the destination server
                'Render the report

                Dim definition As New ReportService2005.DataSourceDefinition

       
                    definition.ConnectString = "Trusted_Connection=True;data source=" & oSQL.Server & ";initial catalog=" & oSQL.DB
                    definition.Enabled = True
                    definition.EnabledSpecified = True
                    definition.Extension = "SQL"
                    definition.ImpersonateUser = False
                    definition.ImpersonateUserSpecified = False
                    definition.CredentialRetrieval = ReportService2005.CredentialRetrievalEnum.Integrated
                    definition.Prompt = Nothing
                    definition.WindowsCredentials = True
      definition.WindowsCredentials = False


                    rs.CreateDataSource("sqlOmnibill", "/", True, definition, Nothing)

                    Dim stream As FileStream = File.OpenRead(Server.MapPath("") & "\ReportsTemp\" & lsReportFileName & lsReportFileExtension)
                    reportDefinition = New Byte(stream.Length - 1) {}
                    stream.Read(reportDefinition, 0, CInt(stream.Length))
                    stream.Close()

                    warnings = rs.CreateReport(lsReportFileName, "/", True, reportDefinition, Nothing)
                    If Not (warnings Is Nothing) Then
                        Dim warning As ReportService2005.Warning
                        For Each warning In warnings
                            lblerr.Text = warning.Message
                        Next warning
                    Else
                        ShowError("Report: {0} created successfully with no warnings")
                    End If

     

                                format = PDF
                                execInfo = rsExe.LoadReport(reportName, historyID)
                                result = rsExe.Render(format, devInfo, "", mimeType, encoding, execwarnings, streamIDs)
                                sh.ExecutionID = rsExe.ExecutionHeaderValue.ExecutionID
                                Call ShowError("SessionID after call to Render: " & rsExe.ExecutionHeaderValue.ExecutionID)
                                execInfo = rsExe.GetExecutionInfo
                                Call ShowError("Execution date and time: " & execInfo.ExecutionDateTime)

                                Dim gsReportNames = Session("gsReportNames")

                                'Store all the Server Mode report file names in an array
                                ReDim Preserve gsReportNames(gsReportNames.GetUpperBound(0) + 1)
                                gsReportNames(gsReportNames.GetUpperBound(0)) = lsReportFileName

                                Session("gsReportNames") = gsReportNames


                                Server.ScriptTimeout = 2147483647
                                Response.Clear()

                                        'Send Report to the scheduler
                                 AddSubscription()


                                rs.Dispose()
                                rsExe.Dispose()

     

    Public Sub AddSubscription()

            Dim extset As New ReportService2005.ExtensionSettings
            Dim strResult As String
            ' Dim recurpattern As New ReportService2005.MinuteRecurrence
            '  Dim iSchedCounter As Integer
            Dim ScheduleDef As New ReportService2005.ScheduleDefinition
            Dim sched As New ReportService2005.Schedule
            Dim subscr As New ReportService2005.Subscription
            Dim RptItem As New ReportService2005.CatalogItem
            Dim definition As New ReportService2005.DataSourceDefinition
            Dim reportName As String = "/" & Session("gsReportFileName")
            Dim SchedReportFilePath As String = "\\Dev01\h_misc\DIC"

            Dim DailyRecur As New ReportService2005.DailyRecurrence
            Dim WeeklyRecur As New ReportService2005.WeeklyRecurrence
            Dim MonthlyRecur As New ReportService2005.MonthlyRecurrence

            Dim Days As New ReportService2005.DaysOfWeekSelector
            Dim Months As New ReportService2005.MonthsOfYearSelector

            Try

                'get the scedule file store location
                sqlDS = GetDatasetNoSP(GetConnStr(), "select DIC_DIR from company where co_id = " & Session("MarketID"))
                If sqlDS.Tables(0).Rows.Count > 0 Then
                    SchedReportFilePath = sqlDS.Tables(0).Rows(0).Item("DIC_DIR").ToString
                End If

                'Use SOAP API to deploy reports to server
                Dim rs As New ReportService2005.ReportingService2005
                rs.Timeout = -1
                Dim netCredential = New System.Net.NetworkCredential(System.Configuration.ConfigurationManager.AppSettings("RS_NetID").ToString, System.Configuration.ConfigurationManager.AppSettings("RS_NetPass").ToString, System.Configuration.ConfigurationManager.AppSettings("RS_NetDom").ToString)
                rs.Credentials = netCredential
                rs.PreAuthenticate = True
                rs.Url = Session("gsReportServer") & "/ReportService2005.asmx"

                If txtStartDate.SelectedDate.ToString.Trim.Length = 0 Then
                    Call ShowError("You must enter a Start Time.")
                    Exit Sub
                End If

                If txtDescription.Text.Trim.Length = 0 Then
                    Call ShowError("You must enter a valid description.")
                    Exit Sub
                End If

                If txtStartDate.SelectedDate.ToString.Trim.Length = 0 Then
                    txtStartDate.SelectedDate = Date.Today.ToString
                End If

                If cboSchedules.SelectedIndex > 0 Then
                    If txtEndDate.SelectedDate.ToString.Trim.Length > 0 Then
                        ScheduleDef.EndDate = CDate(txtEndDate.SelectedDate)
                        ScheduleDef.EndDateSpecified = True
                    Else
                        txtEndDate.Clear()
                        ScheduleDef.EndDateSpecified = False
                    End If
                End If


                ScheduleDef.StartDateTime = CDate(ffGetDate(txtStartDate.SelectedDate.ToString) & " " & ffGetTime(txtStartTime.SelectedDate.ToString))


                Select Case cboSchedules.SelectedIndex
                    Case 0
                        'one time
                        'do nothing -  start time is also end time

                    Case 1
                        'daily
                        DailyRecur.DaysInterval = 1
                        ScheduleDef.Item = DailyRecur
                    Case 2
                        'weekly

                        If lbxSelector.Items(0).Selected Then
                            Days.Sunday = True
                        Else
                            Days.Sunday = False
                        End If

                        If lbxSelector.Items(1).Selected Then
                            Days.Monday = True
                        Else
                            Days.Monday = False
                        End If

                        If lbxSelector.Items(2).Selected Then
                            Days.Tuesday = True
                        Else
                            Days.Tuesday = False
                        End If

                        If lbxSelector.Items(3).Selected Then
                            Days.Wednesday = True
                        Else
                            Days.Wednesday = False
                        End If

                        If lbxSelector.Items(4).Selected Then
                            Days.Thursday = True
                        Else
                            Days.Thursday = False
                        End If

                        If lbxSelector.Items(5).Selected Then
                            Days.Friday = True
                        Else
                            Days.Friday = False
                        End If

                        If lbxSelector.Items(6).Selected Then
                            Days.Saturday = True
                        Else
                            Days.Saturday = False
                        End If

                        WeeklyRecur.DaysOfWeek = Days
                        WeeklyRecur.WeeksInterval = 1
                        WeeklyRecur.WeeksIntervalSpecified = True

                        ScheduleDef.Item = WeeklyRecur

                    Case 3
                        'monthly

                        If lbxSelector.Items(0).Selected Then
                            Months.January = True
                        Else
                            Months.January = False
                        End If

                        If lbxSelector.Items(1).Selected Then
                            Months.February = True
                        Else
                            Months.February = False
                        End If

                        If lbxSelector.Items(2).Selected Then
                            Months.March = True
                        Else
                            Months.March = False
                        End If

                        If lbxSelector.Items(3).Selected Then
                            Months.April = True
                        Else
                            Months.April = False
                        End If

                        If lbxSelector.Items(4).Selected Then
                            Months.May = True
                        Else
                            Months.May = False
                        End If

                        If lbxSelector.Items(5).Selected Then
                            Months.June = True
                        Else
                            Months.June = False
                        End If

                        If lbxSelector.Items(6).Selected Then
                            Months.July = True
                        Else
                            Months.July = False
                        End If

                        If lbxSelector.Items(7).Selected Then
                            Months.August = True
                        Else
                            Months.August = False
                        End If

                        If lbxSelector.Items(8).Selected Then
                            Months.September = True
                        Else
                            Months.September = False
                        End If

                        If lbxSelector.Items(9).Selected Then
                            Months.October = True
                        Else
                            Months.October = False
                        End If

                        If lbxSelector.Items(10).Selected Then
                            Months.November = True
                        Else
                            Months.November = False
                        End If

                        If lbxSelector.Items(11).Selected Then
                            Months.December = True
                        Else
                            Months.December = False
                        End If

                        MonthlyRecur.MonthsOfYear = Months
                        ScheduleDef.Item = MonthlyRecur

                End Select

                strResult = rs.CreateSchedule(txtDescription.Text.Trim, ScheduleDef)

     

                    extset.Extension = "Report Server Email"

                    '-- Create Parameter Values array
                    Dim ParamVals(5) As ReportService2005.ParameterValueOrFieldReference
                    extset.ParameterValues = ParamVals

                    '-- Populate the Extension Parameters
                    Dim pvTo As New ReportService2005.ParameterValue
                    pvTo.Name = "TO"
                    pvTo.Value = txtEmail.Text
                    extset.ParameterValues(0) = pvTo

                    Dim pvIncludeRpt As New ReportService2005.ParameterValue
                    pvIncludeRpt.Name = "IncludeReport"
                    pvIncludeRpt.Value = "True"
                    extset.ParameterValues(1) = pvIncludeRpt

                    For i As Integer = 1 To UBound(rbOutputArray, 1)
                        If rbOutputArray(i, 0) = "true" Then
                            Dim pvRenderFormat As New ReportService2005.ParameterValue
                            pvRenderFormat.Name = "RenderFormat"
                            pvRenderFormat.Value = rbOutputArray(i, 1)
                            extset.ParameterValues(2) = pvRenderFormat
                            Exit For
                        End If
                    Next i

                    Dim pvPriority As New ReportService2005.ParameterValue
                    pvPriority.Name = "Priority"
                    pvPriority.Value = "NORMAL"
                    extset.ParameterValues(3) = pvPriority

                    Dim pvSubject As New ReportService2005.ParameterValue
                    pvSubject.Name = "Subject"
                    pvSubject.Value = "@ReportName was executed at @ExecutionTime"
                    extset.ParameterValues(4) = pvSubject

     

                '-- Create the Subscription (no report parameters in last arg) sched.ScheduleID
                rs.CreateSubscription(reportName, extset, strResult & " | " & ScheduleDef.StartDateTime & " | " & ScheduleDef.EndDate & " | " & cboSchedules.SelectedItem.Text & " | " & txtDescription.Text.Trim, "TimedSubscription", strResult, Nothing)


            Catch ex As Exception
                Call ShowError("ERROR in AddSubscription: " + ex.Message.ToString)
                Exit Sub
            End Try

        End Sub


    Paul Mauriello

    Sunday, May 19, 2013 2:25 AM