Save manual as PDF or print  


NVXGRL General Report Library


This app contains various functionalities that can be helpful in report development.

Current Version: 1.0.4.0 as of Business Central 18.

Manual


Creation date: 2024/11/22
The current version of this manual can be found at:

https://www.navax.app/help.php?AppID=NVXGRL&L=en


☰ Contents



General

  • App General Report Library
    The App General Report Library contains reusable functions that are constantly required when creating reports...

Libraries

  • Format Address
  • General Report Library
  • Purchase Report Library
    The codeunit contains general purpose functions in the Purchase object area...
  • Sales Report Library
    The codeunit contains general purpose functions in the Sales object area...
  • RDLC Layout Library
    The codeunit contains general purpose functions on the RDLC side...
  • General Caption Enum Library
    The Enum contains general purpose captions...

Appendix

  • Release Notes

Docs  /  NVXGRL General Report Library  /  General
General

The App General Report Library contains reusable functions that are constantly required when creating reports. The functions are available in different libraries, divided according to areas.

Docs  /  NVXGRL General Report Library  /  Libraries
Format Address [GRLFormatAddressNVX]

Provides the complete and extensive functionality as the standard 365 "Format Address" codeunit only the order of data formatting is different: Name Name2 Address 2 Address The fields Post Code, City, County, Country and printing the contact name are treated as in the standard codeunit. e.g: Country."Address Format" is used after standard sorting/formatting-> "Post Code+City", "City+County+Post Code", "City+Post Code", "Blank Line+Post Code+City" Country."Contact Address Format" is used after the standard sorting/formatting -> First, Last, After Company Name This format address management offers the possibility of dynamically changing or setting up the order listed above - if necessary in the future with a separate function or with a separate event.

Docs  /  NVXGRL General Report Library  /  Libraries
General Report Library [GRLGeneralReportLibraryNVX]

The codeunit contains general purpose functions

General functions

Procedure nameDescription
GetCompanyName(var CompanyInformation: Record "Company Information"): Text Chains the company information together with a fixed comma.
GetUserInfo(var SystemCreatedByGuid: Guid; var UserName: Text; var UserTelephone: Text; var UserEmail: Text) The function uses the standard SystemCreatedBy field to provide the user information. Full name -> comes from user table Telephone number and email address -> come from the user setup table.
SetTotalLabels(var TotalInclVATText: Text; var TotalExclVATText: Text; CurrencyCode: Code[10]) Returns the predefined VAT headings. Incl VAT label 'Total %1 large', 'Total amount %1 net' Excl VAT label 'Total %1 net' , 'Total amount %1 gross' The SetTotalLabels() function in the standard "Format Document" codeunit was used as a basis.
GetTotalInclVATLabelsWithCurrencyCode(TotalInclVATText: Text; CurrencyCode: Code[10]): Text Completes and returns a custom amount label with the currency code. If the currency code is empty, the "LCY Code" of the general ledger setup is used. The label should contain the "...%1" percentage value. e.g.: TotalInclVATText -> "Total %1" or "Total including VAT %1" etc.
GetTotalExclVATLabelsWithCurrencyCode(TotalExclVATText: Text; CurrencyCode: Code[10]): Text Completes and returns a custom net amount label with the currency code. If the currency code is empty, the "LCY Code" of the general ledger setup is used. The label should contain the "...%1" percentage value. e.g.: TotalExclVATText -> "Net amount %1" or "Net total %1" etc.
SetSalesPersonPurchaser(var SalespersonPurchaser: Record "Salesperson/Purchaser"; SalesPersonPurchaseCode: Code[20]) Returns the "Salesperson/Purchaser" record.
SetPaymentTerms(var PaymentTerms: Record "Payment Terms"; PaymentTermsCode: Code[10]; LanguageCode: Code[10]) Returns the "Payment Terms" record.
SetPaymentMethod(var PaymentMethod: Record "Payment Method"; PaymentMethodCode: Code[10]; LanguageCode: Code[10]) Returns the "Payment Method" record.
SetShipmentMethod(var ShipmentMethod: Record "Shipment Method"; ShipmentMethodCode: Code[10]; LanguageCode: Code[10]) Returns the "Shipment Method" record.
SetShippingAgentAndService( var ShippingAgent: Record "Shipping Agent"; ShippingAgentCode: Code[10]; var ShippingAgentService: Record "Shipping Agent Services"; ShippingAgentServiceCode: Code[10]) Returns the following records in one command: Delivery person, delivery person mode of transport Shipping Agent, Shipping Agent Services
SetPaymentShipmentSalesPersonDocumentDetails( var PaymentTerms: Record "Payment Terms"; PaymentTermsCode: Code[10]; var PaymentMethod: Record "Payment Method"; PaymentMethodCode: Code[10]; var ShipmentMethod: Record "Shipment Method"; ShipmentMethodCode: Code[10]; var SalespersonPurchaser: Record "Salesperson/Purchaser"; SalesPersonPurchaseCode: Code[20]; LanguageCode: Code[10]) Returns the following records in one function call: Payment Terms , Payment Method, Shipment Method, Salesperson/Purchaser
GetContactEmailPhone(ContactNo: Code[20]) Result: Text Returns the contact's email address and phone number. The separator is a slash.
GetContactEmail(ContactNo: Code[20]) Result: Text Returns the email address of the contact.
GetContactPhoneContact(ContactNo: Code[20]) Result: Text The function returns the phone number of the contact.
GetFullCompanyName: Text The function returns the Name1 + Name2 of the CompanyInformation table.
GetCompanyTelephone: Text The function returns the phone number from the CompanyInformation table. Format = Phone Caption with colon + phone number
GetCompanyFax: Text The function returns the fax number from the CompanyInformation table. Format = Fax Caption with colon + fax number
GetCompanyEmail: Text The function returns the email address of the CompanyInformation table. Format = email caption with colon + email address
GetShortcutDimension1to8ValueName(ShortcutDimensionNo:Integer; DimSetID: Integer): Text The function returns the selected dimension value of the dimension entry. ShortcutDimensionNo = "Shortcut Dimension 1 Code".."Shortcut Dimension 8 Code" from GeneralLedgerSetup
GetNextPositionNumber(LineType: Integer; LineTypeNo: Code[20]; var PosNo: Integer; var IsHidePosNo: Boolean) The function returns the next position number of the document line. With the IsHidePosNo variable you can set dynamically the position value in the layout (show or hide).
GetCompanyPostCodeCityCountryName(): Text The function returns the post code, city and country name from the CompanyInformation. Format = "PostCode City / CountryName"
GetCompanyNameAddressPostCodeCity(): Text The function returns the full company name - with slash - from the CompanyInformation. Format = "Name / Address / PostCode City / CountryName"
GetCompanyPostCodeCity(): Text The function returns the post code and city from the CompanyInformation. Format = "PostCode City"
GetFullCompanyAddressWithPipeSeparator(): Text The function returns the company address from the CompanyInformation. Format = "Address | PostCode City | CountryName"
SetCurrencyCode(var CurrencyCode: Code[10]; DefaultCurrencyCode: Code[10]) Returns the currency code as a var parameter. DefaultCurrencyCode can also be empty or filled from the report header (with the "Currency Code").
    
    add("Purchase Header")
    {
        column(CurrencyCode; CurrencyCode) { }
    }
    modify("Purchase Header")
    {
        trigger OnAfterAfterGetRecord()
        begin
            GeneralReportLibrary.SetCurrencyCode(CurrencyCode, "Purchase Header"."Currency Code");
        end;
    }
    
GetTrackingSpecification(RecordVariant: Variant; var TempTrackingSpecBuffer: Record "Tracking Specification" temporary; var TrackingSpecCount: Integer) The function collects and returns the item tracking datalines in the TempTrackingSpecBuffer variable. RecordVariant currently recognizes the following objects: "Sales Header", "Return Shipment Header", "Purchase Header", "Sales Invoice Header", "Sales Cr.Memo Header", "Sales Shipment Header" For "Return Shipment Header": the function RetrieveTrackingReturnShipment() must be built into an EventHook and executed it. Initialization:
    
    modify(Header)
    {
        trigger OnAfterAfterGetRecord()
        begin
            GeneralReportLibrary.GetTrackingSpecification(Header, TempTrackingSpecBuffer, TrackingSpecCount1);
        end;
    }

    
Processing and preparation for the RDLC layout:
    
    addbefore(AssemblyLine)
    {
        dataitem(HBRItemTrackingLine; "Integer")
        {
            DataItemTableView = SORTING(Number);

            column(TrackingSpecBufferLotNo; TempTrackingSpecBuffer."Lot No.") { }
            column(TrackingSpecBufferSerNo; TempTrackingSpecBuffer."Serial No.") { }
            column(TrackingSpecBufferQty; TempTrackingSpecBuffer."Quantity (Base)") { }
            column(TrackingSpecBufferUnitOfMeasure; TempTrackingSpecBuffer."Qty. per Unit of Measure") { }

            trigger OnPreDataItem()
            begin
                if TrackingSpecCount1 = 0 then
                    CurrReport.Break();

                TempTrackingSpecBuffer.SetCurrentKey("Source ID", "Source Type", "Source Subtype", "Source Batch Name", "Source Prod. Order Line", "Source Ref. No.");

                TempTrackingSpecBuffer.SetRange("Source Ref. No.", Line."Line No.");
                SetRange(Number, 1, TempTrackingSpecBuffer.Count());
            end;

            trigger OnAfterGetRecord()
            begin
                if Number = 1 then
                    TempTrackingSpecBuffer.FindSet()
                else
                    TempTrackingSpecBuffer.Next();
            end;
        }
    }
    
RetrieveTrackingReturnShipment(var TempTrackingSpecBuffer: Record "Tracking Specification" temporary; SourceID: Code[20]; var Found: Boolean) The procedure extends the "Item Tracking Doc. Management" codeunit and helps in collecting the item tracking lines. If this function is executed in the hook, the GetTrackingSpecification() function finds the associated "Return Shipment Header" item tracking lines.
    
    codeunit 50000 "AppEventHooksNVX"
    {
        var
            GeneralReportLibrary: Codeunit GRLGeneralReportLibraryNVX;

        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Tracking Doc. Management", 'OnRetrieveDocumentItemTracking', '', true, true)]
        local procedure "ItemTrackingDocManagement_OnRetrieveDocumentItemTracking"
        (
            var TempTrackingSpecBuffer: Record "Tracking Specification";
            SourceID: Code[20];
            var Found: Boolean;
            SourceType: Integer;
            SourceSubType: Option;
            RetrieveAsmItemTracking: Boolean
        )
        begin
            case SourceType of
                Database::"Return Shipment Header":
                    GeneralReportLibrary.RetrieveTrackingReturnShipment(TempTrackingSpecBuffer, SourceID, Found);
            end;
        end;
    }
    
IsArrayDifferentCompareArray1: array[8] of Text[100]; CompareArray2: array[8] of Text[100]) Result: Boolean The function compares two array variables.
GetSalesPerson(var SalesPerson: Record "Salesperson/Purchaser"; SalespersonCode: Code[20]) Returns the record of the "Salesperson/Purchaser" table.
PrintReportToLocalOrNetworkPrinterWithCommit(ReportId: Integer; RecIdToPrint: RecordId) In BC it is not possible (in a web client session) to print reports to an installed local or network printer. This is already possible via the job queue. The function does nothing other than print the report on the printer set up in the printer selection.
    
    report 50000 "WarehouseRegisterNVX"
    {
        Caption = 'Warehouse Register', comment = 'DEU="Lagerplatzjournal"';
        DefaultLayout = RDLC;
        RDLCLayout = './src/layout/WarehouseRegisterNVX.rdlc';
        UsageCategory = Documents;

        dataset
        {
            dataitem(Header; "Warehouse Register")
            {
                DataItemTableView = sorting("No.");
                RequestFilterFields = "No.";
            ...

            }
        ...

        }

        trigger OnPostReport()
        var
            GeneralReportLibrary: Codeunit GRLGeneralReportLibraryNVX;
        begin
            if not CurrReport.Preview then
                GeneralReportLibrary.PrintReportToLocalOrNetworkPrinterWithCommit(Report::WarehouseRegisterNVX, Header.RecordId);
        end;
    }
    
ResetTotalValues(var TotalSubTotal: Decimal; var TotalInvDiscAmount: Decimal; var TotalAmount: Decimal; var TotalAmountVAT: Decimal; var TotalAmountInclVAT: Decimal) Resets the total block values of the posted invoice layout. Indiv. Total functionality for the invoice. The procedure is related to the CalculateTotalValues() function.
ResetTotalValues(var TotalWeight: Decimal; var TotalAmount: Decimal; var TotalAmountVAT: Decimal; var TotalAmountInclVAT: Decimal) Resets the total block values of the proforma invoice. Indiv. Total functionality for the proforma invoice. The procedure is related to the CalculateTotalValuesSalesProFormaInvoice() function.
CalculateTotalValues(var SalesInvoiceLine: Record "Sales Invoice Line"; var TotalSubTotal: Decimal; var TotalInvDiscAmount: Decimal; var TotalAmount: Decimal; var TotalAmountVAT: Decimal; var TotalAmountInclVAT: Decimal) Sums up the total block values of the posted invoice layout. Indiv. Total functionality for the invoice. The procedure is related to the ResetTotalValues() function.
CalculateTotalValuesSalesProFormaInvoice(var SalesLine: Record "Sales Line"; var TotalWeight: Decimal; var TotalAmount: Decimal; var TotalAmountVAT: Decimal; var TotalAmountInclVAT: Decimal) Adds the total block values of the proforma invoice together. Indiv. Total functionality for the proforma invoice. The procedure is related to the associated ResetTotalValues() function.
GetItemLederEntryNoFilter(DocumentNo: Code[20]; DocumentType: Enum "Item Ledger Document Type"; DocumentLineNo: Integer) Result: Text The function returns a filter string of the table ItemLedgerEntry."Entry No.". Example return value = "1|25|302|..."
GetCommaSeparatedAddressArray(AddressArray: array[8] of Text[100]; Number: Code[20]): Text Lists the address array values one after the other - with a comma separator. Format = "Array[1], Array[2], Array[3], Array[4], etc." If the "Number" parameter is filled, the formatting changes and the address information is listed in brackets. Format = "Number (Array[1], Array[2], Array[3], Array[4], etc.)"
    
        add(Header)
        {
            column(CommaSeparatedSellToAddress; GeneralReportLibrary.GetCommaSeparatedAddressArray(AddressArray, Header."Sell-to Customer No.")) { }
        }

        var
            GeneralReportLibrary: Codeunit GRLGeneralReportLibraryNVX;
    
GetCountryRegionDescription(CountryRegionCode: Code[10]): Text The function returns the full name of the country. When fetching the data, the client language [Language.GetUserLanguageCode()] is will be taken.

Formatting functions - Converting to text

Procedure nameDescription
FormatDateToTextDay2Month2Year4(InputDate: Date): Text The function converts the input date to the DD.MM.YYYY format.
        
        reportextension 50000 "StandardSalesInvoiceExtNVX" extends "Standard Sales - Invoice"
        {
            RDLCLayout = './src/layout/StandardSalesInvoiceNVX.rdlc';
            dataset
            {
                add(Line)
                {
                    column(ShipmentDateCptn; GeneralReportLibrary.GetCaption(Enum::SFBCaptionLibraryNVX::ShipmentDate_Copy1)) { }
                    column(ShipmentDate; GeneralReportLibrary.FormatDateToTextDay2Month2Year4("Shipment Date")) { }
                }
            }

            var
                GeneralReportLibrary: Codeunit GRLGeneralReportLibraryNVX;
        }
        
        
FormatDateToTextDay2Month2Year2(InputDate: Date): Text The function converts the input date to the DD.MM.YY format.
FormatDateToDayMonthTextYear4(InputDate: Date): Text The function converts the input date to the DD.MonthText YYYY format.
FormatDateToXMLFormat(InputDate: Date): Text The function converts the input date to the YYYY-MM-DD format.
FormatDecimalToAmountFormat(DecimalValue: Decimal; AutoFormatExpr: Text[80]) Result: Text The function converts the decimal value to the standard AmountFormat.
    
    report 321 "Vendor - Balance to Date"
    {
        DefaultLayout = RDLC;
        ...

        column(Amt; Format(Amt, 0, AutoFormat.ResolveAutoFormat("Auto Format"::AmountFormat, CurrencyCode))) { }
        column(CurrencyCode1; CurrencyCode) { }
        ...

        trigger OnAfterGetRecord()
        begin
            ...
            if PrintAmountInLCY then begin
                Amt := "Amount (LCY)";
                CurrencyCode := '';
            end else begin
                Amt := Amount;
                CurrencyCode := "Currency Code";
            end;
            if Amt = 0 then
                CurrReport.Skip();
        end;
        ...
    }
    
FormatLineDiscountStdandardFormatWithPercent(LineDiscountPercent: Decimal; IsShowMinus: Boolean): Text The function converts the decimal value to text format - with a percent sign at the end. If the "IsShowMinus" parameter is true, the minus sign is added to the return value.
ExampleResult
FormatLineDiscountStdandardFormatWithPercent(85,false)85 %
FormatLineDiscountStdandardFormatWithPercent(76.4,false)76,4 %
FormatLineDiscountStdandardFormatWithPercent(32.456,false)32,46 %
FormatLineDiscountStdandardFormatWithPercent(45.32,true)- 45,32 %

General Caption Library

The General Caption Library consists of different enum values that return Captions for Reports.

Procedure nameDescription
GetCaption(Caption: Enum GRLGeneralCaptionLibraryNVX): Text[250] The function returns the captions as text for the Enum value.
GetCaption(Caption: Enum GRLGeneralCaptionLibraryNVX; isGetCaptionWithColon: Boolean): Text[250] The function returns the caption as text for the Enum that is given as a parameter. If the "isGetCaptionWithColon" parameter is true, the return value is returned with a colon.

Updated and expanded DSS functionality

CrLf(): Text[10] Returns the CR and LC characters.
Chr(Character: Char): Text Returns a character in text format.
AddValueToArray(var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]; var i: Integer; Delimiter: Integer; Caption: Text; TextValue: Text) AddValueToArray() function from the DSS documents.
GetDocumentFooter(var CompanyInfoArr1: array[8] of Text[250]; var CompanyInfoArr2: array[8] of Text[250]; var CompanyInfoArr3: array[8] of Text[250]; CompanyAddress: array[8] of Text[250]; CompanyInformation: Record "Company Information"; IsFooterPictureHasValue: Boolean) Fills and returns the "CompanyInfoArray1", "CompanyInfoArray2" and "CompanyInfoArray3" arrays.
CollectDataFooter(var DataFooter: Text; CompanyInfoArr1: array[8] of Text[250]; CompanyInfoArr2: array[8] of Text[250]; CompanyInfoArr3: array[8] of Text[250]) Fills and returns the "DataFooter" array.
AppendDataValueText(var DataValueText: Text; NextValue: Text) Adds a new value (as the next line) to "DataValueText".
GetCompanyAddress(RespCenterCode: Code[10]; var ResponsibilityCenter: Record "Responsibility Center"; var CompanyInformation: Record "Company Information"; var CompanyAddress: array[8] of Text[100]) Returns the "Responsibility Center" and the "CompanyAddress" array.
GetDataFooter(var DataFooter: Text; var CompanyInformation: Record "Company Information"; RespCenterCode: Code[10]; IsFooterPictureHasValue: Boolean) Fills and returns the DataFooter text in RDLC layout format. On the RDLC side: Code.GLRSetDataFooter(Fields!DataFooter.Value, 1) Code.GLRGetDataFooter(1,1), Code.GLRGetDataFooter(2,1) ect.

Using the "Name/Value Buffer" solution

This functionality provides a dynamic solution to populate the header data. Here you have the option of defining and filling in several info blocks. The representation of the filled values on the RDLC side is possible with Tablix object.

Precedure nameDescription
PrepareNameValueBuffer(var NameValueBuffer: Record "Name/Value Buffer" temporary) Deletes or initializes the temporary buffer table.
AppendNameValueBuffer(var NameValueBuffer: Record "Name/Value Buffer" temporary; Name: Text; Value: Text; NameFontWeight: Enum GRLFontWeightNVX; ValueFontWeight: Enum GRLFontWeightNVX) Adds a new record to the "NameValueBuffer" record.
GetDefaultFontWeight() FontWeight: Enum GRLFontWeightNVX Returns the option FontWeight::Default
GetNormalFontWeight() FontWeight: Enum GRLFontWeightNVX Returns the option FontWeight::Normal
GetLightFontWeight() FontWeight: Enum GRLFontWeightNVX Returns the option FontWeight::Light
GetBoldFontWeight() FontWeight: Enum GRLFontWeightNVX Returns the option FontWeight::Bold
1. Definition of the associated "Name/Value Buffer" DataItems. With the columns *HeaderNameFontWeight and *HeaderValueFontWeight it is possible to define the FontWeight list in the Visual Studio Properties.
addafter("Header DataItem")
{
    dataitem(LeftHeader; "Name/Value Buffer")
    {
        DataItemTableView = SORTING(ID);
        UseTemporary = true;
        column(LeftHeaderName; Name) { }
        column(LeftHeaderValue; Value) { }
        column(LeftHeaderNameFontWeight; format(GRLNameFontWeightNVX)) { }
        column(LeftHeaderValueFontWeight; format(GRLValueFontWeightNVX)) { }
    }

    dataitem(RightHeader; "Name/Value Buffer")
    {
        DataItemTableView = SORTING(ID);
        UseTemporary = true;
        column(RightHeaderName; Name) { }
        column(RightHeaderValue; Value) { }
        column(RightHeaderNameFontWeight; format(GRLNameFontWeightNVX)) { }
        column(RightHeaderValueFontWeight; format(GRLValueFontWeightNVX)) { }
    }
}
2. Own function in the report for filling the buffer table:
var
    GeneralReportLibrary: Codeunit GRLGeneralReportLibraryNVX;
...

local procedure FillLeftHeader(var LeftHeader: Record "Name/Value Buffer" temporary; var Header: Record "Sales Invoice Header")
begin
    GeneralReportLibrary.PrepareNameValueBuffer(NameValueBuffer);

    GeneralReportLibrary.AppendNameValueBuffer(
        LeftHeader, Header.FieldCaption("Bill-to Customer No."), Header."Bill-to Customer No.", 
        GeneralReportLibrary.GetBoldFontWeight(), GeneralReportLibrary.GetBoldFontWeight());

    GeneralReportLibrary.AppendNameValueBuffer(
        LeftHeader, Header.FieldCaption("External Document No."), Header."External Document No.", 
        GeneralReportLibrary.GetDefaultFontWeight(), GeneralReportLibrary.GetDefaultFontWeight());

    GeneralReportLibrary.AppendNameValueBuffer(
        LeftHeader, Header.GetCustomerVATRegistrationNumberLbl(), Header.GetCustomerVATRegistrationNumber(), 
        GeneralReportLibrary.GetDefaultFontWeight(), GeneralReportLibrary.GetDefaultFontWeight());

    GeneralReportLibrary.AppendNameValueBuffer(
        LeftHeader, InvNoLbl, Header."No.", 
        GeneralReportLibrary.GetDefaultFontWeight(), GeneralReportLibrary.GetDefaultFontWeight());

    GeneralReportLibrary.AppendNameValueBuffer(
        LeftHeader, Header.FieldCaption("Order No."), Header."Order No.", 
        GeneralReportLibrary.GetDefaultFontWeight(), GeneralReportLibrary.GetDefaultFontWeight());

    GeneralReportLibrary.AppendNameValueBuffer(
        LeftHeader, Header.FieldCaption("Posting Date"), GeneralReportLibrary.FormatDateToTextDay2Month2Year4(Header."Posting Date"), 
        GeneralReportLibrary.GetDefaultFontWeight(), GeneralReportLibrary.GetDefaultFontWeight());

    GeneralReportLibrary.AppendNameValueBuffer(LeftHeader, Header.FieldCaption("Document Date"), GeneralReportLibrary.FormatDateToTextDay2Month2Year4(Header."Document Date"), GeneralReportLibrary.GetDefaultFontWeight(), GeneralReportLibrary.GetDefaultFontWeight());
    GeneralReportLibrary.AppendNameValueBuffer(LeftHeader, Header.FieldCaption("Due Date"), GeneralReportLibrary.FormatDateToTextDay2Month2Year4(Header."Due Date"), GeneralReportLibrary.GetDefaultFontWeight(), GeneralReportLibrary.GetDefaultFontWeight());
    GeneralReportLibrary.AppendNameValueBuffer(LeftHeader, PaymentTermsDescLbl, PaymentTerms.Description, GeneralReportLibrary.GetDefaultFontWeight(), GeneralReportLibrary.GetDefaultFontWeight());
    GeneralReportLibrary.AppendNameValueBuffer(LeftHeader, PaymentMethodDescLbl, PaymentMethod.Description, GeneralReportLibrary.GetDefaultFontWeight(), GeneralReportLibrary.GetDefaultFontWeight());

    ...
end;
3. Function call on the OnAfterGetRecord() trigger:
modify(Header)
{
	trigger OnAfterAfterGetRecord()
	begin
		FillLeftHeader(LeftHeader, Header);
		FillRightHeader(RightHeader, Header);

        ...
	end;
}
4. Using it in the RDLC layout:

Docs  /  NVXGRL General Report Library  /  Libraries
Purchase Report Library [GRLPurchaseReportLibraryNVX]

The codeunit contains general purpose functions in the Purchase object area. [Purchase Header, Purchase Line, etc.]

Procedure nameDescription
InitDocumentArray(var PurchaseHeader: Record "Purchase Header"; var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]) Returns the HeaderInfoArrCaption and HeaderInfoArrValue arrays of the Purchase Header table. Old DSS functionality
InitDocumentArray(var PurchaseCrMemoHeader: Record "Purch. Cr. Memo Hdr."; var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]) Returns the HeaderInfoArrCaption and HeaderInfoArrValue arrays for the Purchase Cr.Memo Header table. the old DSS functionality

PublisherParameter
OnAfterElseInInitDocumentArray (var PurchaseHeader: Record "Purchase Header"; var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]; var i: Integer; Delimiter: Integer)
OnBeforeSetSalesPersonPurchaserInInitDocumentArray (var PurchaseHeader: Record "Purchase Header"; var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]; var i: Integer; var Delimiter: Integer; var IsHandled: Boolean)
OnAfterOnInitDocumentArray (var PurchaseHeader: Record "Purchase Header"; var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]; var i: Integer; Delimiter: Integer)
OnBeforeSetSalesPersonPurchaserInInitDocumentArrayCrMemo/td> (var PurchaseCrMemoHeader: Record "Purch. Cr. Memo Hdr."; var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]; var i: Integer; var Delimiter: Integer; var IsHandled: Boolean)<
OnAfterOnInitDocumentArrayCrMemo (var PurchaseCrMemoHeader: Record "Purch. Cr. Memo Hdr."; var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]; var i: Integer; var Delimiter: Integer)

Docs  /  NVXGRL General Report Library  /  Libraries
Sales Report Library [GRLSalesReportLibraryNVX]

The codeunit contains general purpose functions in the Sales object area. [Sales Header, Sales Line, etc.]

Procedure nameDescription
InitDocumentArraySalesOrder(var SalesHeader: Record "Sales Header"; var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]) Returns the HeaderInfoArrCaption and HeaderInfoArrValue arrays for the Sales Header - Document Type::Order table. Applies to "Order Confirmation" and "Proforma Invoice" Old DSS functionality
InitDocumentArraySalesQuote(var SalesHeader: Record "Sales Header"; var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]) Returns the HeaderInfoArrCaption and HeaderInfoArrValue arrays of the Sales Header table - Document Type::Quote. Old DSS functionality
SalesHeaderShipTo(var ShipToAddr: array[8] of Text[100]; SalesHeader: Record "Sales Header") Returns the ShipToAddress array from the standard FormatAddress codeunit.
CalcInvDiscountAmountPercent(var SalesHeader: Record "Sales Header") Result: Text The function returns the entire invoice discount amount of the sales document. The value is converted using the function GeneralReportLibrary.FormatLineDiscountStdandardFormatWithPercent(). Area: "Sales Header".
CalcInvDiscountAmountPercent(var SalesInvoiceHeader: Record "Sales Invoice Header") Result: Text The function returns the entire invoice discount amount of the sales document. The value is converted using the function GeneralReportLibrary.FormatLineDiscountStdandardFormatWithPercent(). Area: "Sales Invoice Header".
GetTariffNo(SalesInvoiceLine: Record "Sales Invoice Line") Result: Text The function returns the full description of the Tariff Number table. Format = "Tariff Number: + Description"
GetCommaSeparatedSellToAddress(SalesShipmentHeader: Record "Sales Shipment Header"; Number: Code[20]) AddressText: Text Lists the following Sell-to values one after the other - with a comma separator. Format = ""Sell-to Customer Name", "Sell-to Customer Name 2", "Sell-to City", "Sell-to Country/Region Description" Similar to the function GeneralReportLibrary.GetCommaSeparatedAddressArray(). Area: "Sales Shipment Header"
GetCommaSeparatedSellToAddress(SalesInvoiceHeader: Record "Sales Invoice Header"; Number: Code[20]) AddressText: Text Lists the following Sell-to values one after the other - with a comma separator. Format = ""Sell-to Customer Name", "Sell-to Customer Name 2", "Sell-to City", "Sell-to Country/Region Description" Similar to the function GeneralReportLibrary.GetCommaSeparatedAddressArray(). Area: "Sales Invoice Header"
GetCommaSeparatedSellToAddress(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; Number: Code[20]) AddressText: Text Lists the following Sell-to values one after the other - with a comma separator. Format = ""Sell-to Customer Name", "Sell-to Customer Name 2", "Sell-to City", "Sell-to Country/Region Description" Similar to the function GeneralReportLibrary.GetCommaSeparatedAddressArray(). Area: "Sales Cr.Memo Header"
SaveClearContactName(var ContactName: text[100]; var SavedContactName: Text) The function saves and resets the ContactName variable.
    
        modify(Header)
        {
            trigger OnAfterAfterGetRecord()
            begin
                GeneralReportLibrary.SaveClearContactName(Header."Bill-to Contact", SavedContactName);
                FormatAddress.SalesInvBillTo(CustAddr, Header);     //print bill-to address without Contact Name
                GeneralReportLibrary.RewriteClearSavedContactName(Header."Bill-to Contact", SavedContactName);

                ...
                // it's possible to print/manipulating the field "Bill-to Contact" in the code or layout later
            end;
        }
        var
            GeneralReportLibrary: Codeunit GRLGeneralReportLibraryNVX;
            FormatAddress: Codeunit "Format Address";
            SavedContactName: Text;
    
RewriteClearSavedContactName(var ContactName: text[100]; var SavedContactName: Text) The function writes back the previously saved "SavedContactName" value into the ContactName variable.

Integration Events

PublisherParameter
OnBeforeSetSalesPersonPurchaserInInitDocumentArraySalesOrder (var SalesHeader: Record "Sales Header"; var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]; var i: Integer; var Delimiter: Integer; var IsHandled: Boolean)
OnAfterInInitDocumentArraySalesOrder (var SalesHeader: Record "Sales Header"; var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]; var i: Integer; var Delimiter: Integer)
OnBeforeSetSalesPersonPurchaserInInitDocumentArraySalesQuote (var SalesHeader: Record "Sales Header"; var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]; var i: Integer; var Delimiter: Integer; var IsHandled: Boolean)
OnAfterInInitDocumentArraySalesQuote (var SalesHeader: Record "Sales Header"; var HeaderInfoArrCaption: array[12] of Text[250]; var HeaderInfoArrValue: array[12] of Text[250]; var i: Integer; var Delimiter: Integer)

Docs  /  NVXGRL General Report Library  /  Libraries
RDLC Layout Library [GRLRdlcLayoutLibraryNVX]

The codeunit contains general purpose functions on the RDLC side.

Procedure nameDescription
IsHideDiscount(RecordVariant: Variant): Boolean If at least one document line contains a line discount <> 0, the function returns a false value. Helps to hide/unhide the column/row in the RDLC layout. RecordVariant currently only recognizes the following tables or DataItems: Sales Header, Purchase Header, Sales Invoice Header, Purchase Credit Memo Header
"RDLC Custom Code" can also be found in the object library [Copy - Paste]:

PublisherParameter
OnAfterElseInIsHideDiscount (var RecRef: RecordRef; var HideDiscount: Boolean; var IsHandled: Boolean)
OnAfterGetRecordRefInIsHidesDiscount (var RecRef: RecordRef; var HideDiscount: Boolean; var IsHandled: Boolean)

Docs  /  NVXGRL General Report Library  /  Libraries
General Caption Library Enum [GRLGeneralCaptionLibraryNVX]

The Enum contains general purpose captions. Caption usage from the GeneralCaptionLibrary enum object:

Docs  /  NVXGRL General Report Library  /  Appendix
Release Notes

Would you like to know what has changed in the extension?
Below you'll find an overview of the new features and changes made in the updates. Build-Overview in DevOps

NVXGRL 1.0.4.0

as of Business Central 18
2023/10/09

    Improvements

  • GeneralCaptionLibrary has been extended with new captions

NVXGRL 1.0.3.0

as of Business Central 18
2023/08/17

    Improvements

  • GeneralCaptionLibrary has been extended with new captions
  • The application language has been changed to de-DE

NVXGRL 1.0.2.0

as of Business Central 18
2023/04/11

    Improvements

  • GeneralCaptionLibrary has been extended with new captions
  • The GeneralReportLibrary and SalesReportLibrary codeunits have been extended with new features

NVXGRL 1.0.0.1

    Improvements

  • GeneralCaptionLibrary has been extended with new captions
  • The GeneralReportLibrary codeunit has been extended with new functions

NVXGRL 1.0.0.0

as of Business Central 18
2022/04/27

    Initial Version

  Save manual as PDF or print  
DE|EN Imprint