web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

New Data Item in report not showing value

(0) ShareShare
ReportReport
Posted on by 259

Hi, I want to show comments on Sales order lines in a RDLC report.

Below is structure of my report code.

header
{

     line
     {

     }
     // here i have added new data item
     dataitem(SalesCommentLine; "Sales Comment Line")
     {
          DataItemLink = "No." = FIELD("Document No."), "Document Type" = FIELD("Document Type")"Document Line no." = field("Line no.");

          column(CommentsLine; "Comment")
          {

          }
      }

}

After running the report I am getting below error message:

Rendering output for the report failed and the following error occurred: The Value expression for the text box ‘Textbox73’ refers to the field ‘LineComments’. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case.

I have tried another solution:

I created a text variable, stored value in this variable in OnAfterGetRecord(). I am getting correct value in this variable. I have then added this variable as a column in Line dataset. But after running report I am not getting any value on my report.

Any help in this regard?

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    150 on at

    I’d base it on a report that had this already 5900 Service Order. Here is the code. Placement of the data item is similar to what you already have. Check the source code for the good detail

    dataitem("Service Order Comment"; "Service Comment Line")

                       {

                           DataItemLink = "Table Subtype" = FIELD("Document Type"), "No." = FIELD("No.");

                           DataItemLinkReference = "Service Header";

                           DataItemTableView = SORTING("Table Name", "Table Subtype", "No.", Type, "Table Line No.", "Line No.") WHERE("Table Name" = CONST("Service Header"), Type = CONST(General));

                           column(Comment_ServOrderComment; Comment)

                           {

                           }

                           column(TabName_ServOrderComment; "Table Name")

                           {

                           }

                           column(No_ServOrderComment; "No.")

                           {

                           }

                           column(TableLineNo_ServOrderComment; "Table Line No.")

  • Danyal Profile Picture
    259 on at

    Josh, I tried this. This doesn't show any value :( But it changed my order Totals e.g. total quantity, amount etc.

  • Suggested answer
    JAngle Profile Picture
    150 on at

    Maybe you can try doing it more like how dimension line values are displayed. If you use the “show internal info” Boolean on the request page it displays that type of detail. Would just be a case of copying the logic but for comment lines.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,857 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,047 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans