Limit No of Coloumn in Matrix RDLC report

southindian
Member Posts: 247
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...
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...
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions