I want matrix in middle of the page

edited January 2012 in FastReport .NET
My matrix have different(by data) number of columns and rows. I want matrix that will every time in middle of the page. Matrix begins from left side of page now and wasnt in middle of the page, because number of columns isnt always same.
Thanks for help.

Comments

  • edited 5:43PM
    Hello,

    Create the matrix.ModifyResult event handler and write the following code:

        private void Matrix1_ModifyResult(object sender, EventArgs e)
        {
          Matrix1.ResultTable.AfterCalcBounds += ResultTable_AfterCalcBounds;
        }
        
        private void ResultTable_AfterCalcBounds(object sender, EventArgs e)
        {
          Matrix1.ResultTable.Left = (Engine.PageWidth - Matrix1.ResultTable.Width) / 2;
        }
    
  • edited 5:43PM
    AlexTZ wrote: »
    Hello,

    Create the matrix.ModifyResult event handler and write the following code:

        private void Matrix1_ModifyResult(object sender, EventArgs e)
        {
          Matrix1.ResultTable.AfterCalcBounds += ResultTable_AfterCalcBounds;
        }
        
        private void ResultTable_AfterCalcBounds(object sender, EventArgs e)
        {
          Matrix1.ResultTable.Left = (Engine.PageWidth - Matrix1.ResultTable.Width) / 2;
        }
    


    Thank you very much

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.