How to add total column in Columnar Report

Discussion in 'Free Source Codes' started by kapil22, May 29, 2021.

    
  1. kapil22

    kapil22 Member


    Dear Expert,
    This columnar company cost centre report, need to add total column.
    ref the image as follows:
    upload_2021-5-29_14-6-26.jpeg
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    From the available photo.... this is the solution....

    #FieldCol1 + #FieldCol2
     


  3. kapil22

    kapil22 Member


    no no amit ji,
    Amount field derived through repeat attribute
    this add by create button "create column"
    both column amount of two different companies.
     
    Last edited: May 29, 2021


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Have you defined the Total at the PART level ???
     


  5. kapil22

    kapil22 Member


    yes, but it for total of rows field total.
    i need tow .... column total
    regards
    kapil
     


  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Search for........... Columnar monthly summery
    type----as typed above.....

    Follow the same principles in your code.
     


  7. kapil22

    kapil22 Member


    Dear Amit ji,
    your codes are in my educational series.
    thanks
    but not helpful for my case, i need TOTAL of two amt column of different companies.

    "$$CollAmtTotal:" not helpful in my case, as my collection is "CostCentre" type.

    Regards

    kapil
     


  8. kapil22

    kapil22 Member


    Dear Amit ji,
    i hv done it
    thanks
    i query left if i want to add a column and want to fetch the value in field which is posted through memo voucher.
    pls suggest.
    and annexing image of current report: upload_2021-5-30_14-27-39.jpeg

    Regards
    Kapil

    Code:
    [#Table:     GTCommonReports]
    add:         object:     GTCCCReport
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [Object:         GTCCCReport]
    Use:             GoToReport Obj
    Name:        $$LocaleString:"Cost Centre Report- Compact"
    Current Report:     K010Report
    
    [Report:     K010Report]
    Title:         "Cost Centre Report- Compact"
    Filtered:     Yes
    Export:         Yes
    Form:         K010Form
    Use:             DSP Template
    Variables:     SVCurrentCompany, CostCentreName, SVFromDate, SVToDate,
    set:            IsCCReport:     yes
    set:            IsCCBkup:        yes
    set:            SVFromDate:    $BookFrom:Company:##SVCurrentCompany
    set:            SVToDate:        $LastVoucherDate:Company:##SVCurrentCompany
    Column Report:    K010AddColumn
    Repeat:         SVCurrentCompany, SVFromDate, SVToDate
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [Form:         K010Form]
    Use:             DSP Format Template
    Part:        K010PartTitle, K010PartData,
    width:         100% page
    height:        100% page
    Button:         ExplodeFlag, Blank1, F2ChangePeriod,
    button:        ChangeCompany, ExportButton, Blank2, K010CostCentre, K010AValue, Blank3
    button:        Add Column, Alter Column, Delete Column,
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [Part:        K010PartTitle]
    line:        K010PartTitleLine1, K010PartTitleLine2, K010PartTitleLine3
     
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [line:        K010PartTitleLine1]
    Field       :     SimplePrompt, NameField
    local    :    field    :    SimplePrompt        :    SET AS    :    "Fund Type (GParent):"
    local    :    field    :    SimplePrompt        :    style    :    TinyBold
    local    :    field    :    SimplePrompt        :    width    :    18
    local    :    field    :    SimplePrompt        :    color    :    Blue
    local    :    field    :    NameField        :    Set as        :     $Parent:CostCentre:#SimpleField
    local    :    field    :    NameField        :    Style    :    TinyBold
    local    :    field    :    NameField        :    width    :    40
    local    :    field    :    NameField        :    color    :    red
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [line:        K010PartTitleLine2]
        Field       :     SimplePrompt, SimpleField
        local    :    field    :    SimplePrompt        :    SET AS    :    "Funding Agency (Parent):"
        local    :    field    :    SimplePrompt        :    style    :    TinyBold
        local    :    field    :    SimplePrompt        :    width    :    18
        local    :    field    :    SimplePrompt        :    color    :    Blue
        local    :    field    :    SimpleField        :    Set as        :     $Parent:CostCentre:##CostCentreName
        local    :    field    :    SimpleField        :    Style    :    TinyBold
        local    :    field    :    SimpleField        :    width    :    40
        local    :    field    :    SimpleField        :    color    :    red
     
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [line:        K010PartTitleLine3]
        Field       :     SimplePrompt, ShortNameField, ;ShortPrompt, DSPMainDateTitle,
        Space Bottom:     if $$InPrintMode then 0.5 else 0.5
        local    :    field    :    SimplePrompt        :    SET AS    :    "Project (Name):"
        local    :    field    :    SimplePrompt        :    Style    :    TinyBold
        local    :    field    :    SimplePrompt        :    width    :    18
        local    :    field    :    SimplePrompt        :    color    :    Blue
        local    :    field    :    ShortNameField    :    Set as        :     ##CostCentreName
        local    :    field    :    ShortNameField    :    STYLE    :    TinyBold
        local    :    field    :    ShortNameField    :    width    :    40
        local    :    field    :    ShortNameField    :    color    :    red
    ;    local    :    field    :    ShortPrompt        :    SET AS    :    "Period" + " : "
    ;    local    :    field    :    ShortPrompt        :    style    :    TinyBold
    ;    local    :    field    :    ShortPrompt        :    width    :    10
    ;    local    :    field    :    ShortPrompt        :    color    :    Blue
    ;    local    :    field    :    DSP MainDateTitle    :    align    :    left
    ;    local    :    field    :    DSP MainDateTitle    :    color    :    red
    ;    local    :    field    :    DSP MainDateTitle    :    Style    :    TinyBold
    ;    local    :    field    :    DSP MainDateTitle    :    width    :    16
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [Part:        K010PartData]
    line:        K010PartDataTitleLine1, K010PartDataTitleLine2, K010PartDataTitleLine3, K010PartDataTitleLine4, K010PartDataDataLine1
    repeat:        K010PartDataDataLine1: K010Collection
    scroll:         BOTH
    Common Border:    yes
    bottom Line:        K010PartDataGrandTotalLine
    total:            K010FieldAmount1S, K010FieldAmount2S ;; this total attribute for bottom total
    Space Top:         if $$InPrintMode then 0.5 else 0
    Space Bottom:     if $$InPrintMode then 0.5 else 0
    Space Left:         if $$InPrintMode then 0.5 else 0.5
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [line:        K010PartDataTitleLine1]
    field:        K010FieldSNo, K010FieldMasterID, K010FieldCode, K010FieldName, K010FieldName1,
    Field:        K010FieldAmount, K010FieldAmount2
    repeat:        K010FieldAmount
    Local:        Field:     Default:             Style:         TinyBold
    Local:        Field:    Default:             Border:         K010ColumnTitlesTop
    Local:        Field:     Default:             LINE:         1
    Local:        Field:     Default:             align:        Left
    Local:        Field:    K010FieldSNo:         Info:         "SNo"
    Local:        Field:    K010FieldMasterID:    info:        "MasterID"
    Local:        Field:    K010FieldCode:        Info:         "Code"
    Local:        Field:    K010FieldName1:    info:        "Particulars (Budget Lines)"
    Local:        Field:    K010FieldAmount1:    Info:         #SVCurrentCompany
    Local:        Field:    K010FieldAmount1:    align:        center
    Local:        Field:    K010FieldAmount1:    Color:        Blue
    Local:        Field:    K010FieldAmount1:    border:        Thin Left Right bottom
    local:        Field:    K010FieldAmount2:     info:        "Actual"
    Local:        Field:    K010FieldAmount2:    align:        center
    Local:        Field:    K010FieldAmount2:    Color:        Black
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [line:        K010PartDataTitleLine2]
    field:        K010FieldSNo, K010FieldMasterID, K010FieldCode, K010FieldName, K010FieldName1,
    Field:        K010FieldAmount, K010FieldAmount2
    repeat:        K010FieldAmount
    Local:        Field:     Default:             Style:         TinyBold
    ;Local:        Field:    Default:             Border:         K010ColumnTitlesLeft
    Local:        Field:     Default:             LINE:         1
    Local:        Field:     Default:             align:        Left
    Local:        Field:    K010FieldSNo:         Info:         ""
    Local:        Field:    K010FieldMasterID:    info:        ""
    Local:        Field:    K010FieldCode:        Info:         ""
    Local:        Field:    K010FieldName1:    info:        ""
    Local:        Field:    K010FieldAmount1:    Info:         @@DSPDateStr
    Local:        Field:    K010FieldAmount1:    align:        center
    Local:        Field:    K010FieldAmount1:    Color:        Red
    local:        Field:    K010FieldAmount2:     info:        ""
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [line:        K010PartDataTitleLine3]
    field:        K010FieldSNo, K010FieldMasterID, K010FieldCode, K010FieldName, K010FieldName1,
    Field:        K010FieldAmount, K010FieldAmount2
    repeat:        K010FieldAmount
    Local:        Field:     Default:             Style:         TinyBold
    ;Local:        Field:    Default:             Border:         K010ColumnTitlesBottom
    Local:        Field:     Default:             LINE:         1
    Local:        Field:     Default:             align:        Left
    Local:        Field:    K010FieldSNo:         Info:         ""
    Local:        Field:    K010FieldMasterID:    info:        ""
    Local:        Field:    K010FieldCode:        Info:         ""
    Local:        Field:    K010FieldName1:    info:        ""
    Local:        Field:    K010FieldAmount1:    Info:         $$LocaleString:"Nett Amount"
    Local:        Field:    K010FieldAmount1:    align:        center
    Local:        Field:    K010FieldAmount1:    Color:        Black
    local:        Field:    K010FieldAmount2:     info:        ""
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [line:        K010PartDataTitleLine4]
    field:        K010FieldSNo, K010FieldMasterID, K010FieldCode, K010FieldName, K010FieldName1,
    Field:        K010FieldAmount, K010FieldAmount2
    repeat:        K010FieldAmount
    Local:        Field:     Default:             Style:         TinyBold
    Local:        Field:    Default:             Border:         K010ColumnTitlesBottom
    Local:        Field:     Default:             LINE:         1
    Local:        Field:     Default:             align:        Left
    Local:        Field:    K010FieldSNo:         Info:         ""
    Local:        Field:    K010FieldMasterID:    info:        ""
    Local:        Field:    K010FieldCode:        Info:         ""
    Local:        Field:    K010FieldName1:    info:        ""
    Local:        Field:    K010FieldAmount1:    Info:         $$LocaleString:"Actual"
    Local:        Field:    K010FieldAmount1:    align:        center
    Local:        Field:    K010FieldAmount1:    Color:        Blue
    local:        Field:    K010FieldAmount2:     info:        "Total"
    Local:        Field:    K010FieldAmount2:    align:        center
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [line:        K010PartDataDataLine1]
    field:        K010FieldSNo, K010FieldMasterID, K010FieldCode, K010FieldName, K010FieldName1,
    Field:        K010FieldAmount, K010FieldAmount2, K010FieldAmount2S
    repeat:        K010FieldAmount ;; this repeat attribute for repeat amount columnwise
    total:        K010FieldAmount1, K010FieldAmount2, K010FieldAmount1S, K010FieldAmount2S ;; this total attribute for Column total
    Local:        Field:     Default:             border:    Thin Left Right bottom
    Local:        Field:     K010FieldCode:        Style:     TinyBold
    local:        field:    K010FieldName1:    Indent:     $$ExplodeLevel * 1.5
    local:        field:    K010FieldAmount1:    color:    Black
    local:        field:    K010FieldAmount1:    Style:     TinyBold
    local:        field:    K010FieldAmount2:    color:    Black
    local:        field:    K010FieldAmount2:    Style:     TinyBold
    explode:        K010PartDataDataLine1PartExplode:    ($$IsCostCentre AND $NumChildren > 0 and ($$KeyExplode or ##ExplodeFlag))
    key:            Remove Line, Restore Line, Restore AllLines
    ;Option:         AlterOnEnter: $$IsCostCentre
    
    
    [part:        K010PartDataDataLine1PartExplode]
    line:        K010PartDataDataLine1
    repeat:        K010PartDataDataLine1: K010Collection
    local:        line:        K010PartDataDataLine1:    local:        field:    K010FieldAmount1:    color:    ToryBlue
    local:        line:        K010PartDataDataLine1:    local:        field:    K010FieldAmount1:    Style:     Tiny Italic
    local:        line:        K010PartDataDataLine1:    local:        field:    K010FieldAmount2:    color:    ToryBlue
    local:        line:        K010PartDataDataLine1:    local:        field:    K010FieldAmount2:    Style:     Tiny Bold Italic
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [line:        K010PartDataGrandTotalLine]
    field:        K010FieldSNo, K010FieldMasterID, K010FieldCode, K010FieldName, K010FieldName1,
    Field:        K010FieldAmount1, K010FieldAmount2
    repeat:        K010FieldAmount1
    Local:        Field:    default:            BORDER:        Totals
    Local:        Field:    K010FieldSNo:         Info:         ""
    Local:        Field:    K010FieldMasterID:    Info:         ""
    Local:        Field:    K010FieldCode:        Info:         ""
    Local:        Field:    K010FieldName1:    info:        "Grand Total:"
    Local:        Field:    K010FieldName1:    style:         TinyBold
    Local:        Field:    K010FieldName1:    color:         Black
    Local:        Field:    K010FieldAmount1:    setas:         $$Total:K010FieldAmount1S
    Local:        Field:    K010FieldAmount1:    color:        Black
    Local:        Field:    K010FieldAmount1:    Format:         "Bracketed:ForNegative,NoZero"
    Local:        Field:    K010FieldAmount1:    style:         TinyBold
    local:        Field:    K010FieldAmount2:    setas:        $$Total:K010FieldAmount2s
    Local:        Field:    K010FieldAmount2:    color:        Black
    Local:        Field:    K010FieldAmount2:    Format:         "Bracketed:ForNegative,NoZero"
    Local:        Field:    K010FieldAmount2:    style:         TinyBold
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [field:        K010FieldAmount]
    field:        K010FieldAmount1, K010FieldAmount1S,
    display:        K010Report    :$$IsCostCentre
    border:        Thin Left Right bottom
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [field:        K010FieldAmount1]
    use:            AmountField
    style:        Tiny
    Format:         "Bracketed:ForNegative,NoZero"
    Set As:         If $$IsDr:$CCAmount Then $CCAmount Else -$CCAmount
    invisible:    if ##K010AValue then yes else no
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [field:        K010FieldAmount1S]
    use:            Amount Field
    style:        Tiny
    format:        "DrCr"
    setas:        $CCAmount
    invisible:    yes
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [field:        K010FieldAmount2]
    use:            Amount Field
    style:        Tiny
    format:        "Bracketed:ForNegative,NoZero"
    setas:        $$Total:K010FieldAmount1
    Invisible:     $$NumSets = 1 or (if ##K010AValue then yes else no)
    scroll:        yes
    [field:        K010FieldAmount2S]
    use:            Amount Field
    style:        Tiny
    format:        "DrCr"
    setas:        $$Total:K010FieldAmount1S
    invisible:    yes
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [Field:        K010FieldSNo]
    Use :         NumberField
    SET AS:        $$LINE
    width:        if $$InPrintMode then 2 else 3
    Align:         left
    Style:         If $NumChildren > 0 Then "Tiny Bold  Italic" Else "Tiny Italic"
    color:        if $CostCentreDepth=4 then "Black" else if $CostCentreDepth=5 then "ToryBlue" else  "Stone Wash Red"
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [Field:        K010FieldMasterID]
    use:            NameField
    width:        if $$InPrintMode then 5 else 5
    setas:        $MasterID
    Style:         If $NumChildren > 0 Then "Tiny Bold  Italic" Else "Tiny Italic"
    color:        if $CostCentreDepth=4 then "Black" else if $CostCentreDepth=5 then "ToryBlue" else  "Stone Wash Red"
    invisible:    yes
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [Field:        K010FieldCode]
    Use:            Name Field
    setas:        if $$IsEmpty:$$StringWord:1:@@CodeName = no then $$StringWord:1:@@CodeName else  ""
    width:        if $$InPrintMode then 8 else 9
    color:        if $CostCentreDepth=4 then "Black" else if $CostCentreDepth=5 then "ToryBlue" else  "Stone Wash Red"
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [Field:        K010FieldName]
    Use:             Name Field
    Use:             DSPAccNameTmpl
    Setas:         $Name
    Style:         If $NumChildren > 0 Then "Tiny Bold" Else "Tiny Italic"
    width:        if $$InPrintMode then 30 else 70
    invisible:    yes
    color:        if $CostCentreDepth=4 then "Black" else if $CostCentreDepth=5 then "ToryBlue" else  "Stone Wash Red"
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [Field:        K010FieldName1]
    Use:             Name Field
    Use:             DSPAccNameTmpl
    setas:        $$StringRemWord:1:$Name
    Style:         If $NumChildren > 0 Then "Tiny Bold" Else "Tiny Italic"
    width:        if $$InPrintMode then 30 else 70
    color:        if $CostCentreDepth=4 then "Black" else if $CostCentreDepth=5 then "ToryBlue" else  "Stone Wash Red"
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [Border:     K010ColumnTitlesTop]
    Top:         Thick, Full Length
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [Border:     K010ColumnTitlesBottom]
    Bottom:     Thin,  Full Length
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [Border:     K010ColumnTitlesLeft]
    Left:         thin
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [Button:     K010CostCentre]
    Title:         "Cost Centre"
    key:         Alt + 1
    Action:         Modify Variables : Cost Centre Name
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [Button:     K010AValue]
    Title:         if ##K010AValue then "View AValue" else "Remove AValue"
    Key:         Alt + 2
    Action:         Set:     K010AValue:     not ##K010AValue
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [Variable:     K010AValue]
    Type:         Logical
    Persistent:     no
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [System:     Variable]
    K010AValue:     no
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [system:        formula]
    ;CodeName:    $$StringFindAndReplace:#K010FieldName:"-":""
    CodeName:    $$StringFindAndReplace:$Name:"-":""
    IsMemo:        $$IsMemo
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [Collection:     K010Collection]
    Type:        CostCentre
    Childof:     ##pvCostCentreName
    ParmVar:     pvCostCentreName : String : #CostCentreName
    Fetch:        MasterID, Name, OpeningBalance, ClosingBalance, Depth
    COMPUTE:    CCDepth:            $Depth:CostCentre:$Name
    Compute:    HasChildren:        $$NumChildren>0
    compute:    CCAmount:        $$NettAmount:$ClosingBalance-$OpeningBalance
    Compute:     Alias:             $$Alias
    Compute:     NumChildren:         $$NumChildren
    Compute:     CostCentreDepth:     $Depth:CostCentre:$Name
    Sort:         @@Default:         $$Name
    
    
    
    
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    
    [Report:     K010AddColumn]
    Use:             Configure Column Template
    Local:         Part:     Modify Variables:     Lines:             SVCurrentCompany, SVFromDate, SVToDate,
    
     
    Amit Kamdar likes this.


  9. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Well Done Buds...good work....nice report.

    Yes you can make a collection of report of VchType MEMO....fetch the relevant data.
    Then in your report and within the Field...you can use $$CollectionFieldbyKey ...... matcing it with MasterID and other details as you prefer.
     


  10. kapil22

    kapil22 Member


    Thanks sir
     


  11. kapil22

    kapil22 Member


    Dear Amit ji,
    Thanks your hints works...
    annexing particular code for your reference.
    but have another query, pls help
    1) I add budget column but value bring by date markup, where i need it should come since beginning of company till date.
    2) refer following image, where value fetch only to cost centre name but i need it should fetch its Parent also.
    upload_2021-5-30_20-51-3.jpeg


    Code:
    [field:        K010FieldAmount3] ;;; this field for Amount with format -/+ and this is for Column Budget
    use:            AmountField
    style:        Tiny
    Format:         "Bracketed:ForNegative,NoZero"
    setas:        $$ReportObject:$$CollectionFieldByKey:(If $$IsDr:$CCBAmount Then $CCBAmount Else -$CCBAmount):$Name:K010CollectionLC
    
    
    [Collection:    K010CollectionVoucher]
    Type:         Voucher
    filter:        MemoVCH
    fetch:        MasterID, VoucherNumber, VoucherTypeName
    [Collection:    K010CollectionLC]
    Source Collection:     K010CollectionVoucher
    Walk:                 AllLedgerEntries, CostCentreAllocations
    By:                     Name:            $Name:CostCentre:$Name
    by:                    MasterID:            $MasterID:CostCentre:$Name
    AGGRCompute:        CCBAmount:         SUM:    $Amount
    searchkey:            $Name
    
     

    Attached Files:



  12. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Compute the value ........ $$CollAmtTotal in the Collection of the GROUP/Parent.
     


  13. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    For this....1) I add budget column but value bring by date markup, where i need it should come since beginning of company till date.

    USE --- $$FromValue:mad:@CmpStartDate:$$ToValue:mad:@LastVoucherDate:$yourUDF

    Code:
    $$FromValue:@@CmpStartDate:$$ToValue:@@LastVoucherDate:$yourUDF
     


  14. kapil22

    kapil22 Member


    dear amit ji,
    please elaborate this pls
    trying but no success
     


  15. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    BTW -- a suggestion.... add a variance column and %age column at the END as this seems to be a Budgetary report.
     
    Last edited: May 31, 2021


  16. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Submit your email ID... will send you a sample code with screenshots.
     


  17. kapil22

    kapil22 Member


    my email id is kapilgauri1@gmail.com, kapil@accessassist.org

    amit ji, pls also send the example of "$$FromValue:mad:@CmpStartDate:$$ToValue:mad:@LastVoucherDate:$yourUDF"

    many thanks
     


  18. kapil22

    kapil22 Member


    Dear Amit ji,
    i tried hard but not workout. pls see my code:

    Code:
    [system: formula]
    CodeName: $$StringFindAndReplace:$Name:"-":""
    MemoVCH: $$IsMemo:$VoucherTypeName
    CmpStartDate: $StartingFrom:Company:##SVCurrentCompany
    LVchDate: $LastVoucherDate:Company:##SVCurrentCompany
    CCBAmtStart: $$FromValue:@@CmpStartDate:$$ToValue:@@LastVoucherDate:@@CCAmtPC
    SearchKey: $Name
    CCChildAmt: $$ReportObject:$$CollectionFieldByKey:(If $$IsDr:$CCBAmount Then $CCBAmount Else -$CCBAmount):@@SearchKey:K010CollectionC
    CCParentAmt: $$CollAmtTotal:K010CollectionCParent:$CCBAmount
    CCBothAmt: if ##IsCCBkup then @@CCParentAmt  else @@CCChildAmt
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [#Object: CostCentre]
    CCBParentAmount: $$ReportObject:$$FilterAmtTotal:K010CollectionC:MemoVch:$CCBAmount
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End of Coding
    [Collection: K010Collection]
    Type: CostCentre
    Childof: ##pvCostCentreName
    ParmVar: pvCostCentreName : String : #CostCentreName
    Fetch: MasterID, Name, OpeningBalance, ClosingBalance, Depth
    COMPUTE: CCDepth: $Depth:CostCentre:$Name
    Compute: HasChildren: $$NumChildren>0
    compute: CCAmount: $$NettAmount:$ClosingBalance-$OpeningBalance
    Compute: Alias: $$Alias
    Compute: NumChildren: $$NumChildren
    Compute: CostCentreDepth: $Depth:CostCentre:$Name
    Sort: @@Default: $$Name
    [Collection: K010CollectionVoucher]
    Type: Voucher
    filter: MemoVCH
    fetch: MasterID, VoucherNumber, VoucherTypeName
    [Collection: K010CollectionC]
    Source Collection: K010CollectionVoucher
    Walk: AllLedgerEntries, CostCentreAllocations
    By: Name: $Name:CostCentre:$Name
    compute: CCBAmount: $Amount
    searchkey: $Name
    Keep Source: YES
    [Collection: K010CollectionCParent]
    Type: CostCentre
    Childof: ##pvCostCentreName
    ParmVar: pvCostCentreName : String : #CostCentreName
    belongsto: yes
    compute: CCBAmount: $CCBParentAmount
     


  19. kapil22

    kapil22 Member


    hi Amit Ji,
    i tried hard spend so much time.
    finally got the desired result
    i fetch value by using in collection walk ex attribute.
    just, not capture the Budget Value from Company Start till date.
    pls help little more.
    thanks
    kapil
     


  20. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    [System : Formula]
    MybeginDate : $$FinYearBeg:##SVCurrentDate:$StartingFrom:Company:##SVCurrentCompany
    MyEndDate : $$FinYearBeg:##SVCurrentDate:$StartingFrom:Company:##SVCurrentCompany

    e.g.
    Set As : $$FromValue:mad:@MybeginDate:$$ToValue:mad:@MyEndDate:$OpeningBalance:Ledger:##LedgerName
     


  21. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    If still the above does not work....... Try this method (example)

    [Collection : ColCatMaster]
    Type : Voucher
    Filter: FilterVchAndDate
    ParmVar : SVFromDate : Date : $BooksFrom:Company:##SVCurrentCompany
    ParmVar : SVToDate : Date : $LastVoucherDate:Company:##SVCurrentCompany

    [Collection : ColCatFinal]
    Source Collection :ColCatMaster
    Walk : InventoryEntries
    Format : $NSCategory,15
    Title:"Category"
    Fetch : StockItemName, NSCat
    Compute : NSCategory : $NSCat
     


  22. kapil22

    kapil22 Member


    Thank you so much Amit ji,
    second method works.
    thanks thanks thanks thanks thanks:);):D
     


Share This Page