How can get party wise sub total after sorting report

Discussion in 'Requests' started by Hems, Sep 10, 2023.

    
  1. Hems

    Hems Member


    Dear sir
    मुझे अपनी रिपोर्ट में partywise sort करने के बाद partywise sub total चाहिए

    मैने ये कोड try किया but नो result IMG_20230910_095126.jpg IMG_20230910_095200.jpg
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    $$subtotal
     


  3. Hems

    Hems Member


    सर
    $$subtotal से मुझे रिजल्ट नही मिला
    लेकिन $$total से मैन टोटल सब जगह आ गई

    Image attached

    Please any solution IMG_20230911_155023.jpg IMG_20230911_155513.jpg
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Jaise main PART mei TOTAL define kiya waise Subtotal wali PART mei bhi define karo ... Sub-Total line mei field name same rakho jo main part mei hai.
     


  5. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Doosra version / tareekaaa -- main LINE mei Bottom line kar ke -- waha sub-total karo.
     


  6. Hems

    Hems Member


    IMG_20230912_224126.jpg Dear sir
    मैंने बहुत प्रयास किया लेकिन सब टोटल नही आई ।
    इसलिए अपने कोड को जरूरत अनुसार short करके post कर रहा हूँ और साथ में इस कोड से प्राप्त रिजल्ट भी ।

    Please sir
    Aap check kare
    Where I m mistake ?
     

    Attached Files:



  7. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    My Hindi communique not too good.... so putting in English

    You can translate in Google..........

    STUDY -- Display ► Statement of Accounts ► Outstandings ► Receivables / Payables ► Press F8 - Ledger-wise Bills

    Study and implement how they have got the sub-total and use it.
     


  8. Hems

    Hems Member



    Sir, thank you very much for your valuable suggestion. Next time I will post in English only.
     


  9. Hems

    Hems Member


    Sir
    As per your suggestion, I searched in developer.
    Option given in outstanding form

    In which pressing F8 opens the GRPLED..... form.
    Then a separate part has been given in it

    Everything is given separately but subtotal is not used anywhere.

    So should I also add a separate form through option?

    please help sir
    Or
    Please suggest any other method by which partywise total can be achieved.
     


  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Code:
    [#Menu:Gateway of Tally]
        Add: Item: My Sale Report: Display: SVR SalesReport
       
    [Report: SVR SalesReport]
       
        Form: SVR SalesReport
    
        Title:"SALES ENTRIES"
        Variable    : SVFromDate,SVToDate, hksort
        Set            : SVFromDate          : $$MonthStart:##SVFromDate
        Set         : SVToDate            : $$MonthEnd:##SVCurrentDate  
    
    [Form: SVR SalesReport]
        Use : DSP Template
        Button:sortreport
        Height:100% Page
        Width:100 % Page
        Background:White
    
        Part:SVR MenuTitlePart, SVR menuDTpart
    
    [Part: SVR MenuTitlePart]
        Line: SVR MenuTitlePart
        Border: thin Top Bottom
        Background: Pale Sea Green
    
        [Line: SVR MenuTitlePart]
        Field: SVR SnoTitle1, SVR DateTitle1, SVR VchNoTitle1,  SVR PartyNameTitle1
        Right Field: SVR AmountTitle1
            Local    :    Field    :    Default    :    Type    :    String
            Local    :    Field    :    Default    :    Style    :    Normal Bold
            Local    :    Field    :    SVR SnoTitle1        :    Set as    : "S.No"
            Local    :    Field    :    SVR DateTitle1        :    Set as    : "Date"
            Local    :    Field    :    SVR VchNoTitle1        :    Set as    : "Vch"
            Local    :    Field    :    SVR VchNoTitle1        :    Color    : "black"
            Local    :    Field    :    SVR PartyNameTitle1    :    Set as    : "PartyName"
            Local    :    Field    :    SVR Amount Title1    :    Set as    : "Amount"
    
    
    [Field: SVR SnoTitle1]
    Use:Number Field
    Width:3% page
    Align:Center
    
    [Field: SVR DateTitle1]
    Use : Short Date Field
    Width:5% page
    Align:Right
    
    [Field: SVR VchNoTitle1]
    Use:Number Field
    Width: 5% page
    Align:Center
    
    [Field: SVR PartyNameTitle1]
    Use: Name Field
    Width: 25% page
    Align:Left
    
    [Field: SVR AmountTitle1]
    Use: Amount Field
    Width: 10% page
    Align: Right
    
    ;*=====Details Recprd-===*/
    [Part:SVR menuDTpart]
            Line            :    SVR MenuDetailsPart
            Border            :    thin Bottom
            Repeat            :    SVR MenuDetailsPart: sort Coll AllSalesVch ;for allsalesvoucher
            Scroll            :    Vertical
            common border    :    yes
            total             :    SVRAmountTitle
           
        [Line: SVR MenuDetailsPart]
        Field: SVR SnoTitle, SVR DateTitle, SVR VchNoTitle,  SVR PartyNameTitle
        Right Field: SVR AmountTitle
        Option: display on enter
    
    Explode:hkspartywisetotal: $$nextObj:$partyledgername!=$partyledgername OR $$IslastObj
    Explode:hkspartywisetotal2: $$IslastObj
    
    [Part:hkspartywisetotal]
        Line: hkspartywisetotal
    
    [Part:hkspartywisetotal2]
        Line: hkspartywisetotal
       
        [Line    :hkspartywisetotal]
            Field: SVR SnoTitle, SVR DateTitle, SVR VchNoTitle,  SVR PartyNameTitle, SVRDummy
            Right Field: SVR AmountTitle
            local : field : SVR AmountTitle : set as : $$FilterAmtTotal:LedgerwiseTotals:TotFltr:$TotalSale
    Local : Field : default : color : blue
    Local : Field : SVR SnoTitle : Set as: ""
    Local : Field : SVR SnoTitle : Type:String
    Local:Field: SVR DateTitle:Set as: ""
    Local:Field: SVR VchNoTitle: Set as: ""
    Local:Field: SVR VchNoTitle: Type:String
    ;Local:Field: SVR PartyNameTitle: Set as: "totalallal"
    Local:Field: SVR PartyNameTitle: Type:String
    Local:Field: SVR PartyNameTitle: Invisible : yes
       
        [Field : SVRDummy]
            Use : SVR PartyNameTitle
            Set As : "TOTAL"
    
    
    [System : Formula]
    TotFltr : #SVRPartyNameTitle = $partyledgername
    
    
    [Field: SVR SnoTitle]
    
    Use:Number Field
    Style:Normal Bold
    Width:3% page
    Align:Center
    Set as:$$Line
    
    [Field: SVR DateTitle]
    
    Use : Short Date Field
    Style:Normal Bold
    Width:5% page
    Align:Right
    Set as:$date
    
    [Field: SVR VchNoTitle]
    
    Use:Number Field
    Style:Normal Bold
    Width: 5% page
    Align:Center
    Set as:$vouchernumber
    
    [Field: SVR PartyNameTitle]
    
    Use: Name Field
    Style: Normal Bold
    Width: 25% page
    Align:Left
    Set as:$partyledgername
    Variable: LedgerName
    Display : Ledger Vouchers
           
    
    [Field: SVR AmountTitle]
    
    Use: Amount Field
    Style:Normal Bold
    Width: 10% page
    Align: Right
    Set as:$Amount
    format :"No Zero,DrCr,Symbol,"
    
    
    /*======-Collection Data=====*/
    
    [Collection: for allsalesvoucher]
           
        Option : Coll AllSalesVch: not ##hksort
        Option:sort Coll AllSalesVch: ##hksort
       
        [!Collection: Coll AllSalesVch]
    
            Type : Vouchers: VoucherType
            Child of : $$VchTypeSales
            Compute : partyledgername : $partyledgername
            Belongs To: Yes
            Fetch:partyledgername, amount, vouchernumber, ledger,*.*
    
        [!Collection:sort Coll AllSalesVch]    
            Use:Coll AllSalesVch
            Sort:@@default:$partyledgername
    
    [Collection: LedgerwiseTotals]
        Source Collection : sort Coll AllSalesVch
        By            : Name                : $PartyLedgerName
        Compute        : Parent            : $Parent
        Compute        : Date                : $Date
        Compute        : PartyLedgerName    : $PartyLedgerName
        Compute        : Amount            : $Amount
    
        Aggr Compute: TotalSale        : Sum    : $Amount
        Search Key    : $PartyLedgerName
    
    [Variable:hksort]
       
        Type        : Logical
        Volatile    : No
    
    [Button:sortreport]
        Title:If ##hksort Then $$LocaleString:"De-Sort Report" Else $$LocaleString:"SORT Report"
        Key: ctrl+x
        Action  : Set : hksort : NOT ##hksort
       
    
    
     


  11. Marina Colors

    Marina Colors Member


    Amit Sir...used in Tally prime...but it keeps on crashing...Don't know what is wrong?....Pls
     


  12. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Code:
    [#Menu:Gateway of Tally]
        Add: Item: My Sale Report: Display: SVR SalesReport
       
    [Report: SVR SalesReport]
       
        Form: SVR SalesReport
    
        Title:"SALES ENTRIES"
        Variable    : SVFromDate,SVToDate, hksort
        Set            : SVFromDate          : $$MonthStart:##SVFromDate
        Set         : SVToDate            : $$MonthEnd:##SVCurrentDate  
    
    [Form: SVR SalesReport]
        Use : DSP Template
        Button:sortreport
        Height:100% Page
        Width:100 % Page
        Background:White
    
        Part:SVR MenuTitlePart, SVR menuDTpart
    
    [Part: SVR MenuTitlePart]
        Line: SVR MenuTitlePart
        Border: thin Top Bottom
        Background: Pale Sea Green
    
        [Line: SVR MenuTitlePart]
        Field: SVR SnoTitle1, SVR DateTitle1, SVR VchNoTitle1,  SVR PartyNameTitle1
        Right Field: SVR AmountTitle1
            Local    :    Field    :    Default    :    Type    :    String
            Local    :    Field    :    Default    :    Style    :    Normal Bold
            Local    :    Field    :    SVR SnoTitle1        :    Set as    : "S.No"
            Local    :    Field    :    SVR DateTitle1        :    Set as    : "Date"
            Local    :    Field    :    SVR VchNoTitle1        :    Set as    : "Vch"
            Local    :    Field    :    SVR VchNoTitle1        :    Color    : "black"
            Local    :    Field    :    SVR PartyNameTitle1    :    Set as    : "PartyName"
            Local    :    Field    :    SVR Amount Title1    :    Set as    : "Amount"
    
    
    [Field: SVR SnoTitle1]
    Use:Number Field
    Width:3% page
    Align:Center
    
    [Field: SVR DateTitle1]
    Use : Short Date Field
    Width:5% page
    Align:Right
    
    [Field: SVR VchNoTitle1]
    Use:Number Field
    Width: 5% page
    Align:Center
    
    [Field: SVR PartyNameTitle1]
    Use: Name Field
    Width: 25% page
    Align:Left
    
    [Field: SVR AmountTitle1]
    Use: Amount Field
    Width: 10% page
    Align: Right
    
    ;*=====Details Recprd-===*/
    [Part:SVR menuDTpart]
            Line            :    SVR MenuDetailsPart
            Border            :    thin Bottom
            Repeat            :    SVR MenuDetailsPart: sort Coll AllSalesVch ;for allsalesvoucher
            Scroll            :    Vertical
            common border    :    yes
            total             :    SVRAmountTitle
           
        [Line: SVR MenuDetailsPart]
        Field: SVR SnoTitle, SVR DateTitle, SVR VchNoTitle,  SVR PartyNameTitle
        Right Field: SVR AmountTitle
        Option: display on enter
    
    Explode:hkspartywisetotal: $$nextObj:$partyledgername!=$partyledgername OR $$IslastObj
    Explode:hkspartywisetotal2: $$IslastObj
    
    [Part:hkspartywisetotal]
        Line: hkspartywisetotal
    
    [Part:hkspartywisetotal2]
        Line: hkspartywisetotal
       
        [Line    :hkspartywisetotal]
            Field: SVR SnoTitle, SVR DateTitle, SVR VchNoTitle,  SVR PartyNameTitle, SVRDummy
            Right Field: SVR AmountTitle
            local : field : SVR AmountTitle : set as : $$FilterAmtTotal:LedgerwiseTotals:TotFltr:$TotalSale
    Local : Field : default : color : blue
    Local : Field : SVR SnoTitle : Set as: ""
    Local : Field : SVR SnoTitle : Type:String
    Local:Field: SVR DateTitle:Set as: ""
    Local:Field: SVR VchNoTitle: Set as: ""
    Local:Field: SVR VchNoTitle: Type:String
    ;Local:Field: SVR PartyNameTitle: Set as: "totalallal"
    Local:Field: SVR PartyNameTitle: Type:String
    Local:Field: SVR PartyNameTitle: Invisible : yes
       
        [Field : SVRDummy]
            Use : SVR PartyNameTitle
            Set As : "TOTAL"
    
    
    [System : Formula]
    TotFltr : #SVRPartyNameTitle = $partyledgername
    
    
    [Field: SVR SnoTitle]
    
    Use:Number Field
    Style:Normal Bold
    Width:3% page
    Align:Center
    Set as:$$Line
    
    [Field: SVR DateTitle]
    
    Use : Short Date Field
    Style:Normal Bold
    Width:5% page
    Align:Right
    Set as:$date
    
    [Field: SVR VchNoTitle]
    
    Use:Number Field
    Style:Normal Bold
    Width: 5% page
    Align:Center
    Set as:$vouchernumber
    
    [Field: SVR PartyNameTitle]
    
    Use: Name Field
    Style: Normal Bold
    Width: 25% page
    Align:Left
    Set as:$partyledgername
    Variable: LedgerName
    Display : Ledger Vouchers
           
    
    [Field: SVR AmountTitle]
    
    Use: Amount Field
    Style:Normal Bold
    Width: 10% page
    Align: Right
    Set as:$Amount
    format :"No Zero,DrCr,Symbol,"
    
    
    /*======-Collection Data=====*/
    
    [Collection: for allsalesvoucher]
           
        Option : Coll AllSalesVch: not ##hksort
        Option:sort Coll AllSalesVch: ##hksort
       
        [!Collection: Coll AllSalesVch]
    
            Type : Vouchers: VoucherType
            Child of : $$VchTypeSales
            Compute : partyledgername : $partyledgername
            Belongs To: Yes
            Fetch:partyledgername, amount, vouchernumber, ledger,*.*
    
        [!Collection:sort Coll AllSalesVch]    
            Use:Coll AllSalesVch
            Sort:@@default:$partyledgername
    
    [Collection: AllSalesVchColl]
            Type : Vouchers: Ledger
            Child of : #SVRPartyNameTitle ;$$VchTypeSales
            Compute : partyledgername : $partyledgername
            Belongs To: Yes
            Fetch:partyledgername, amount, vouchernumber, ledger,*.*
            Filter : VchTypeFilter
    
    [Collection: LedgerwiseTotals]
        Source Collection : AllSalesVchColl
        By            : Name                : $PartyLedgerName
        Compute        : PartyLedgerName    : $PartyLedgerName
        Aggr Compute: TotalSale        : Sum    : $Amount
        Search Key    : $PartyLedgerName
    
    [System : Formulae]
        VchTypeFilter    : $VoucherTypeName = $$VchTypesales
    
    [Variable:hksort]
       
        Type        : Logical
        Volatile    : No
    
    [Button:sortreport]
        Title:If ##hksort Then $$LocaleString:"De-Sort Report" Else $$LocaleString:"SORT Report"
        Key: ctrl+x
        Action  : Set : hksort : NOT ##hksort
       
    
    
     


  13. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Above code working for me in Tally Prime --- why not in your system --- can't say.

    Refer below screenshot ---------

    Capture.PNG
     


  14. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Try using the revised CODE in Post # 12 --------------
     


  15. Himanshu-2002

    Himanshu-2002 Active Member


    I had build the same report but for Sub Total I used a long method (List Variable) Now, I realise that there was a shortcut...faaltu mehnat ho gaya
     


  16. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    ;):):D Not a faltu mehnat --- you learned a new way to get the results.
     


  17. Hems

    Hems Member


    Thank you very much Sir.
    your code is working for me correctly .

    Thank you very much Sir.
    your code is working for me correctly .
    Untitled.png
     


  18. Hems

    Hems Member


    Dear Sir
    IMG_20230920_115418.jpg
    The color formatting
    appearing in the report does not appear in PDF export.

    Line : background color
    Field : background color
    Field : color

    The colorful report that is being displayed How will that same colorful pdf appear in export ?
     


  19. Jenny

    Jenny Active Member


    use PrintFG
     


  20. Hems

    Hems Member


    Thank-you maam
     


  21. Hems

    Hems Member


    Dear Maam

    Print FG
    Print BG

    When used,
    color formatting is visible in PDF export.

    But

    [Report: ...............]
    Variable : SV Print Orientation : string

    [Form:............]
    Set always : SV Print Orientation: "Landscape"

    When using this
    Color formatting is not visible.

    Why ? IMG_20230923_102528.jpg IMG_20230923_102548.jpg
     


  22. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    have u taken the PRINT ??? or just stopped the the preview screen. Take a Print and check
     


  23. Hems

    Hems Member


    Sir
    This is PDF export

    And
    I want colourful pdf export
    In landscape
     


  24. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    [Report: ...............]
    Variable : SVPrintOrientation
    Set : SVPrintOrientation : ""

    [Form:............]
    Set Always : SVPrintOrientation : $$SysName:Landscape

    In your Field -- then use PrintBG and PrintFG

    Capture.PNG
     
    Jenny likes this.


  25. Hems

    Hems Member




    Dear sir
    Thank you for guidance

    I did as you told
    but the color report did not come in Landscape.

    [Report: ...............]
    Variable : SVPrintOrientation
    Set : SVPrintOrientation : ""

    [Form:............]
    Set Always : SVPrintOrientation : $$SysName: landscape


    If I change landscape to portrait
    Then color reports are coming.

    Attached
    1.Code file
    2.both portrait and landscape report in pdf


    Please check sir
    how is this happening ?
     

    Attached Files:



Share This Page