Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 19th, 2004, 10:58 AM
Registered User
 
Join Date: Jul 2004
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default Output in a GataGrid according to Grouping

Hi all, I have a question that is probably REALLY simple for someone out there but is escaping me!!!

Here is a scaled down version of my result set from the query I am working with:

Total Code Title Description PrintOrder
$38.44 50 Local Service Charges 9004572938 - Business Plus 1 - 05/01/04 to 05/31/04 5
$5.00 50 Local Service Charges 9004573144 - Additional Listing - Business - 05/01/04 to 05/31/04 5
$48.44 50 Local Service Charges 9004573144 - Business Advantage Plus - 05/01/04 to 05/31/04 5
$0.55 100 Federal, State & Local Taxes 9004572938 - Federal Universal Service Fund 10
$0.55 100 Federal, State & Local Taxes 9004573144 - Federal Universal Service Fund 10
$2.76 100 Federal, State & Local Taxes Federal Excise Tax - FEDERAL EXCISE TAX 10
$2.00 100 Federal, State & Local Taxes Local 911 Surcharge - KOSCIUSKO CO. 911 SURCHARGE 10
$5.52 100 Federal, State & Local Taxes State Sales Tax - STATE SALES TAX 10
$0.12 100 Federal, State & Local Taxes Telecomm Relay Systems Surcharge - IN TELECOM RELAY SYS SURCHARGE 10

(it's supposed to be tab delimiated, I don't know how to make it display like that though. There are 5 columns)


You'll notice that the results are grouped by the 'Code'

Here is how I need them to display:

<table cellspacing='1' cellpadding='3' border='0' width='596' align='center'>

     <tr>
          <td colspan='3'><B>Local Service Charges</B></td>
     </tr>
     <tr>
          <td nowrap>Date</td>
          <td nowrap>Description</td>
          <td nowrap align='right'>Amount</td></tr>
     <tr>
          <td >4/19/2004</TD>
          <td >9004572938 - Business Plus 1 - 05/01/04 to 05/31/04</TD>
          <td align='right'>$38.44</TD>
     </TR>
     <TR>
          <td >4/19/2004</TD>
          <td >9004573144 - Additional Listing - Business - 05/01/04 to 05/31/04</TD>
          <td align='right'>$5.00</TD>
     </TR>
     <TR>
          <td >4/19/2004</TD>
          <td >9004573144 - Business Advantage Plus - 05/01/04 to 05/31/04</TD>
          <td align='right'>$48.44</TD>
     </TR>
     <TR>
          <td ><B>Total</B></td>
          <td ></td>
          <td align='right'><B>$91.88</B></td></tr>
     <tr>
          <td colspan='3' >.</td>
     </tr>
     <tr>
          <td colspan='3'><B>Federal, State & Local Taxes</B></td>
     </tr>
     <tr>
          <td nowrap>Date</td>
          <td nowrap>Description</td>
          <td nowrap align='right'>Amount</td></tr>
     <tr>
          <td >4/19/2004</TD>
          <td >9004572938 - Federal Universal Service Fund</TD>
          <td align='right'>$0.55</TD>
     </TR>
     <TR>
          <td >4/19/2004</TD>
          <td >9004573144 - Federal Universal Service Fund</TD>
          <td align='right'>$0.55</TD>
     </TR>
     <TR>
          <td >4/19/2004</TD>
          <td >Federal Excise Tax - FEDERAL EXCISE TAX </TD>
          <td align='right'>$2.76</TD>
     </TR>
     <TR>
          <td >4/19/2004</TD>
          <td >Local 911 Surcharge - KOSCIUSKO CO. 911 SURCHARGE </TD>
          <td align='right'>$2.00</TD>
     </TR>
     <TR>
          <td >4/19/2004</TD>
          <td >State Sales Tax - STATE SALES TAX </TD>
          <td align='right'>$5.52</TD>
     </TR>
     <TR>
          <td >4/19/2004</TD>
          <td >Telecomm Relay Systems Surcharge - IN TELECOM RELAY SYS SURCHARGE</TD>
          <td align='right'>$0.12</TD>
     </TR>
     <tr>
          <td ><B>Total</B></td>
          <td ></td>
          <td align='right'><B>$11.50</B></td>
     </tr>
</Table>
    </td>
  </tr>
</table>

(Just cut and paste the HTML code, I don't know how to display it here)

I have this 'feeling' that there is some way to make the DataGrid control display this result set correctly. Each time a new 'code' and 'title' come up it needs to make a 'header' line and then before the next new 'header' line I need a 'total' line.

It is currently using this huge block of 'if-then' statements to generate the table, I didn't write that and I need to streamline it for the new version. I am SOOOOOO stuck though.

Thanks for any help you can give!

Michelle







Similar Threads
Thread Thread Starter Forum Replies Last Post
Grouping with XSLT 1.0 rodmcleay XSLT 1 January 14th, 2008 11:42 PM
Muenchian grouping amhicraig XSLT 1 December 5th, 2007 06:43 PM
Grouping By query Neal SQL Server 2000 1 June 11th, 2007 09:11 PM
Protect cells and allow grouping/un-grouping sfreuden Excel VBA 4 December 14th, 2006 08:01 AM
Grouping Indexes ShaileshShinde XSLT 3 November 30th, 2005 05:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.