Not getting all pages of report

Posted by: goth on 4 August 2017, 2:32 pm EST

  • Posted 4 August 2017, 2:32 pm EST

    When I run a query against sql server via QA, I'm getting about 1000 hits. When I run a report using the same query, I'm only getting 13-pages. For development purposes, I've assigned the sql statement to the report datacontrol. However, at runtime, this will have to be changed. How can I do this?

  • Replied 4 August 2017, 2:32 pm EST

    You can reference the control through code -

    rpt.(DataControlName).ConnectionString = ""
    rpt.(DataControlName).SQL = ""

    update these before you call rpt.Run and they should use the new information.
  • Replied 4 August 2017, 2:32 pm EST

    OK, here's what I've got...

    Private Sub btnShowReport_Click()
      Dim sConnString As String
      Dim sSqlQuery As String

      sConnString = "Provider=SQLOLEDB.1;Server=(local);Database=udbs_Development;User ID=foo;Password=bar;"

      sSqlQuery = [really ugly select statement w/ 3-joins]

      '-- using QA, the query returns 1,219 hits, but the report only
      '   shows 186 pages when it's previewed, I've a feeling the 
      '   problem lies with the report itself

      With arPickTicket

        .DataControl1.ConnectionString = sConnString
        .DataControl1.Source = sSqlQuery 
        .DataControl1.Refresh
      
        '-- set all margins to 1/2"    
        .PageSettings.BottomMargin = 720
        .PageSettings.TopMargin = 720
        .PageSettings.LeftMargin = 720
        .PageSettings.RightMargin = 720

        '-- preview report
        .Show

      End With

    End Sub

  • Replied 4 August 2017, 2:32 pm EST

    Attached is the report layout, arPickTicket.txt, in xml format
    2005/02/arPickTicket.txt
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels