问题
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 rows with each row having 2 records each. Is this possible in SSRS? I am using list to achieve it. Please advise.
回答1:
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:
来源:https://stackoverflow.com/questions/57076070/how-can-i-loop-records-so-that-2-records-per-row-one-on-left-and-other-on-right