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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Adding Notes to reports in Business Central

(3) ShareShare
ReportReport
Posted on by 308
Hello, I am using the GetNote procedure below to add Notes to a report in Business Central.
 
The notes are getting printed on the report, but it is adding a special character at the beginning.
 
The actual Note does not contain any special character at the beginning. Can someone please suggest how to remove this special character on the report?
 
Any help will be greatly appreciated. Thank you!
 
 
 
 
 
    procedure GetNote(RecRef: RecordRef): Text[250]
    var
        RecordLink: Record "Record Link";
        NoteText: BigText;
        InStr: InStream;
 
    begin
        Clear(Notes);
        RecordLink.SetRange("Record ID", RecRef.RecordId);
        RecordLink.SetRange(Type, RecordLink.Type::Note);
 
        if RecordLink.FindSet then
            repeat
                RecordLink.CalcFields(Note);
                if RecordLink.Note.HasValue() then begin
                    Clear(NoteText);
                    RecordLink.Note.CreateInStream(InStr);
                    NoteText.Read(InStr);
                    NoteText.GetSubText(NoteText, 2)
                end;
            until RecordLink.Next() = 0;
        Notes := CopyStr(Format(NoteText), 1, 250);
    end;
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    102,361 Super User 2026 Season 1 on at
    This is a bit strange; it looks like a font issue.
    Try exporting it using the method below and check if the data contains that character. If it doesn't, then it's a layout or font problem; if it does, you'll need to find a way to remove it—for instance, by deleting the first character.
    PS: Dynamics 365 Business Central: Save report dataset to Excel from the request page (Report Inspector)
     
    Hope this can give you some hints.
    Thanks
    ZHU
  • Suggested answer
    OussamaSabbouh Profile Picture
    18,198 Super User 2026 Season 1 on at
    Hello,
    The special character is most likely the first control character being read from the Record Link.Note BLOB. The main issue in your code is that you are using NoteText as both the source and destination in GetSubText. Use a separate Text variable and start from position 2:
    var
        NoteText: BigText;
        NoteAsText: Text;
        InStr: InStream;
    RecordLink.Note.CreateInStream(InStr);
    NoteText.Read(InStr);
    NoteText.GetSubText(NoteAsText, 2, 250);
    Notes := CopyStr(NoteAsText, 1, 250);
     
    This should remove the unwanted leading character. Also note that your current loop only returns the last note found; if you want to print all notes, you should concatenate them separately.
    Regards,
    Oussama Sabbouh
  • AK-13051749-0 Profile Picture
    308 on at
    Thank you for the suggestions, Yun and Oussama.
     
    I am still having the same issue after testing the suggested changes. 
     
    When I export to Excel, the special character shows up as "?". However, this only happens for some records but not all, which is strange. I checked the actual Note stored in the customer card and none of them start with a space or any special character.
     
    Do you have any suggestions for how to remove this unwanted character on the Excel report that only appears for some records?
     
    Any help would be greatly appreciated. Thank you.
     
     
     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 677 Super User 2026 Season 1

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 447 Most Valuable Professional

#3
YUN ZHU Profile Picture

YUN ZHU 366 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans