How to add data in an additional row on a table in reportviewer? In C # MVC

2

For example, I have in reportviewer in a table that I show the following data, grouped by account:

But it turns out, that for each account (n accounts), above the row where the name of the account is n °, I want to add a row with a data of the previous balance of the account. For example:

I have the query to obtain the previous balance, but I do not know how to pass it in the yellow row to the corresponding account in reportviewer, I would like to know if anyone has any idea of how it could be done. I do not think it can be done with groups, or in any other way. I hope someone has some idea. So far, so I generate the report viewer:

      public FileContentResult GetFileContentResultParametro(ReportParameter[] parametro, string nombreReporte, dynamic query, string nombreDataSource, String format, String deviceInfo, String fileDownloadName)
    {
        LocalReport report = new LocalReport();
        report.ReportPath = HttpContext.Current.Server.MapPath("~/Reportes/" + nombreReporte);

        report.DataSources.Clear();
        ReportDataSource reportDataSource = new ReportDataSource();
        reportDataSource.Value = query;
        reportDataSource.Name = nombreDataSource_DataSet;
        report.DataSources.Add(reportDataSource);
        report.SetParameters(parametro);
        report.Refresh();


        String mimeType;
        String encoding;
        String filenameExtension;
        String[] streamIds;
        Warning[] warnings;

        FileContentResult fileContentResult = new FileContentResult(report.Render(format, deviceInfo, out mimeType, out encoding, out filenameExtension, out streamIds, out warnings), mimeType);
        fileContentResult.FileDownloadName = Path.ChangeExtension(fileDownloadName, filenameExtension);

        return fileContentResult;
     }

I hope I can find some solution. Greetings

    
asked by Danilo 25.09.2016 в 03:45
source

1 answer

1

But that previous balance of the account could be achieved by means of a formula of sum by account

Lesson 6: Adding Grouping and Totals (Reporting Services)

The only thing that varies in your case is the location of the value, instead of putting it as a group footer you want to put it as the head of the next group

If you want to send it separately, maybe in the same datatable for the account N you send the value of the balance repeated and in the formula what you do is take the "First" the first value since for that account they will all be equal

    
answered by 26.09.2016 в 08:16