How can I loop records so that 2 records per row one on left and other on right, is this possible?

后端 未结 1 1012
死守一世寂寞
死守一世寂寞 2021-01-26 05:46

In my SSRS report, I want to show 2 records in one row, so they each row contian one entry in left and other entry in right. So if there are total 10 records, there should be 5

相关标签:
1条回答
  • 2021-01-26 06:20

    I have a potential solution that could solve your requirement. I recommend utilizing the RowNumber function of SSRS to specify odd numbered items in the first column and even numbered items in the second. So for example, you might use the following expressions.

    Column 1:

    =IIF(RowNumber(Nothing) Mod 2 = 1, Nothing, Previous(Fields!Data.Value))
    

    Column 2:

    =IIF((RowNumber(Nothing) + 1) Mod 2 = 0, Nothing, Fields!Data.Value)
    

    With those expressions, you may also need to add an expression to the row visibility that hides rows that are empty. Something like the following expression will hide the row if both columns contain no data. This should leave you with 5 rows containing your 10 records.

    =IsNothing(ReportItems!Textbox1.Value) And IsNothing(ReportItems!Textbox2.Value)
    

    My results:

    0 讨论(0)
提交回复
热议问题