title: Shift rows based on parameter
body: <p>I'm creating a new report for labels. To be able to use the whole paper with the labels i need to shift the rows down based on a parameter. Is this possible?</p>
  
  <p>The first picture is how the label looks in the editor. Second picture is how the report looks when i run it. Last picture is how i want it.</p>
  
  <pre><code>Sql Query: SELECT
    Parts.PartName
    ,Orders.OrderId
    ,OrderCustomFields.[PD Number]
    ,OrderedParts.PartId
  FROM
    Orders
    INNER JOIN OrderCustomFields
      ON Orders.OrderId = OrderCustomFields.Id
    INNER JOIN OrderedParts
      ON Orders.OrderId = OrderedParts.OrderId
    INNER JOIN Parts
      ON OrderedParts.PartId = Parts.Id
  WHERE
    OrderCustomFields.[PD Number] = @PDNumber
  </code></pre>
  
  <p>[Editor]
  [<img src="https://i.stack.imgur.com/pogsb.png" alt="enter image description here">]<a href="https://i.stack.imgur.com/pogsb.png" rel="nofollow noreferrer">1</a></p>
  
  <p>[Result]
  [<img src="https://i.stack.imgur.com/3LR9b.png" alt="enter image description here">]<a href="https://i.stack.imgur.com/3LR9b.png" rel="nofollow noreferrer">2</a></p>
  
  <p>[Desired report layout]
  [<img src="https://i.stack.imgur.com/8GfO0.png" alt="enter image description here">]<a href="https://i.stack.imgur.com/8GfO0.png" rel="nofollow noreferrer">3</a></p>
  
  <p>I tried to make it work with your awnser Alan. I do get a syntax error. 
  What am i doing wrong?</p>
  
  <pre><code>SELECT ROW_NUMBER() OVER (Order BY Parts.PartName) as rn, Parts.PartName, Orders.OrderId, OrderCustomFields.[PD Number], OrderedParts.PartId
      FROM
        Orders
        INNER JOIN OrderCustomFields
          ON Orders.OrderId = OrderCustomFields.Id
        INNER JOIN OrderedParts
          ON Orders.OrderId = OrderedParts.OrderId
        INNER JOIN Parts
          ON OrderedParts.PartId = Parts.Id
      WHERE
        OrderCustomFields.[PD Number] = @PDNumber
      UNION All
  
      SELECT * FROM 
          ( -- get a sequence of numbers, make the rownumber negative
          select
              ROW_NUMBER() over(order by a.name) *-1 as rn
              , NULL as Parts.PartName
              , NULL as Orders.OrderId
              , NULL as OrderCustomFields.[PD Number]
              , NULL as OrderedParts.PartId
          From sys.all_objects a
      )topX
          WHERE rn &gt;= @skip *-1 -- filter to only row number that are positive (real records) or lower than the skip value
          ORDER BY rn
  </code></pre>