Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Displaying in the message box but not in report.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Dear NAV Peers,

I'm developing a  production order report , In the report  i have used 1) Production order and 2) production order line table .I have a field as specification where i want to fetch the value through coding.

The below coding i have written in production order line -> OnAfterGet record ()

RecItem.RESET;
RecItem.SETRANGE(RecItem."No.","Prod. Order Line"."Item No.");
IF RecItem.FINDSET THEN BEGIN
RTestPlanSetup.RESET;
RTestPlanSetup.SETRANGE (RTestPlanSetup."Item No.",RItem."No.");
IF RTestPlanSetup. FINDSET THEN BEGIN
RTestPlan.RESET;
RTestPlan.SETRANGE(RTestPlan."No.",RTestPlanSetup."Test Plan No.");
IF RTestPlan.FINDSET THEN BEGIN
RTestPlanPropertySet.RESET;
RTestPlanPropertySet.SETRANGE(RTestPlanPropertySet."Test Plan No.",RTestPlan."No.");
RTestPlanPropertySet.SETRANGE(RTestPlanPropertySet.Version,RTestPlan.Version);
IF RTestPlanPropertySet.FINDSET THEN BEGIN
REPEAT // new
NewSpecification := RTestPlanPropertySet.Description;
MESSAGE('%1',NewSpecification);

UNTIL RTestPlanPropertySet.NEXT =0;
// MESSAGE('%1',NewSpecification);
END;
END;
END;
END;

in the test plan property we have 5 lines , in the message box all the five lines are displayed but in layout it display the last line only . Please help .

5-lines.PNG

the below image is the report  , only the last line is being displayed. 

last-line.PNG

Looking forward for the solution for the same . Thanks in advance.

*This post is locked for comments

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Displaying in the message box but not in report.

    Instead of VRCRLF use <br\> and use that in place holder and mark it as HTML. Please check this for example

    https://docs.microsoft.com/en-us/sql/reporting-services/report-design/add-html-into-a-report-report-builder-and-ssrs

    blogs.catapultsystems.com/.../add-html-formatting-to-your-sql-server-reporting-services-ssrs-reports

  • Suggested answer
    Tina Menezes Profile Picture
    Tina Menezes 2,576 on at
    RE: Displaying in the message box but not in report.

    Hi,

    Instead of giving BinCount<5 as mentioned in the link which i mentioned above, you will need to declare an integer variable say 'n' which will count the no of production order lines after getting the current record using setrange. You need to code for this.

    Now you need to change the code mentioned in the link to the below:

    If BinCount<n then begin

    //same as the link

    end;

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Displaying in the message box but not in report.

    Dear tina, thanks for your reply , i just saw ur link of splitting in the lines, Actually in my report we can't define the fixed length of the description . It varies for each and test plan no . So friends plz help me how to proceed with this.

  • Suggested answer
    Tina Menezes Profile Picture
    Tina Menezes 2,576 on at
    RE: Displaying in the message box but not in report.

    Hi Cindrella,

    You can check the below link to split a concatenated string on a new line.

    https://www.dynamics101.com/nav-2013-r2-report-trick-split-concatenated-string-on-new-line/

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Displaying in the message box but not in report.

    Dear Suresh,

      i tried the above step too, i get the  with vbcrlf in the report also and its not getting displayed as required . :( as  2 specification together as a paragraph.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Displaying in the message box but not in report.

    Please add the line break VBCRLF before adding each line in the code and that should give a line break.

    NewSpecification := RTestPlanPropertySet.Description + 'VBCRLF';

    Check if this does the trick

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Displaying in the message box but not in report.

    hi mahesh , if you look the image its displyed together as a paragraph. I want one in a line.

  • mmv Profile Picture
    mmv 11,465 on at
    RE: Displaying in the message box but not in report.

    Do you mean to display all the specification lines?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Displaying in the message box but not in report.

    Dear Suresh,

    Can you please help for the issue posted earlier. I would really appreciate you if you can help me to find a solution.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Displaying in the message box but not in report.

    thank you so much .. is it possible to get one specification per line. Now it displays as the below0245.report.png

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans