Data Grid or Data Matrix...

Ask a Question related to ASP, Design and Development.

  1. #1

    Default Data Grid or Data Matrix...


    Greetings,

    This seems a very complicated task, so I welcome any
    input. My boss wants a data grid or matrix of the top 6
    orders with ordered items, and products, for a particular
    customer and he wants to see it like this:
    products down the left side
    orders across the top
    number of items under the respective order number column
    across from the corresponding product.
    I hope that makes sense.
    I have three tables. Products, Orders, Orderitems. I
    don't even know where to start. Many thanks in advance
    for any input offered.
    DebbieD Guest

  2. Similar Questions and Discussions

    1. Problem with Data Grid reading dynamic data
      I have created a website that uses datagrids to read data from an asp page. It works great, and fills the datagrid perfectly but it does not work...
    2. How to display a set of data in a data grid when drivenby a combo box?
      I am trying to build a page where the user can select a syle of food (i.e. chinese, italian etc) from a combo. I would then want the relevent...
    3. How to append data in data grid from response
      I am displaying the data say 10 records in the data grid from the HTPPResponse. I am having button below the data grid named " more". When user...
    4. Drag and drop data between cells in a data grid
      Check out this, dino has explained how to do drag and drop in datagrid http://msdn.microsoft.com/msdnmag/issues/04/01/CuttingEdge/default.aspx --...
    5. Display data from database in a scrollable data grid on an ASP Page
      Hi All, I want to display data from database in a scrollable data grid on an ASP Page. I want to use it for entering data also. Should i have to...
  3. #2

    Default Re: Data Grid or Data Matrix...

    DebbieD wrote:
    > Greetings,
    >
    > This seems a very complicated task, so I welcome any
    > input. My boss wants a data grid or matrix of the top 6
    > orders with ordered items, and products, for a particular
    > customer and he wants to see it like this:
    > products down the left side
    > orders across the top
    > number of items under the respective order number column
    > across from the corresponding product.
    > I hope that makes sense.
    > I have three tables. Products, Orders, Orderitems. I
    > don't even know where to start. Many thanks in advance
    > for any input offered.
    So you need a crosstab (also known as a pivot table). The first step is to
    let us know what database you are using (version, as well). Also, if you
    could give us some details about your tables, column names, datatypes,
    relationships, it would get us that much further along in the process. Note,
    if your tables have dozens of columns that aren't related to this question,
    then we don't need to hear about them, just tell us about the relevant
    columns and their datatypes.

    Providing some sample data for us to work with will also help. Just a few
    rows for each table - no need to use attachments.

    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows Guest

  4. #3

    Default Re: Data Grid or Data Matrix...


    Many thanks Bob. I am using a SQL2000 database.

    I have three tables and have listed fields I need to
    display next to the table name:
    PRODUCTS - catalogid (int),name (text)
    orders - orderid (int), lastname (text), firstname (text)
    orderitems - numitems (int), unitprice (money)

    orderitems is linked to orders with orderid
    products is linked to orderitems with catalogid

    I hope this helps. In the meantime, I'll look up things
    on pivot tables.

    Thanks again.

    >-----Original Message-----
    >DebbieD wrote:
    >> Greetings,
    >>
    >> This seems a very complicated task, so I welcome any
    >> input. My boss wants a data grid or matrix of the top
    6
    >> orders with ordered items, and products, for a
    particular
    >> customer and he wants to see it like this:
    >> products down the left side
    >> orders across the top
    >> number of items under the respective order number
    column
    >> across from the corresponding product.
    >> I hope that makes sense.
    >> I have three tables. Products, Orders, Orderitems. I
    >> don't even know where to start. Many thanks in advance
    >> for any input offered.
    >
    >So you need a crosstab (also known as a pivot table).
    The first step is to
    >let us know what database you are using (version, as
    well). Also, if you
    >could give us some details about your tables, column
    names, datatypes,
    >relationships, it would get us that much further along
    in the process. Note,
    >if your tables have dozens of columns that aren't
    related to this question,
    >then we don't need to hear about them, just tell us
    about the relevant
    >columns and their datatypes.
    >
    >Providing some sample data for us to work with will also
    help. Just a few
    >rows for each table - no need to use attachments.
    >
    >Bob Barrows
    >
    >--
    >Microsoft MVP - ASP/ASP.NET
    >Please reply to the newsgroup. This email account is my
    spam trap so I
    >don't check it very often. If you must reply off-line,
    then remove the
    >"NO SPAM"
    >
    >
    >.
    >
    debbied Guest

  5. #4

    Default Re: Data Grid or Data Matrix...


    Hi Bob,

    I did exactly what I need in Access but it won't work in
    my Active Server Page because my back end is SQL. How
    can I translate this into a SQL query? Thanks!

    Hello,

    I've created this crosstab query in Access and works
    great but my back end is SQL2000. How can this be
    rewritten to pull from a SQL2000 database in an ASP?
    Thank you very much in advance.

    TRANSFORM Sum(qyMatrixTest.numitems) AS SumOfnumitems
    SELECT qyMatrixTest.cname
    FROM qyMatrixTest
    WHERE (((qyMatrixTest.ocustomerid)=271))
    GROUP BY qyMatrixTest.cname, qyMatrixTest.ocustomerid
    PIVOT qyMatrixTest.orderid;


    >-----Original Message-----
    >DebbieD wrote:
    >> Greetings,
    >>
    >> This seems a very complicated task, so I welcome any
    >> input. My boss wants a data grid or matrix of the top
    6
    >> orders with ordered items, and products, for a
    particular
    >> customer and he wants to see it like this:
    >> products down the left side
    >> orders across the top
    >> number of items under the respective order number
    column
    >> across from the corresponding product.
    >> I hope that makes sense.
    >> I have three tables. Products, Orders, Orderitems. I
    >> don't even know where to start. Many thanks in advance
    >> for any input offered.
    >
    >So you need a crosstab (also known as a pivot table).
    The first step is to
    >let us know what database you are using (version, as
    well). Also, if you
    >could give us some details about your tables, column
    names, datatypes,
    >relationships, it would get us that much further along
    in the process. Note,
    >if your tables have dozens of columns that aren't
    related to this question,
    >then we don't need to hear about them, just tell us
    about the relevant
    >columns and their datatypes.
    >
    >Providing some sample data for us to work with will also
    help. Just a few
    >rows for each table - no need to use attachments.
    >
    >Bob Barrows
    >
    >--
    >Microsoft MVP - ASP/ASP.NET
    >Please reply to the newsgroup. This email account is my
    spam trap so I
    >don't check it very often. If you must reply off-line,
    then remove the
    >"NO SPAM"
    >
    >
    >.
    >
    DebbieD Guest

  6. #5

    Default Re: Data Grid or Data Matrix...

    DebbieD wrote:
    > Hi Bob,
    >
    > I did exactly what I need in Access but it won't work in
    > my Active Server Page because my back end is SQL. How
    > can I translate this into a SQL query? Thanks!
    >
    > Hello,
    >
    > I've created this crosstab query in Access and works
    > great but my back end is SQL2000. How can this be
    > rewritten to pull from a SQL2000 database in an ASP?
    > Thank you very much in advance.
    >
    > TRANSFORM Sum(qyMatrixTest.numitems) AS SumOfnumitems
    > SELECT qyMatrixTest.cname
    > FROM qyMatrixTest
    > WHERE (((qyMatrixTest.ocustomerid)=271))
    > GROUP BY qyMatrixTest.cname, qyMatrixTest.ocustomerid
    > PIVOT qyMatrixTest.orderid;
    >
    >
    Yes, it's easy in Access, but not so easy in SQL Server. Have you done a
    Google search for crosstab and T-SQL? If so, you will find a lot of
    solutions.

    [url]http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=T%2DSQL+crosstab[/url]

    The easiest solution may be to use an Access database with your SQL tables
    linked in to run this Transform query. However, it may not perform very well
    so YMMV.

    If your budget can afford it, there's a tool called RAC
    ([url]http://www.rac4sql.com/[/url]) that makes crosstabs in SQL Server easy.

    HTH,
    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139