0

I have a report like this: enter image description here

This is first page of a Resident.

So I just want to show #2 Rectangle in first page of each Resident and hide #2 in rest of pages like this: enter image description here

I tried to use code:

Public Function IsFirstPage(resident as string, currentResident as Microsoft.ReportingServices.ReportProcessing.OnDemandReportObjectModel.Variable) as Boolean
    If (resident<>currentResident.Value) Then
        currentResident.Value = resident
        Return True
    Else
        Return False
    End If
End Function

and add expression for #2 as order to hide #2:

=IIf(Code.IsFirstPage(Fields!szFirstName.Value+Fields!szLastName.Value, Variables!currentResident), False, True)

It hid #2 in first page. However, I tested it by clicking Previous button and saw new issue appears: #2 is hidden till the first page.

  • 1
    Is your pages after first page just the detail (#3)? If so, why not put #3 in a separate page and do the paging there, first page just show the summary? Is #1 ever changing for each page? Can you post more details, like groupings etc, and what you want to achieve. – thotwielder Aug 18 '16 at 11:49
  • 1
    From 2nd page to last page is #1 and #3, It is grouped by each Resident Sir @thotwielder – Nguyễn Xuân Hoàng Aug 18 '16 at 11:54
  • what condition you use for split data to new page ?? if you use Grouping (show each group on each page) you can set Visibility via using expression – Chanom First Aug 19 '16 at 11:33

1 Answers1

0

I've found the best way is adding hidden fields to header of table #3 and use =Fields!yourFields.Value to get value for these fields. I moved #1 to Header Page and used =ReportItems!yourTextBoxs.Value to get value for these fields. After that I used this expression: =IIF(ReportItems!txtResidentName.Value="", True, False) to hide #1 on last page. Hope anyone meet this issue, can resolve as well. Thanks