Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6021987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:47:36+00:00 2026-05-23T03:47:36+00:00

From a query, I get these results: Machine 1, Product A, 1 pal Machine

  • 0

From a query, I get these results:

Machine 1, Product A, 1 pal  
Machine 1, Product B, 2 pal  
Machine 1, Product C, 3 pal  
Machine 2, Product D, 2 pal  
Machine 2, Product E, 2 pal  
Machine 3, Product F, 1 pal  

I would like to create a report that looks like this:

Machine 1  |  Machine 2  |  Machine 3 
Product A  |  Product D  |  Product F  
1 pal      |    2 pal    | 1 pal  
Product B  |  Product E  |   
2 pal      |  2 pal  
Product C
3 pal

I know above formatting sucks but it gives an idea. I guess this is the same problem as in New group in New column but with another technology. Is anyone able to help? Would be very much appreciated, thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:47:37+00:00Added an answer on May 23, 2026 at 3:47 am

    Here is one possible way of achieving this using SSRS Matrix report item in conjunction with SQL Server ROW_NUMBER function. Following example shows how this can be done. The example uses SSRS 2005 with SQL Server 2008 R2 database.

    Step-by-step process: SSRS 2005

    1. Created a table named dbo.GroupColumns representing the data that you provided as shown in screenshot #1. Create scripts of the table is provided under SQL Scripts section.

    2. Created a query shown in screenshot #2, which will be used to create the SSRS dataset. Query is provided under SSRS dataset query section. Screenshot #2 shows the query output in Management Studio. The query uses ROW_NUMBER() function to assign sequential numbers within a given Machine sorted by Machine and Product.

    3. On the SSRS Report, place a Matrix report item. Refer screenshot #3.

    4. Drag and drop RowRank, Machine and Product values from the data set onto the Matrix as shown in screenshot #4.

    5. Right-click on the cell containing Product value and select Add Row as shown in screenshot #5. A new second column will be added along with a new row.

    6. Drag and drop the Units column from data set onto the Matrix as shown in screenshot #6.

    7. Set the Width property on the second matrix column to 0 (zero) because we don’t want to show that column. Even though it is set to zero, the value will change to 0.03125 in. Screenshot #7 shows the Matrix report item after applying some formatting and coloring.

    Hope that helps.

    SQL Scripts:

    CREATE TABLE [dbo].[GroupColumns](
        [Id] [int] IDENTITY(1,1) NOT NULL,
        [Machine] [varchar](10) NULL,
        [Product] [varchar](10) NULL,
        [Units] [varchar](10) NULL,
     CONSTRAINT [PK_GroupColumns] PRIMARY KEY CLUSTERED ([Id] ASC)) ON [PRIMARY]
    GO
    

    SSRS dataset query:

    SELECT  ROW_NUMBER() OVER(
                PARTITION BY    Machine 
                ORDER BY        Machine
                            ,   Product
            ) AS RowRank
        ,   Id
        ,   Machine
        ,   Product
        ,   Units 
    FROM    dbo.GroupColumns
    

    Screenshot #1:

    1

    Screenshot #2:

    2

    Screenshot #3:

    3

    Screenshot #4:

    4

    Screenshot #5:

    5

    Screenshot #6:

    6

    Screenshot #7:

    7

    Screenshot #8:

    8

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find out why I do get these strange results from this
I need to get UserCarId(int) from this query and assign to int type variable.
I want to get the last result returned from this query. How do I
On this form, I create a grid, almost looks like a bar chart with
I need to write a SQL query which will get me those rows from
Is there is any way to get the select Random Records using query from
How to get start date and end dates in a query from database.
I am testing a simple query to get data from an AS400 database. I
I'm trying to get the query string from a string (not the current URL).
I am using a SELECT query to get the data from a number of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.