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

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
    131 on at
    RE: New Data Item in report not showing value

    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
    RE: New Data Item in report not showing value

    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
    131 on at
    RE: New Data Item in report not showing value

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,602

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 3,033 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,738 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans