| Docs Help
  AppSource  
Docs  /  Excel Report Builder  /  Information for Developers

 Connector


2023/12/01 • 3 min. to read
Via the codeunit NCE Connector Excel Evaluations can also be called or integrated from other extensions or from elsewhere. Currently, 2 functions are available in several variants (or several overloads) for calling an evaluation:
  • DownloadEvaluation - creates the Excel workbook on your device.
  • GetEvaluation - works in principle like DownloadEvaluation with the difference that the finished Excel workbook is not downloaded, but returned as a Temp Blob. In addition, the file name that the Excel Report Builder would assign to the workbook is returned.

Note

When calling an evaluation via the Connector, the user is not shown any windows (thus also no evaluation filters).

Example 1

On the Customer List page (Page 22), the evaluation 'CUST_ONGOING_DOCS' should be callable via an action. The evaluation should be created and then downloaded.

Implementation

pageextension 50000 "NVX Customer List" extends "Customer List"
{
    actions
    {
        addfirst(Sales)
        {
            action(NVXCallNCEEvaluationAction)
            {
                ApplicationArea = All;
                Caption = 'Excel Evaluation', Comment = 'DEU="Excel-Auswertung"';
                Image = Start;
                Scope = Repeater;
                ToolTip = 'Executes the CUST_ONGOING_DOCS evaluation. This creates an Excel workbook on your device.', Comment = 'DEU="Führt die CUST_ONGOING_DOCS Auswertung aus. Dadurch wird eine Excel-Arbeitsmappe auf Ihrem Gerät erstellt."';

                trigger OnAction()
                var
                    NCEConnector: Codeunit "NCE Connector";                
                begin
                    NCEConnector.DownloadEvaluation('CUST_ONGOING_DOCS');
                end;
            }
        }
    }
}

Example 2

The same requirement as in example 1, but in addition it should be ensured that the evaluation contains the "Sales Header" table. All changes to Example 1 are highlighted.

Implementation

pageextension 50000 "NVX Customer List" extends "Customer List"
{
    actions
    {
        addfirst(Sales)
        {
            action(NVXCallNCEEvaluationAction)
            {
                ApplicationArea = All;
                Caption = 'Excel Evaluation', Comment = 'DEU="Excel-Auswertung"';
                Image = Start;
                Scope = Repeater;
                ToolTip = 'Executes the CUST_ONGOING_DOCS evaluation. This creates an Excel workbook on your device.', Comment = 'DEU="Führt die CUST_ONGOING_DOCS Auswertung aus. Dadurch wird eine Excel-Arbeitsmappe auf Ihrem Gerät erstellt."';

                trigger OnAction()
                var
                    TempNCEConnectorTableFilter: Record "NCE Connector Table Filter" temporary;
                    NCEConnector: Codeunit "NCE Connector";                
                begin
                    Clear(TempNCEConnectorTableFilter);
                    TempNCEConnectorTableFilter."Table No." := Database::"Sales Header";
                    TempNCEConnectorTableFilter.Insert();

                    NCEConnector.DownloadEvaluation('CUST_ONGOING_DOCS', TempNCEConnectorTableFilter);
                end;
            }
        }
    }
}

Example 3

The same requirement as in example 1 and 2, but in addition it is to be filtered on sales quotes, sales orders and on the current customer no. All changes to Example 2 are highlighted.

Implementation

pageextension 50000 "NVX Customer List" extends "Customer List"
{
    actions
    {
        addfirst(Sales)
        {
            action(NVXCallNCEEvaluationAction)
            {
                ApplicationArea = All;
                Caption = 'Excel Evaluation', Comment = 'DEU="Excel-Auswertung"';
                Image = Start;
                Scope = Repeater;
                ToolTip = 'Executes the CUST_ONGOING_DOCS evaluation. This creates an Excel workbook on your device.', Comment = 'DEU="Führt die CUST_ONGOING_DOCS Auswertung aus. Dadurch wird eine Excel-Arbeitsmappe auf Ihrem Gerät erstellt."';

                trigger OnAction()
                var
                    SalesHeader: Record "Sales Header";
                    TempNCEConnectorTableFilter: Record "NCE Connector Table Filter" temporary;
                    NCEConnector: Codeunit "NCE Connector";                
                begin
                    Rec.TestField("No.");

                    Clear(TempNCEConnectorTableFilter);
                    TempNCEConnectorTableFilter."Table No." := Database::"Sales Header";
                    TempNCEConnectorTableFilter."Field No." := SalesHeader.FieldNo("Document Type");
                    TempNCEConnectorTableFilter.Filter := StrSubstNo('%1|%2', SalesHeader."Document Type"::Quote, SalesHeader."Document Type"::Order);
                    TempNCEConnectorTableFilter.Insert();
                    
                    Clear(TempNCEConnectorTableFilter);
                    TempNCEConnectorTableFilter."Table No." := Database::"Sales Header";
                    TempNCEConnectorTableFilter."Field No." := SalesHeader.FieldNo("Sell-to Customer No.");
                    TempNCEConnectorTableFilter.Filter := Rec."No.";
                    TempNCEConnectorTableFilter.Insert();

                    NCEConnector.DownloadEvaluation('CUST_ONGOING_DOCS', TempNCEConnectorTableFilter);
                end;
            }
        }
    }
}

Filter

Filters are passed to the NCE Connector via the (temporary) NCE Connector Table Filter table - see Example 3. All passed filters will override Filters and Relations which may be specified in the Excel Evaluation for these fields. For more information, see Edit Evaluations, Data Sheets, Table Settings. If filters are passed for a table that occurs more than once in the Excel Evaluation, the filters are set for all tables.

See also




Submit feedback for
DE|EN Imprint
<>