how can i create matrixObject with Datas?. Some Examples please!

MatrixObject matt = new MatrixObject();
        matt.DataSource = per.Matrix1.DataSource;
        FastReport.Matrix.MatrixData mdata  =  // how can i create MatrixData what is its consructer and how can i change matrix Datarows,matrix Datecolumns and matrix datacells
        MatrixHeaderDescriptor mh = new MatrixHeaderDescriptor("[SqlDataSource1.PersonelID]", false);
        mdata.Rows.Add(mh);
        matt.Bounds = new System.Drawing.RectangleF(0, 10, Units.Centimeters * 2, Units.Centimeters * 1);
        per.Data1.Objects.Add(matt);

i m trying to create matrixobject. but i m not succeed. please some codes about creating MatrixObject.

Comments

  • edited 7:52PM
    Something like this:
          FReport = new Report();
          ReportPage page = new ReportPage();
          page.Name = "Page1";
          FReport.Pages.Add(page);
          RegisterData();
          
          page.ReportTitle = new ReportTitleBand();
          page.ReportTitle.Name = "ReportTitle1";
          page.ReportTitle.Height = Units.Centimeters * 5;
          
          MatrixObject matrix = new MatrixObject();
          // choose data source
          matrix.DataSource = FReport.GetDataSource("MatrixDemo");
          
          // set up column
          MatrixHeaderDescriptor columnDescriptor = new MatrixHeaderDescriptor("[MatrixDemo.Year]");
          matrix.Data.Columns.Add(columnDescriptor);
    
          // set up row
          MatrixHeaderDescriptor rowDescriptor = new MatrixHeaderDescriptor("[MatrixDemo.Name]");
          matrix.Data.Rows.Add(rowDescriptor);
          
          // set up cell
          MatrixCellDescriptor cellDescriptor = new MatrixCellDescriptor("[MatrixDemo.Revenue]", MatrixAggregateFunction.Sum);
          matrix.Data.Cells.Add(cellDescriptor);
          
          // build the matrix template
          matrix.BuildTemplate();
          
          // change the text of column's total cell
          columnDescriptor.TemplateTotalCell.Text = "Grand Total";
          
          // add the matrix to the page
          page.ReportTitle.Objects.Add(matrix);
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.