Hi everyone. Has anyone added data from a table extension to a report and had success?
I've been looking through the forum and saw a couple of threads that talk about creating custom reports but none of them lay out the steps required to link a table extension to a report using al code.
We created a table extension on the sales invoice line and I am trying to add the two fields that we added to the sales invoice form. Here is the code that i've written so far. I'm used to doing things like this in SQL where I'd just need to add a join but AL seems a lot different... any help is appreciated. It's not letting me just add another data item like i did to add the sales invoice line table.
report 50105 "Sales Invoice Test Report"
{
DefaultLayout = RDLC;
RDLCLayout = 'sales_inv_test.rdl';
dataset
{
dataitem("Sales Invoice Header";"Sales Invoice Header")
{
RequestFilterFields = "No.";
column(No_;"No.")
{
}
column(Sell_to_Customer_No_;"Sell-to Customer No.")
{
}
column(Document_Date;"Document Date")
{
}
column(Amount;Amount)
{
}
column(Remaining_Amount;"Remaining Amount")
{
}
dataitem("Sales Invoice Line";"Sales Invoice Line")
{
DataItemLinkReference = "Sales Invoice Header";
DataItemLink = "Document No." = field("No.");
column(Line_No_;"Line No.")
{
}
column(Description;Description)
{
}
column(Quantity;Quantity)
{
}
column(Unit_Price;"Unit Price")
{
}
// This is where I would expect to link the table extension
// dataitemlinkreference
// dataitemlink
}
}
}