Forums
Forums are Read-Only. Use the new Support Center. To start a general discussion, use the General category when submitting your question.

How to add additional info at end of each row?

Last post 1/4/2012 1:28 PM by Jkumar Raj. 7 replies.
Sort Posts: Previous Next
  • Ian Ma

    How to add additional info at end of each row?

    9/6/2010 9:49 PM
    • Not Ranked
    • Joined on 9/7/2010
    • Posts 5

    Hi guys.

    I'm loving XtraPivotGrid. It does exactly what I need it to do except one small detail. 

    I would like to append additional info at the end of each row (the top most row when grouping is applied). 

    I have my main data binded to a data table but the additional information are from a non-related data table and there 

    is no easy way to join the two tables. Unfortunately I'm working with what's given to me and can not alter or change 

    the database design :(

    I don't necessarily need to show them in the same pivot grid, this additional info is more suited for a grid control anyway

    but I DO NEED to print them together.

    E.g.

    | main data |

    | other info |

    | main data |

    | other info |

    ...

    and totals for both main data and additional info on the last page.

    Can this be done? Sorry if this question is too obvious, I'm very new at this :)

    Please let me know if you would like a diagram or more elaborations. 

  • Ivan N (DevExpress R&D)

    Re: How to add additional info at end of each row?

    9/7/2010 3:00 AM
    • Top 75 Contributor
    • Joined on 5/10/2007
    • Posts 428

    Hello Ian,

    Could you please post a drawing of the layout you wish to achieve?

    Thanks,
    Ivan

    Have complaints about Pivot Table for WinForms or ASP.NET Pivot Table? Please write to PivotGrid [no spam] devexpress.com.
  • Ian Ma

    Re: How to add additional info at end of each row?

    9/7/2010 3:37 AM
    • Not Ranked
    • Joined on 9/7/2010
    • Posts 5

    Hi Ivan

    ^ This is what I'm trying to achieve in my report. AGF is a user(physio) in my design and there will be more users so the report is grouped by physios. I need to insert a Payment Method Grid at the end of each physio row (after Total).

    Let me know if this is not clear. 

  • Paul Kimmel (DevExpress)

    Re: How to add additional info at end of each row?

    9/21/2010 3:19 PM
    • Top 100 Contributor
    • Joined on 12/12/2008
    • Okemos, Michigan
    • Posts 245

     Hello Ian:

    My name is Paul Kimmel. I am a technical evangelist looking at your query. As I understand your request you qould like data that is not related by a key displayed in a grid-like structure between every row of users (physio). Must this be in a grid, does it have to be in the XtraPivotGrid or can it just be in a report?

    This is a slightly custom solution and I may have to re-work a demo. Any additional information you could provide will be helpful.

     

    Paul Kimmel

  • Ian Ma

    Re: How to add additional info at end of each row?

    9/21/2010 11:19 PM
    • Not Ranked
    • Joined on 9/7/2010
    • Posts 5

    Hi Paul, 

    Yes, you are correct. It can be just a report but preferably the data is represented in a PivotGrid either via XRPivotGrid or the XtraPivotGrid

    But the non related information under each physio does not have to be in the same PivotGrid. The only requirement is that it is printed on the same page (i.e. under each physio). 

    Thank you for your help. Let me know how you go. 

    Cheers

    Yinan

     

  • Paul Kimmel (DevExpress)

    Re: How to add additional info at end of each row?

    9/22/2010 3:10 AM
    • Top 100 Contributor
    • Joined on 12/12/2008
    • Okemos, Michigan
    • Posts 245

    For the PivotGridControl implement the CustomCellValue and CustomDrawFieldValue events. In the CustomCellValue correlate your pivot grid data with your other data and set the e.Value property.

    In the CustomDrawFieldValue set e.Info.Caption to each of your desired caption properties.  Here are the snippets, and I will be writing a blog tomorrow with downloadable code and pictures tomorrow.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using DevExpress.XtraPivotGrid;
    using DevExpress.Data.PivotGrid;
    using System.Reflection;

    namespace S319857
    {
      public partial class Form1 : Form
      {
        private List<Data> datum;
        public Form1()
        {
          InitializeComponent();

          datum = new List<Data>{
            new Data{ID=1, Cash="100", EftPos="Dummy", HealthFund="H1"},
            new Data{ID=2, Cash="200", EftPos="Dummy", HealthFund="H2"},
            new Data{ID=3, Cash="300", EftPos="Dummy", HealthFund="H3"},
            new Data{ID=4, Cash="400", EftPos="Dummy", HealthFund="H4"},
            new Data{ID=5, Cash="500", EftPos="Dummy", HealthFund="H5"},
            new Data{ID=6, Cash="600", EftPos="Dummy", HealthFund="H6"},
            new Data{ID=7, Cash="700", EftPos="Dummy", HealthFund="H7"},
            new Data{ID=8, Cash="800", EftPos="Dummy", HealthFund="H8"}};
        }

        private void Form1_Load(object sender, EventArgs e)
        {
          // TODO: This line of code loads data into the 'northwindDataSet.Products' table. You can move, or remove it, as needed.
          this.productsTableAdapter.Fill(this.northwindDataSet.Products);

        }

        private void pivotGridControl1_CustomSummary(object sender, DevExpress.XtraPivotGrid.PivotGridCustomSummaryEventArgs e)
        {
        }

        private void pivotGridControl1_CustomAppearance(object sender, DevExpress.XtraPivotGrid.PivotCustomAppearanceEventArgs e)
        {

        }

        private void pivotGridControl1_CustomCellDisplayText(object sender, DevExpress.XtraPivotGrid.PivotCellDisplayTextEventArgs e)
        {
        }

        private void pivotGridControl1_CustomCellValue(object sender, PivotCellValueEventArgs e)
        {
          int ID = Convert.ToInt32(e.GetFieldValue(fieldCategoryID1));

          Data obj = datum.Find(d => d.ID == ID);

          if ((e.SummaryType == PivotSummaryType.Custom) && (e.DataField == fieldUnitPrice1))
          {
            if (Convert.ToInt32(e.RowCustomTotal.Tag) == 1)
              e.Value = obj.Cash;
            else if (Convert.ToInt32(e.RowCustomTotal.Tag) == 2)
              e.Value = obj.EftPos;
            else if (Convert.ToInt32(e.RowCustomTotal.Tag) == 3)
              e.Value = obj.HealthFund;
          }
        }

        private void pivotGridControl1_CustomDrawFieldValue(object sender, PivotCustomDrawFieldValueEventArgs e)
        {
          if (e.Info.Caption.Contains("Custom"))
          {
            if (Convert.ToInt32(e.CustomTotal.Tag) == 1)
              e.Info.Caption = "CASH";
            else if (Convert.ToInt32(e.CustomTotal.Tag) == 2)
              e.Info.Caption = "EFTPOS";
            else if (Convert.ToInt32(e.CustomTotal.Tag) == 3)
              e.Info.Caption = "Health Fund";     
          }
        }
      }


      public class Data
      {
        private int iD;
        public int ID
        {
          get { return iD; }
          set { iD = value; }
        }

        private string cash;
        public string Cash
        {
          get { return cash; }
          set { cash = value; }
        }

        private string eftPost;
        public string EftPos
        {
          get { return eftPost; }
          set { eftPost = value; }
        }

        private string healthFund;
        public string HealthFund
        {
          get { return healthFund; }
          set { healthFund = value; }
        }
      }

    }

     

  • Paul Kimmel (DevExpress)

    Re: How to add additional info at end of each row?

    9/22/2010 2:43 PM
    • Top 100 Contributor
    • Joined on 12/12/2008
    • Okemos, Michigan
    • Posts 245

     Let me know if this blog post gets you in the neighborhood. If you still need help don't hesitate to ask.

    http://community.devexpress.com/blogs/paulk/archive/2010/09/22/pivot-grid-for-winforms-adding-custom-summary-information-to-a-pivot-grid.aspx

    Thanks for choosing Developer Express

  • Jkumar Raj

    Re: How to add additional info at end of each row?

    1/4/2012 1:28 PM
    • Not Ranked
    • Joined on 1/4/2012
    • Posts 1

     

    I need  


     

            Grand Total
    Physico Rate Item Type Item Fee GST
    AGF P Product Ball $5.00 $0.00
    GLUCO 3 $90.00 $0.00
    HEEL $30.00 $0.00
    LX ROLL $50.00 $0.00
    MCKROLL $35.00 $0.00
    PACK $20.00 $0.00
    PilloW $220.00 $0.00
    SWEDO $65.00 $0.00
    Service-Off site AMCOR $2,080.00 $208.00
    Service-On site 10960 $1,004.85 $0.00
    P1 $8,580.00 $0.00
    P2 $24,778.00 $0.00
    PE1 $42.85 $0.00
    PE2 $546.85 $0.00
    S Product Ball $5.00 $0.00
    GLUCO 3 $90.00 $0.00
    HEEL $30.00 $0.00
    LX ROLL $50.00 $0.00
    MCKROLL $35.00 $0.00
    PACK $20.00 $0.00
    PilloW $220.00 $0.00
    SWEDO $65.00 $0.00
    Service-Off site AMCOR $2,080.00 $208.00
    Service-On site 10960 $1,004.85 $0.00
    P1 $8,580.00 $0.00
    P2 $24,778.00 $0.00
    PE1 $42.85 $0.00
    PE2 $546.85 $0.00

     

     

    Instead group/tree on row area

     rowarea in individual data fro each  if u see "AGF" ,"P"  and "product" on each row 

     

            Grand Total  
    Physico Rate Item Type Item Fee GST
    AGF P Product Ball $5.00 $0.00
    AGF P Product GLUCO 3 $90.00 $0.00
    AGF P Product HEEL $30.00 $0.00
    AGF P Product LX ROLL $50.00 $0.00
    AGF P Product MCKROLL $35.00 $0.00
    AGF P Product PACK $20.00 $0.00
    AGF P Product PilloW $220.00 $0.00
    AGF P Product SWEDO $65.00 $0.00
    AGF P Service-Off site AMCOR $2,080.00 $208.00
    AGF P Service-On site 10960 $1,004.85 $0.00
    AGF P Service-On site P1 $8,580.00 $0.00
    AGF P Service-On site P2 $24,778.00 $0.00
    AGF P Service-On site PE1 $42.85 $0.00
    AGF P Service-On site PE2 $546.85 $0.00
    AGF S Product Ball $5.00 $0.00
    AGF S Product GLUCO 3 $90.00 $0.00
    AGF S Product HEEL $30.00 $0.00
    AGF S Product LX ROLL $50.00 $0.00
    AGF S Product MCKROLL $35.00 $0.00
    AGF S Product PACK $20.00 $0.00
    AGF S Product PilloW $220.00 $0.00
    AGF S Product SWEDO $65.00 $0.00
    AGF S Service-Off site AMCOR $2,080.00 $208.00
    AGF S Service-On site 10960 $1,004.85 $0.00
    AGF S Service-On site P1 $8,580.00 $0.00
    AGF S Service-On site P2 $24,778.00 $0.00
    AGF S Service-On site PE1 $42.85 $0.00
    AGF S Service-On site PE2 $546.85 $0.00

     

     

    Can suggest me how achieve this,

     

    Thanks & Regards,

    Jayakumar R 

More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.