Limit No of Coloumn in Matrix RDLC report

southindiansouthindian Member Posts: 247
edited 2015-09-03 in NAV Three Tier
I have followed the Below step which has been published in MSDN website , in order to achieve Limiting no of coloumn in Matrix RDLC report. And it works fine for One Production Order. But when try to run for multiple Production order , This Coloumn Break is not properly Working... Anybody Who have already tried this Please help to get rifd of this problem.


Step one: copy the following code to the custom code area

Dim FlagTable As System.Collections.Hashtable

Dim Flag AS Integer

Function MyFunc(ByVal NewValue As Object) As Integer

If (FlagTable Is Nothing) Then

FlagTable = New System.Collections.Hashtable

End If

If (NewValue Is Nothing) Then

NewValue = "-"

End If

If (Not FlagTable .Contains(NewValue )) Then

Flag =Flag + 1

FlagTable.Add(NewValue, nothing)

End If

MyFunc = Flag

End Function



Step two: Add a list to your report

1. Right-click the list ,and then select Properties.

2. Click Edit details group… button

3. Type in the expression =Ceiling(Code.MyFunc(Fields!Productname.Value)/2)

Note:

1) Fields!Productname.Value is your column group datafield

2) 2 is the number of the columns you want to display in a row



Step three: Sort the dataset by column group field, and then drag the matrix into the list

1. Switch to the data tab.

2. Add ‘order by datafield’ to sort the dataset by the column group datafield here is a example:

select * from vProductProfitability

where Year=2003 and

MonthNumberOfYear in (1,2,3,4,5,6,7,8,9,10,11,12)

order by Productname

3. Drag the matrix into the list and preview the report.



Below picture2 is just a sample for you, we can see that original matrix is too long, however picture 2 can fit the width of your report body. Of course you can reset the number of the column in one matrix.



Please expecting your valuble input...
Sign In or Register to comment.