Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Report for Multiple Tables

Posted on by 4
Hello everyone,
After creating the table in RDLC then building the report, when previewing I get this error: 
 
Rendering output for the report failed and the following error occurred: An unexpected error occurred while compiling expressions. Native compiler return value: ‘[BC40000] 'RequestMinimum' is obsolete: 'Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.'.’.
 
What causes this error? Will appreciate assistance tremendously, the error has been causing disruptions.
 
 
 
//This code compiles successfully.
 
 
report 50129 /Report for multiple tables/
{
    //Make the report serachable fro Tell me
    UsageCategory = Administration;
    ApplicationArea = All;
    //Use RDL layout
    DefaultLayout = RDLC;
    //Specify the name of the file that the report will use
    RDLCLayout = 'MyRDLReport.rdl';
 
    dataset
    {
        dataitem(Customer; Customer)
        {
            //Sort table view based on the No. field
            DataItemTableView = Sorting(/No./);
            //Include the No. field in the filter tab
            RequestFilterFields = /No./;
            //print data only if at least one of the CustLedgerEntry and sales header items generates output
            PrintOnlyIfDetail = true;
 
            column(No_Customer; /No./)
            {
                //Include the caption of No. field
                IncludeCaption = true;
            }
 
            column(Name_Customer; Name)
            {
                //Include the caption of No. field
                IncludeCaption = true;
            }
 
            column(Phone_Customer; /Phone No./)
            {
                //Include the caption of No. field
                IncludeCaption = true;
            }
 
            column(Address_Customer; Address)
            {
                //Include the caption of No. field
                IncludeCaption = true;
            }
 
            column(EMail_Customer; /E-Mail/)
            {
                //Include the caption of No. field
                IncludeCaption = true;
            }



 
            dataitem(CustLedger; /Cust. Ledger Entry/)
            {
 
                DataItemTableView = sorting(/Entry no./);
 
                // DataItemLinkReference = Customer;
                DataItemLink = /Customer No./ = field(/No./);




 
                column(EntryNo_CustLedgerEntry; /Entry No./)
                {
                    IncludeCaption = true;
 
                }
                column(CustomerNo_CustLedgerEntry; /Customer No./)
                {
                    IncludeCaption = true;
 
                }
                column(PostingDate_CustLedgerEntry; /Posting Date/)
                {
                    IncludeCaption = true;
 
                }
                column(DocumentType_CustLedgerEntry; /Document Type/)
                {
                    IncludeCaption = true;
 
                }
 
                column(DocumentNo_CustLedgerEntry; /Document No./)
                {
                    IncludeCaption = true;
 
                }
 
                column(Description_CustLedgerEntry; Description)
                {
                    IncludeCaption = true;
 
                }
 
                column(CurrencyCode_CustLedgerEntry; /Currency Code/)
                {
                    IncludeCaption = true;
 
                }
 
                column(Amount_CustLedgerEntry; Amount)
                {
                    IncludeCaption = true;
 
                }
 
                column(OriginalAmtLCY_CustLedgerEntry; /Original Amt. (LCY)/)
                {
                    IncludeCaption = true;
 
                }
 
                column(RemainingAmtLCY_CustLedgEntry; /Remaining Amt. (LCY)/)
                {
                    IncludeCaption = true;
 
                }




 
                dataitem(DetCustLedger; /Detailed Cust. Ledg. Entry/)
                {
 
                    DataItemTableView = sorting(/entry no./);
                    //DataItemLinkReference = CustLedger;
                    DataItemLink = /Cust. Ledger Entry No./ = field(/Entry No./), /Customer No./ = field(/Customer No./);


 
                    column(EntryNo_DetailedCustLedgEntry; /Entry No./)
                    {
                        IncludeCaption = true;
 
                    }
 
                    column(EntryType_DetailedCustLedgEntry; /Entry Type/)
                    {
                        IncludeCaption = true;
 
                    }
 
                    column(PostingDate_DetailedCustLedgEntry; /Posting Date/)
                    {
                        IncludeCaption = true;
 
                    }
 
                    column(DocumentType_DetailedCustLedgEntry; /Document Type/)
                    {
                        IncludeCaption = true;
 
                    }
 
                    column(DocumentNo_DetailedCustLedgEntry; /Document No./)
                    {
                        IncludeCaption = true;
 
                    }
 
                    column(AmountLCY_DetailedCustLedgEntry; /Amount (LCY)/)
                    {
                        IncludeCaption = true;
 
                    }
 
                    column(TransactionNo_DetailedCustLedgEntry; /Transaction No./)
                    {
                        IncludeCaption = true;
 
                    }
 
                    column(JournalBatchName_DetailedCustLedgEntry; /Journal Batch Name/)
                    {
                        IncludeCaption = true;
 
                    }
 
                    column(DebitAmountLCY_DetailedCustLedgEntry; /Debit Amount (LCY)/)
                    {
                        IncludeCaption = true;
 
                    }
 
                    column(CreditAmountLCY_DetailedCustLedgEntry; /Credit Amount (LCY)/)
                    {
                        IncludeCaption = true;
 
                    }



 
                    dataitem(SalesHeader; /Sales Header/)
                    {
                        DataItemTableView = sorting(/Document Type/, /No./);
                        DataItemLinkReference = Customer;
                        DataItemLink = /Sell-to Customer No./ = field(/No./);
 
                        column(DocumentType_SalesHeader; /Document Type/)
                        {
                            IncludeCaption = true;
 
                        }
 
                        column(No_SalesHeader; /No./)
                        {
                            IncludeCaption = true;
 
                        }
 
                        column(PostingDate_SalesHeader; /Posting Date/)
                        {
                            IncludeCaption = true;
 
                        }
 
                        column(PricesIncludingVAT_SalesHeader; /Prices Including VAT/)
                        {
                            IncludeCaption = true;
 
                        }
 
                        column(Amount_SalesHeader; Amount)
                        {
                            IncludeCaption = true;
 
                        }
                    }
                    //These labels will be used later as captions in the report layout.  
                }
 
            }
        }
    }
    labels
    {
        Sales_Document_Caption = 'Sales Documents';
        Total_Caption = 'Total';
 
    }




 
}
Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,472 Super User 2024 Season 2 on at
    Report for Multiple Tables
    It seems to be a problem with the code in your layout file (RDLC).
    For example,
     
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Kamal Khakhkhar Profile Picture
    Kamal Khakhkhar 290 on at
    Report for Multiple Tables
    Hii There,
     
    as i Run & Published code. its not have any error. May be you are putted some condition which may caused error. you need to check for your RDLC condition for that.
     
    Thank You.
    Kamal Khakhkhar.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans