Hello everyone,
can someone explain to me why standard reports use integer tables to display the text from BLOB fields. Such as the work description in sales quotes:
report 1304 "Standard Sales - Quote" { ... dataset { dataitem(Header; "Sales Header") { ... dataitem(WorkDescriptionLines; "Integer") { DataItemTableView = SORTING(Number) WHERE(Number = FILTER(1 .. 99999)); column(WorkDescriptionLineNumber; Number) { } column(WorkDescriptionLine; WorkDescriptionLine) { } trigger OnAfterGetRecord() begin if WorkDescriptionInstream.EOS then CurrReport.Break(); WorkDescriptionInstream.ReadText(WorkDescriptionLine); end; trigger OnPostDataItem() begin Clear(WorkDescriptionInstream) end; trigger OnPreDataItem() begin if not ShowWorkDescription then CurrReport.Break(); Header."Work Description".CreateInStream(WorkDescriptionInstream, TEXTENCODING::UTF8); end; } ... trigger OnAfterGetRecord() begin ... CalcFields("Work Description"); ShowWorkDescription := "Work Description".HasValue; ... end; } } ... var WorkDescriptionInstream: InStream; WorkDescriptionLine: Text; ShowWorkDescription: Boolean; ... }
Why not just use the Sales Header's GetWorkDescription function, like the card page does:
report 1304 "Standard Sales - Quote" { ... dataset { dataitem(Header; "Sales Header") { ... column(WorkDescription; Header.GetWorkDescription()) { } ... } } ... }
I would be interested to know what advantages you (or Microsoft) see in the first variant. Or what disadvantages I overlook in my proposal.
Thank you for your help and best regards
Nico