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...
Suggested answer

Report for Multiple Tables

(0) ShareShare
ReportReport
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';
 
    }




 
}
I have the same question (0)
  • Suggested answer
    Kamal Khakhkhar Profile Picture
    1,202 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.
  • Suggested answer
    YUN ZHU Profile Picture
    94,353 Super User 2025 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

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,901

#2
YUN ZHU Profile Picture

YUN ZHU 2,079 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 2,041

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans