2

My report consist of groups of employees. Each employee's section can have 3-5 pages. I want to add an empty page after a group if the page number is odd. The reason is when printing 2 pages on one sheet and a group has 3 pages then the first page of next group is printed on the same sheet.

I added empty TablixRow at the end of the TablixBody and added a group to it with a PageBreak set. Next step is to control its visibility based on page number.

<TablixMember>
                      <Group Name="EmptyGroup">
                        <PageBreak>
                          <BreakLocation>Start</BreakLocation>
                        </PageBreak>
                      </Group>
                      <Visibility>
                        <Hidden>=IIf(Globals.PageNumber Mod 2) = 0, True, False)</Hidden>
                      </Visibility>
                    </TablixMember>

However I don't have access to globals in report body (only in footer). Is there any workaround?

jlp
  • 9,800
  • 16
  • 53
  • 74

2 Answers2

0

A workaround would be to calculate the minimum and maximum amount records in a group that gets you to 4 pages. When a group has less records than this minimum or more than the maximum, add the empty page.

You can count the rows of each group by using CountRows
https://msdn.microsoft.com/en-us/library/dd255215.aspx

This isn't the most clean method, but it's a possibility.

Oceans
  • 3,445
  • 2
  • 17
  • 38
  • Thanks, but my report is not table based, it's more like a Word document – jlp Jan 05 '16 at 07:14
  • If you know the size of a group, no matter how you display it. You should be able to calculate the exact size limit of reaching the 4th page. Even if you are displaying full text. How exactly are you displaying the data? Is it just full text or do you use rectangles? When working with text for example you can just take the string length. – Oceans Jan 07 '16 at 15:48
0

I don't get what you are trying but you can access the page number from body by using custom code.

Go to Report Properties menu / Code Tab and put this function:

Function PgNm() As String    
    Return Me.Report.Globals!PageNumber    
End Function

Then call the function to get the page number:

=Code.PgNm()

Let me know if this can help you.

alejandro zuleta
  • 13,962
  • 3
  • 28
  • 48