Problem with Matrix

roshanthaparoshanthapa Member Posts: 90
I have been trying to use matrix box but I am lost somewhere.


I want to display dates in the heading of the table in the right side of the matrix table (As in Analysis by dimension). But I am unable to create the column headings.

For example, I use a filter "010107..310607". The right side table's column heading should be 010107 to 310607. The problem is I am unable to create those heading like 01/01/07, 02/01/07.....31/06/07.

I don't know how to loop so that the next column in the table is next date. Please enlighten me.

Comments

  • NaviDevNaviDev Member Posts: 365
    Try to search the word "Matrix" in the forum. You may find the answer to this.
    Navision noob....
  • roshanthaparoshanthapa Member Posts: 90
    Thanx NavDev, I really appreciate ur help. I have already searched all the Matrix related questions in the forum. To some extent, I have been able to develop the matrix form. Only the thing is I don't understang the logic behind how the column headers are created in the right hand side table of the matrix box. Please enlighten me.
  • SavatageSavatage Member Posts: 7,142
    Check out Kriki's How-To - It should make things clearer

    http://www.mibuso.com/howtoinfo.asp?FileID=13
  • NaviDevNaviDev Member Posts: 365
    Maybe doing this will achieve what you want to do.

    - Create a form with table Item bound to it (to setup this manually look for the property of the form SourceTable and Type Item or 27 in the field)
    - Place a matrixbox in the form.
    - Change the property name of the matrixbox to Matrix (this is for that we can able to access its property and access the record bound to it).
    - change also its property MatrixSourceTable into "Date". (this will be the table that is bound for the matrixbox)
    - Add a field of the item to the left side of the matix. Lets say Add the Description. (Right click on the form and select field menu, highlight the field description and place the cursor inside the matrix then hit the left click to add the field).
    - declare a global variable SampleVariable.
    - On the right side of the matrix place a textbox on the grid and also a textbox for its column heading.
    - Change the SourceExpr property of the TextBox that is on the grid with the variable SampleVariable.
    - And also change the SourceExpr property of the textBox that is on the columnheading with this CurrForm.Matrix.MatrixRec."Period Start" (You can see this via C/AL Symbols Menu OR F5, Select Currform > Controls > matrix > click the button "->" at the buttom right so that you can see its properties select variable > MatrixRec > FielName > Period Start > Hit the ENTER).
    - On the trigger of the form OnOpenForm place this code
    //this is to filter the period type of the table date of the matrixbox
    CurrForm.Matrix.MatrixRec.SETRANGE(CurrForm.Matrix.MatrixRec."Period Type",
      CurrForm.Matrix.MatrixRec."Period Type"::"0");
    //this is to filter the period start of the table date of the matrixbox
    CurrForm.Matrix.MatrixRec.SETFILTER(CurrForm.Matrix.MatrixRec."Period Start",
      '%1..%2', 010107D, 020107D);
    
    - Save the Form.
    - Run the form.



    Enjoy. Hope this works for you.
    Navision noob....
  • roshanthaparoshanthapa Member Posts: 90
    I did as you said NaviDev. Thank you so much. I was missing in matrixsourcetable property too.

    I did as you said but still, I get only one date as header in the right hand side table of the matrix box. I am still missing somewhere. Thank you so much for matrixsourcetable property.


    But still I get only the first date of the filter as header in the right hand side table of the matrix. Please help
  • ufukufuk Member Posts: 514
    You can get the column caption (MatrixHeader in the below example) like:

    Matrix-OnAfterGetRecord

    CurrForm.Matrix.MatrixRec.SETRANGE("Period Start",StartDate,EndDate);
    MatrixHeader := CurrForm.Matrix.MatrixRec."Period Start";
    Ufuk Asci
    Pargesoft
  • roshanthaparoshanthapa Member Posts: 90
    Thanx people. I got it solved. Some reference of form 213 called resource capacity helped me a lot. I am thankfull to you all.

    Hope to get further suggestions from you people.
Sign In or Register to comment.