Skip to main content

Notifications

Business Central forum
Answered

Inconvenience when trying to obtain information in a report

Posted on by 93
I created a custom report in BC, information is obtained in the header, however I cannot obtain the records for the lines. I have already confirmed within Microsoft Report Builder that there is no visibility condition, so I think the problem is in the .al code but I have not been able to detect the error.
I share my code that I have developed:
 
report 50400 /Transform Bobina/
{
    DefaultLayout = RDLC;
    RDLCLayout = './src/report/design/Transform Bobina.rdl';
    Caption = 'Transform Bobina';
    dataset
    {
        dataitem(/Bobina Transformacion Header/; /Bobina Transformacion Header/)
        {
            DataItemTableView = sorting(/No./);
            RequestFilterHeading = 'Ped. transform. Bobina';
            RequestFilterFields = /No./;
            column(No_TransferHdr; /No./)
            {
            }
            column(ItemNo_BobinaTransformacionHeader; /Bobina Transformacion Header/./Item No./)
            {
            }
            column(Description_BobinaTransformacionHeader; /Bobina Transformacion Header/.Description)
            {
            }
            column(Quantity_BobinaTransformacionHeader; /Bobina Transformacion Header/.Quantity)
            {
            }
            dataitem(CopyLoop; Integer)
            {
                DataItemTableView = sorting(Number);
                DataItemLinkReference = /Bobina Transformacion Header/;
                dataitem(PageLoop; Integer)
                {
                    DataItemTableView = sorting(Number) where(Number = const(1));
                    DataItemLinkReference = CopyLoop;
                    column(CopyCaption; StrSubstNo(Text000, CopyText))
                    {
                    }
                    column(PostingDate_TransHdr; Format(/Bobina Transformacion Header/./Posting Date/, 0, 4))
                    {
                    }
                    column(PageCaption; StrSubstNo(Text002, ''))
                    {
                    }
                    column(OutputNo; OutputNo)
                    {
                    }
                    column(ShptMethodDesc; ShipmentMethod.Description)
                    {
                    }
                    dataitem(/Bobina Transformacion Line/; /Bobina Transformacion Line/)
                    {
                        DataItemTableView = sorting(/Document No./, /Line No./) where(Quantity = filter(<> 0));
                        DataItemLinkReference = /Bobina Transformacion Header/;
                        DataItemLink = /Document No./ = field(/No./);
                       
                        column(LineNo_TransLine; /Line No./)
                        {
                        }
                                          }
                }
                trigger OnPreDataItem()
                begin
                    NoOfLoops := Abs(NoOfCopies) + 1;
                    CopyText := '';
                    SetRange(Number, 1, NoOfCopies);
                    OutputNo := 1;
                end;
                trigger OnAfterGetRecord()
                begin
                    if Number > 1 then begin
                        CopyText := Text000;
                        OutputNo += 1;
                    end;
                end;
            }
        }
    }
    var
        ShipmentMethod: Record /Shipment Method/;
        DimSetEntry1: Record /Dimension Set Entry/;
        DimSetEntry2: Record /Dimension Set Entry/;
        FormatAddr: Codeunit /Format Address/;
        TransferFromAddr: Text[50];
        TransferToAddr: Text[50];
        NoOfCopies: Integer;
        NoOfLoops: Integer;
        CopyText: Text[30];
        DimText: Text[120];
        OldDimText: Text[75];
        ShowInternalInfo: Boolean;
        Continue: Boolean;
        OutputNo: Integer;
        Text000: Label 'COPIA';
        Text001: Label 'Ped. transfer. %1';
        Text002: label 'Pág. %1';
}
 

Thanks in advance for the help
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 68,242 Super User 2024 Season 2 on at
    Inconvenience when trying to obtain information in a report
    Hi, I suspect it is a problem with dataitem(CopyLoop; Integer). This was a method commonly used in Microsoft standard reports in the past, but now it is directly related to line.
    For example,
    report 1305 "Standard Sales - Order Conf.":
     
    Hope this helps.
    Thanks.
    ZHU

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,186 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,996 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans