TechSapphire Sunday, 2018-04-22, 0:05 AM
Site menu
Login form
News
Play Games
  • Deep Freeze
  • Ice Slide
  • Gyroball
  • Fat Fish
  • Bush Royal Rampage
  • Show data or details in horizontal layout in SSRS

    To show data in horizontal layout like mentioned below:

    Example 1:

    Step 1: Drag matrix

    Step 2: Select column to be displayed horizontally in column group.

    Step 3: Delete row group 

    Step 4: Delete Column header but delete only row not associated group.

     

    Example 2:

    Step 1: Generate a view with row number and column which you want to use horizontally.

    CREATE view CustWithRow
    as
    SELECT      row_number() over(order by customerid) rownum,  CompanyName 
    FROM            Customers

    Step 2: Generate output using PIVOT operator.

    CREATE VIEW DynamicCol
    as
     SELECT 
    [1] [Col1],[2] [Col2],[0] [Col3]
    FROM
    (SELECT CompanyName, rownum%3 rownum,row_number() over(partition by  rownum%3 order by CompanyName) rn
        FROM CustWithRow) AS SourceTable
    PIVOT
    (
    max( CompanyName)
    FOR rownum IN ([0],[1],[2])
    ) AS PivotTable;

    Step 3: Use view directly on report.

    Note: For learning PIVOT in detail click here.

     

     

     

    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 © 2018