Hello experts!! NAV2018
I need to print the value of the work description field in sales header, for what I did this code where TextoStreamin(Text,1024):
"Sales Invoice Header".CALCFIELDS("Work Description");
IF "Sales Invoice Header"."Work Description".HASVALUE THEN BEGIN
"Sales Invoice Header"."Work Description".CREATEINSTREAM(Streamin,TEXTENCODING::Windows);
Streamin.READ(TextoStreamin);
but when the value exceeds 1024 characters is cut, I replaced the text variable with a bigtext like this, where btWorkDescription(bigtext)
CLEAR(btWorkDescription);
"Sales Invoice Header".CALCFIELDS("Work Description");
IF "Sales Invoice Header"."Work Description".HASVALUE THEN BEGIN
"Sales Invoice Header"."Work Description".CREATEINSTREAM(Streamin,TEXTENCODING::Windows);
Streamin.READ(btWorkDescription);
but it gives an error
please help me and thanks!!
0
Answers
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Blob type variables can not be defined in the report
Apart from the screenshot from Report 206, which is somewhat irrelevant here - you are not supposed to pass a BLOB field, but the text extracted from it.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
2018-11-06
You do not need BigText.
"Sales Invoice Header".CALCFIELDS("Work Description");
TempBLOB.BLOB := "Sales Invoice Header"."Work Description";
WorkDescriptionText := TempBLOB.ReadAsText('', TEXTENCODING::Windows);
//or if your WorkDescriptionText is declared as text with some lenght:
WorkDescriptionText := COPYSTR(
TempBLOB.ReadAsText('', TEXTENCODING::Windows);
1, MAXSTRLEN(WorkDescriptionText) );
Slawek_Guzek, your code works but does not respect paragraph breaks; this is the result with your code:
and what I need is:
but that works with more than 1024 characters.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03