Sample Matrix Form

DivyaDivya Member Posts: 125
Hi,

I have tried to create Matrix form in Navision. I have learnt some bits about matrix form. I want to share this with you all. I know this is a very small one.

This sample matrix form basically describes about how much sales has happened against responsibility centers.

Please give your valuable suggestions..

FOB File as below :
OBJECT Form 50002 Matrix Table - 1
{
  OBJECT-PROPERTIES
  {
    Date=10/24/08;
    Time=11:14:34 AM;
    Modified=Yes;
    Version List=;
  }
  PROPERTIES
  {
    Width=19030;
    Height=12430;
    InsertAllowed=No;
    DeleteAllowed=No;
    ModifyAllowed=No;
    SourceTable=Table18;
  }
  CONTROLS
  {
    { 1000000000;MatrixBox;110;1870 ;18920;9900 ;Name=MatrixWindow;
                                                 HorzGlue=Both;
                                                 VertGlue=Both;
                                                 MatrixColumnWidth=2200;
                                                 InlineEditing=Yes;
                                                 MatrixSourceTable=Table5714;
                                                 OnAfterGetRecord=BEGIN

                                                                    Matrixheader := CurrForm.MatrixWindow.MatrixRec.Code;

                                                                    {CustomerRec.RESET;
                                                                    CustomerRec.SETRANGE(CustomerRec."No.","No.");
                                                                    CustomerRec.SETRANGE(CustomerRec."Responsibility Center",Matrixheader);
                                                                    IF CustomerRec.FIND('-') THEN
                                                                    Checkmark:=TRUE
                                                                    ELSE
                                                                    Checkmark:=FALSE;  }
                                                                    Exp1:=0;
                                                                    SalesInvHead.RESET;
                                                                    SalesInvHead.SETRANGE(SalesInvHead."Sell-to Customer No.","No.");
                                                                    SalesInvHead.SETRANGE("Responsibility Center",Matrixheader);
                                                                    IF (FromDt<>0D) AND (ToDt <> 0D) THEN
                                                                    SalesInvHead.SETRANGE("Posting Date",FromDt,ToDt);
                                                                    IF SalesInvHead.FIND('-') THEN REPEAT
                                                                    SalesInvHead.CALCFIELDS(SalesInvHead.Amount);
                                                                    SalesInvHead.CALCFIELDS(SalesInvHead."Amount Including VAT");
                                                                    IF AmtIncVAT=FALSE THEN
                                                                    Exp1:=SalesInvHead.Amount+Exp1
                                                                    ELSE IF AmtIncVAT=TRUE THEN
                                                                    Exp1:=SalesInvHead."Amount Including VAT"+Exp1;
                                                                    UNTIL SalesInvHead.NEXT=0
                                                                    ELSE
                                                                    Exp1:=0;

                                                                    CurrForm.UPDATECONTROLS;
                                                                  END;
                                                                   }
    { 1000000007;TextBox;0    ;5390 ;2200 ;440  ;ParentControl=1000000000;
                                                 InColumn=Yes;
                                                 HorzAlign=Left;
                                                 FontSize=8;
                                                 SourceExpr="No." }
    { 1000000008;Label  ;0    ;0    ;0    ;0    ;ParentControl=1000000007;
                                                 InColumnHeading=Yes;
                                                 HorzAlign=Left;
                                                 FontSize=9;
                                                 FontBold=No }
    { 1000000003;TextBox;2196 ;660  ;3080 ;440  ;ParentControl=1000000000;
                                                 InColumn=Yes;
                                                 SourceExpr=Name }
    { 1000000004;Label  ;0    ;0    ;3300 ;440  ;ParentControl=1000000003;
                                                 InColumnHeading=Yes;
                                                 FontSize=9;
                                                 FontBold=No }
    { 1000000005;TextBox;6266 ;5500 ;3629 ;440  ;ParentControl=1000000000;
                                                 InColumn=Yes;
                                                 SourceExpr="Balance (LCY)";
                                                 OnDrillDown=BEGIN
                                                               DtldCustLedgEntry.SETRANGE("Customer No.","No.");
                                                               COPYFILTER("Global Dimension 1 Filter",DtldCustLedgEntry."Initial Entry Global Dim. 1");
                                                               COPYFILTER("Global Dimension 2 Filter",DtldCustLedgEntry."Initial Entry Global Dim. 2");
                                                               COPYFILTER("Currency Filter",DtldCustLedgEntry."Currency Code");
                                                               CustLedgEntry.DrillDownOnEntries(DtldCustLedgEntry);
                                                             END;
                                                              }
    { 1000000006;Label  ;0    ;0    ;0    ;0    ;ParentControl=1000000005;
                                                 InColumnHeading=Yes;
                                                 FontSize=9;
                                                 FontBold=No }
    { 1000000001;TextBox;11796;7480 ;9061 ;2090 ;ParentControl=1000000000;
                                                 InMatrix=Yes;
                                                 FontBold=No;
                                                 SourceExpr=Exp1;
                                                 OnLookup=BEGIN
                                                            SalesInvHead.RESET;
                                                            SalesInvHead.SETRANGE(SalesInvHead."Sell-to Customer No.","No.");
                                                            SalesInvHead.SETRANGE("Responsibility Center",Matrixheader);
                                                            IF (FromDt<>0D) AND (ToDt <> 0D) THEN
                                                            SalesInvHead.SETRANGE("Posting Date",FromDt,ToDt);
                                                            IF SalesInvHead.FIND('-') THEN
                                                            FORM.RUNMODAL(FORM::"Posted Sales Invoices",SalesInvHead);
                                                          END;
                                                           }
    { 1000000002;TextBox;16500;1650 ;1320 ;220  ;ParentControl=1000000001;
                                                 InMatrixHeading=Yes;
                                                 FontSize=9;
                                                 FontBold=No;
                                                 SourceExpr=Matrixheader }
    { 1000000010;TextBox;3850 ;440  ;2420 ;440  ;Name=FromDt;
                                                 SourceExpr=FromDt }
    { 1000000011;Label  ;440  ;440  ;3300 ;440  ;ParentControl=1000000010;
                                                 CaptionML=ENU=From Date }
    { 1000000012;TextBox;3850 ;1100 ;2420 ;440  ;SourceExpr=ToDt;
                                                 OnValidate=BEGIN
                                                              CurrForm.UPDATECONTROLS;
                                                            END;
                                                             }
    { 1000000013;Label  ;440  ;1100 ;3300 ;440  ;ParentControl=1000000012;
                                                 CaptionML=ENU=To Date }
    { 1000000009;CheckBox;9900;1100 ;440  ;440  ;ShowCaption=No;
                                                 SourceExpr=AmtIncVAT }
    { 1000000014;Label  ;6490 ;1100 ;3300 ;440  ;ParentControl=1000000009;
                                                 CaptionML=ENU=Amount Including VAT }
    { 1000000015;TextBox;9900 ;440  ;2420 ;440  ;CaptionML=ENU=Responsiblity Center;
                                                 SourceExpr=RespCode;
                                                 TableRelation="Responsibility Center";
                                                 OnValidate=BEGIN
                                                              CLEAR(CurrForm.MatrixWindow.MatrixRec);
                                                              IF RespCode<>'' THEN BEGIN
                                                              CurrForm.MatrixWindow.MatrixRec.SETRANGE(Code,RespCode);
                                                              END;
                                                              CurrForm.UPDATECONTROLS;
                                                            END;
                                                             }
    { 1000000016;Label  ;6490 ;440  ;3300 ;440  ;ParentControl=1000000015;
                                                 CaptionML=ENU=Responsiblity Center }
  }
  CODE
  {
    VAR
      Matrixheader@1000000000 : Code[30];
      Checkmark@1000000001 : Boolean;
      RespRec@1000000002 : Record 5714;
      CustomerRec@1000000003 : Record 18;
      DtldCustLedgEntry@1000000004 : Record 379;
      CustLedgEntry@1000000005 : Record 21;
      Exp1@1000000006 : Decimal;
      SalesInvHead@1000000007 : Record 112;
      FromDt@1000000008 : Date;
      ToDt@1000000009 : Date;
      AmtIncVAT@1000000010 : Boolean;
      RespCode@1000000011 : Code[30];

    BEGIN
    END.
  }
}

Regards,
Divya
Victory is sweetest when you've known defeat

Comments

  • reemareema Member Posts: 255
    Good work Divya. =D>

    But always keep in mind try to export that data in excel when u are using Matrix form.
    It is very useful to client.
    reema
  • DivyaDivya Member Posts: 125
    Thanks for your suggestions. Let me try to do that.
    Victory is sweetest when you've known defeat
  • krikikriki Member, Moderator Posts: 9,110
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • DivyaDivya Member Posts: 125
    Hi,

    Matrix Form control is available in Tool Box. you have to place the matrix control in the form. Just import and see the above fob which i have sent in my first post. Then you will get a simple idea.

    Divya
    Victory is sweetest when you've known defeat
  • reemareema Member Posts: 255
    Dear Divya,

    Kriki is not asking you. He is the senior developer. He throws a link which contains how to create a Matrix form to all learners.
    reema
  • krikikriki Member, Moderator Posts: 9,110
    reema wrote:
    He is the senior developer.
    :oops: "...the..." : too much honour. :oops:
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • garakgarak Member Posts: 3,263
    "the senior" :mrgreen::mrgreen::mrgreen:

    Alain, your'e old ....... :lol::lol:
    Do you make it right, it works too!
  • DivyaDivya Member Posts: 125
    Thanks for your suggestions kriki... :D ...
    Victory is sweetest when you've known defeat
  • krikikriki Member, Moderator Posts: 9,110
    garak wrote:
    "the senior" :mrgreen::mrgreen::mrgreen:

    Alain, your'e old ....... :lol::lol:
    I AM NOT!

    and if you don't believe it, you will feel my walking stick. :mrgreen:
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • garakgarak Member Posts: 3,263
    walking stick :mrgreen:

    let's fight grandpa =P~
    Do you make it right, it works too!
  • DivyaDivya Member Posts: 125
    kriki might be Senior by age.. but he is our Super Senior for Navision.... =D> =D> =D>
    Victory is sweetest when you've known defeat
  • krikikriki Member, Moderator Posts: 9,110
    Divya wrote:
    kriki might be Senior by age..
    Now I really feel old... :mrgreen:
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.