RDLC report to show total of a column RRS feed

  • Question

  • User1182587605 posted


    I have an RDLC report(tabular) and I need to show the total of a column named Total in my report. My code to fetch data is:

    protected void btnCreateReport_Click(object sender, EventArgs e)
                    ReportViewer1.Visible = true;
                    string FromSite = DropDownList1.SelectedItem.Text.ToString();
                    string FromDate = txtSelectDate1.Text;               
                    string ToDate = txtSelectDate2.Text;               
                    string query = "select Dump_Date as Date,Dump_Num as DumpNum,ItemID,SiteID,Qty,Cost,cast(SUM(CAST(Qty as decimal(14,4))*cast(Cost as decimal(14,4))) as decimal(14,2)) As Total from IC_Dump_T where SiteID = '" + FromSite + "' and Dump_Date between '" + FromDate + "' and '" + ToDate + "' group by Dump_Date,ItemID,SiteID,Dump_Num,Qty,Cost";
                    ReportViewer1.ProcessingMode = ProcessingMode.Local;
                    ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/DumpReport.rdlc");
                    RptDump dsdump = GetData(query);
                    ReportDataSource datasource = new ReportDataSource("RptDump", dsdump.Tables[0]);
                catch (Exception ex)
                    lblMessage.CssClass = "alert alert-warning";
                    lblMessage.Text = "Msg 014: Please choose a valid date range";

    Now, I need to show the total of Total column. I have tried the expression:


    but I have got a blank row but not the total of the column. Please help me show the sum for this report. My Column has decimal values in it and I need the total to show decimal values as well.



    Wednesday, January 4, 2017 4:23 PM

All replies

  • User-2057865890 posted

    Hi Deepak,

    To display Tablix data region grand totals and group subtotals, use the shortcut Add Total command. The Add Total command is context-sensitive. For a cell in the row group area, the Add Total command automatically adds a row outside the group for totals. Take a look at https://technet.microsoft.com/en-us/library/bb630415(v=sql.100).aspx (Understanding Default Scope).

    Best Regards,


    Thursday, January 5, 2017 8:36 AM