{"title":"PrintOnlyIfDetail Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-printonlyifdetail-property/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-printonlyifdetail-property, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-printonlyifdetail-property","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Specifies whether to print data in a report for the parent data item when the child data item does not generate any output.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":184,"chars":32},{"level":2,"title":"Property Value","slug":"property-value","at":216,"chars":127},{"level":2,"title":"Syntax","slug":"syntax","at":343,"chars":46},{"level":2,"title":"Remarks","slug":"remarks","at":389,"chars":1197},{"level":2,"title":"Example","slug":"example","at":1586,"chars":1483},{"level":2,"title":"Related information","slug":"related-information","at":3069,"chars":85}],"text":"> Version: _Available or changed with runtime version 1.0._\nSpecifies whether to print data in a report for the parent data item when the child data item does not generate any output.\n## Applies to\n Report Data Item\n## Property Value\nTrue if you want print only if the child data item generates output; otherwise, false. The default is false.\n## Syntax\n```al\nPrintOnlyIfDetail = true;\n```\n## Remarks\nThis property has no effect on a data item that does not have any child data items. If this property is false and there is no record in the child data item that corresponds to the current record in the parent data item, then the report prints data from the current record in the parent data item, even though there is no data for the child data item. If this property is true and there is no record in the child data item that corresponds to the current record in the parent data item, then the report does not print data from the current record in the parent data item.\nIf there are more than two data items, then the report iterates through each parent-child relationship in the same way.\nAnother way to achieve the result of not printing blank lines is to add a filter on the table. See ../methods-auto/record/record-setfilter-method.\nIn previous versions of Dynamics 365 Business Central reports, you could control whether data items without data were printed with the use of body sections in Section Designer. After you upgrade reports in Dynamics 365 Business Central, verify whether you need to use filters or the PrintOnlyIfDetail property to achieve the same resulting report.\n## Example\nIn this example, you create a report to print data from the Sales Header and Sales Line tables. The parent data item is Sales Header. For each record in the Sales Header table, the report iterates through records in the Sales Line table.\nThe Sales Header table contains the following data.\nDocument Type|Sell-to Customer No.|No.|...\n-------------|--------------------|---|-\nOrder|38128456|101009|...\nOrder|43687129|101011|...\nOrder|46897889|101013|...\nOrder|46897889|101015|...\nOrder|10000|101016|...\nThe Sales Line table contains the following data.\nDocument Type|Document No.|Line No.|...\n-------------|------------|--------|-\nOrder|101009|10000|...\nOrder|101009|20000|...\nOrder|101013|10000|...\nIn this example, you set the devenv-dataitemlink-reports-property to \"Document Type=FIELD(Document Type),Document No.=FIELD(No.)\". If you set PrintOnlyIfDetail to true, then the report outputs the following data.\nDocument Type|Customer No.|Document No.|Line No.|...\n-------------|------------|------------|--------|-\nOrder|38128456|101009|10000|...\nOrder|38128456|101009|20000|...\nOrder|46897889|101013|10000|...\nIf you set PrintOnlyIfDetail to false, then the report outputs the following data.\nDocument Type|Customer No.|Document No.|Line No.|...\n-------------|------------|------------|--------|-\nOrder|38128456|101009|10000|...\nOrder|38128456|101009|20000|...\nOrder|43687129|101011||...\nOrder|46897889|101013|10000|...\nOrder|46897889|101015||...\nOrder|10000|101016||...\n## Related information\n../methods-auto/report/reportinstance-printonlyifdetail-method"}