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 6053963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:05:57+00:00 2026-05-23T08:05:57+00:00

Let suppose the result of my SQL query is Colour size week 1 week2

  • 0

Let suppose the result of my SQL query is

Colour   size    week 1  week2  week 3


Black      x       1      2       3

white      xx      1      1       0

yellow     large   2      1       0

I want to generate a report from this query like that.

               week 1               week 2              week 3
    ----------------------------------------------------------------
           x   xx   large       x   xx   large        x   xx   large
   ----------------------       --------------        -------------                                            
    black  1     0    0         2    0    0           3    0     0 

    white  1     0    0         0    1    0           0    0     0

    yellow 2     0    0         0    2    0           0    0     0

The possibilities I have think so for!

  1. In RDLC report change the the report XML at run time.(Very complex as sizes and colors are random)

  2. In Crystal report create a new report for each week and in last show them as subreports in main report.(Is this efficient what will be if I have to create report for 15 weeks or more).

  3. Create cross tab for each week and align them to look like above report.

Will some body suggest me what is best way to generate report in above format. Is some thing I am missing.

  • 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-23T08:05:58+00:00Added an answer on May 23, 2026 at 8:05 am

    This could be accomplished using grouping, but it would take a great deal of effort. Assuming that the weeks columns is static, you would essentially need to group by every data column (weeks, size, color) and then put your headers in the group footers with summaries or running totals carrying your values down to where you need them.

    The first part was intentionally vague because describing this in exact detail would be complicated so I was going to instead propose a different solution. Instead you can use a cross tab, but as your sql is currently constructed I believe it would require a separate cross tab for each week.

    I propose, and it’s based on some assumption, but I’m assuming that you have the ability to control the sql query coming into the report. If you could I believe it would be better to reformat the sql query and let the cross tab do all of the work instead of breaking the weeks out yourself. In the first part of my answer I assumed that the weeks were static, but I am guessing that this is not the ultimate solution in which case I think that if you use a data ouput as below you should be able to create a crosstab that will allow you to display your weeks as columns.

    Color    size    week    amt
    
    Black      x       1      1
    Black      x       2      2
    Black      x       3      3
    white      xx      1      1    
    white      xx      2      1
    white      xx      3      0
    yellow     large   1      2
    yellow     large   2      1
    yellow     large   3      0
    

    This is untested so don’t shoot me, but I believe with this layout you simply need to make the weeks and size column the fields in the columns section of the cross tab, the color field in the rows section of the cross tab and the amount in the summarized fields section.

    In general I try to answer the question asked on here before I propose a solution and understand that I didn’t in this case, but if you have the ability to modify the sql query the report takes in, I believe this is a better solution. Let me know if you have any issues. Hope this helps.

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

Sidebar

Related Questions

I've certain situation that requires certain result set from MySQL query, let's see the
Please look at this query. select name form table Let suppose this returns 100
Let us suppose the following table (e.g. a result of several inner join statements):
Let's suppose that I have a list of elements, and I want to select
Let's suppose I'm using the Northwind database and I would like to run a
Let's suppose I have an applet running within a page in a browser. What
Let us suppose we have a site entirely written on Silverlight. All navigation occurs
Let's suppose that I have 2 processes in Erlang, and each process has a
Let's suppose I have n arrays, where n is a variable (some number greater
Let's suppose you're an IT student with a basic knowledge of C++ and C#.

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.