locked
Limit no of column and display the empty column at the last if no have data RRS feed

  • Question

  • Hi, I already refer to : https://social.technet.microsoft.com/Forums/en-US/32f2

    8407-e1ca-457e-92fd-d292e32dde4e/limit-no-of-columns-in-ssrs-matrix-report?forum=sqlreportingservices 

    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

    How can I modified the code above to meet the result its always show 4 column. If the last page contain no value, it will show empty column

    For an example , I have 6 value column but i want to show 8 column instead of 6 column. I want every page is always show 4 column.


    Thank you in advance.

    Regards,

    Rian



    • Edited by Riannn Monday, August 10, 2020 3:40 AM
    Monday, August 10, 2020 3:06 AM

All replies

  • Hi Riannn,

    Still you need to have this code, and in the step 2 

    We  need to have =Ceiling(Code.MyFunc(Fields!Productname.Value)/4) for the column group expression.

    I don't think if it is natural to add two blank columns in the last page report. We must have a header or same data for it.

    Regards,

    Joy


    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.

    • Proposed as answer by Joy_Zhao Wednesday, August 12, 2020 3:15 AM
    Tuesday, August 11, 2020 6:00 AM
  • Hi,

    Has your problem been solved?

    If you have any question, please feel free to let me know.

    If your problem has been solved, please click "Mark as Answer" on my reply, thank you for your understanding.

     

    Best Regards,

    Joy



    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.

    Friday, August 14, 2020 3:50 AM