web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

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

(1) ShareShare
ReportReport
Posted on by 71
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. 
I have the same question (0)
  • PC-25110502-0 Profile Picture
    71 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
    2,349 Super User 2025 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
    89,830 Super User 2025 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
    71 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. 
  • Gerardo Rentería García Profile Picture
    22,524 Most Valuable Professional on at
    Hide 0 Quantity lines in a Word report (Sales Invoice)
  • Suggested answer
    Yi Yong Profile Picture
    2,349 Super User 2025 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,899 Super User 2025 Season 2

#2
Sumit Singh Profile Picture

Sumit Singh 2,444

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,304

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans