TechSapphire Saturday, 2024-12-21, 3:31 PM
Site menu
Login form
News
Play Games
  • Deep Freeze
  • Ice Slide
  • Gyroball
  • Fat Fish
  • Bush Royal Rampage
  • Matrix in SSRS and RDLC

    In SSRS or RDLC matrix is only control which provide you option of generating columns dynamically from data. In this one or more column act as source of column definition and one or more column act as value source. Below is the tutorial for Matrix and script used in tutorial:

    Topics:
    1. Creating a Matrix
    2. Validation Data
    3. Transforming Data in format suitable for matrix
    4. Transforming Complete Table
     
    Rule:
    Every thing should be data/Value
    SELECT t.*,
     tf.id
    FROM [TableToTransform] TF
    CROSS APPLY (
     VALUES (
     'Data1',
     Data1
     ),
     (
     'Data2',
     Data2
     )
     ) t(Title, Value)
    
    SELECT t.*
    FROM Expense ex
    CROSS APPLY (
     VALUES (
     'Month1',
     MONTH1,
     Category
     ),
     (
     'Month2',
     MONTH2,
     Category
     ),
     (
     'Month3',
     MONTH3,
     Category
     ),
     (
     'QTRMonth',
     QTRMONTH,
     Category
     )
     ) t([Title], [Values], [Category])
    Categories
    Programming [27]
    Tips for programming
    Security [2]
    Security Tips
    Google [1]
    Use google faster then ever you use
    Project [14]
    HTML [2]
    Electronics [0]
    Data Structure [0]
    Database [16]
    SQL SERVER
    SSRS [1]
    Sql Server Reporting Services
    Copyright MyCorp © 2024