Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Hide 0 Quantity lines in a Word report (Sales Invoice)

(3) ShareShare
ReportReport
Posted on by 32
Hi, 
 
I am having an issue trying to hide any lines in a bespoke Sales Invoice Word report (Done by another partner & was copied from the standard Sales Invoice) that have a quantity of 0. Is this possible in Word reports?
 
I know it is straightforward to do for RDLCs.
 
I also know there is a boolean option on the request page, ideally we want this to default to true but I am unable to modify this property via the report extension for this bespoke report as they don't have this variable as protected. 
 
 
Any suggestions to resolve either would be appreciated. 
 
Thanks. 
  • PC-25110502-0 Profile Picture
    PC-25110502-0 32 on at
    Hide 0 Quantity lines in a Word report (Sales Invoice)
    Zhu,
     
    Thanks for responding! The customer was using a bespoke report that was copied from the original but they didn't make that var protected so I couldn't modify. They also didn't want to have to tick the var every time.
     
    Yi, your new suggestion worked :)
     
    Thanks to everyone who replied, appreciate it!
  • Verified answer
    Yi Yong Profile Picture
    Yi Yong 1,704 Super User 2024 Season 2 on at
    Hide 0 Quantity lines in a Word report (Sales Invoice)
    Hello,
     
    Thanks for further clarifying the request.
     
    You can try this, I only did one sampling test and I have show the result below.
     
    reportextension 50001 MyExtension extends "DOP Standard Sales - Invoice"
    {
        dataset
        {
            modify(Line)
            {
                trigger OnAfterPreDataItem()
                begin
                    SetFilter(Quantity, '>0');
                end;
            }
        }
    }
    What I did was force filtering the posted sales invoice lines dataset with quantity more than 0.
     
    Original
     
    After Code Change
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 76,221 Super User 2024 Season 2 on at
    Hide 0 Quantity lines in a Word report (Sales Invoice)
    Hi, As far as I know, this is a standard feature in Business Central 2024 wave 2 (BC25)
    A simple test:
     
    Thanks.
    ZHU
  • PC-25110502-0 Profile Picture
    PC-25110502-0 32 on at
    Hide 0 Quantity lines in a Word report (Sales Invoice)
    Thank Yi Yong for the reply, I have updated the post now as my previous description of the situation wasn't accurate. Apologies on that.
     
    The pre report trigger won't work for this as the partner who done this report didn't make that var protected so I am unable to access it via a report extension. 
  • gdrenteria Profile Picture
    gdrenteria 13,278 Most Valuable Professional on at
    Hide 0 Quantity lines in a Word report (Sales Invoice)
  • Suggested answer
    Yi Yong Profile Picture
    Yi Yong 1,704 Super User 2024 Season 2 on at
    Hide 0 Quantity lines in a Word report (Sales Invoice)
    Hello,
     
    You can use reportext to set the boolean to true.
     
    reportextension 50001 MyExtension extends "Standard Sales - Invoice"
    {
        trigger OnPreReport()
        begin
            HideLinesWithZeroQuantity := true;
        end;
    }
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,904 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,605 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans