Change Font Size on Runtime build Matrix Cells

edited July 2017 in FastReport .NET
Hi There;

In order to change the font size in matrix component;

I just drop an empty matrix in report band;

As I never know whose rows will be selected to report , I set this "page_start" method;

newTableCell is my best try, but it changes cells matrix style blue to no formatted and withe background cell;

Is there any other best pratice, to change font and format into cells that have no design time configured matrix ?




private void Page_StartPage(object sender, EventArgs e)
    {
      
        System.Drawing.Font newFont =   new System.Drawing.Font( "Arial" , 8) ;

        TableCell newTableCell = new FastReport.Table.TableCell();
   
        newTableCell.Font = newFont;

        MatrixObject newMatrixObject =  (MatrixObject)Report.FindObject("Matrix1");     // just a droped empty matrix


        HeaderDescriptionRow =new MatrixHeaderDescriptor();
        HeaderDescriptionRow.Expression = "[QryPrincipal.NOME_NV01]";
        HeaderDescriptionRow.TemplateCell = newTableCell;

      .........

        HeaderDescriptionRow =new MatrixHeaderDescriptor();
        HeaderDescriptionRow.Expression = "[QryPrincipal.NOME_NV02]";

 
   ........

    
           newMatrixObject.BuildTemplate();

.....

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.