error with bigtext in report
kanika
Member Posts: 247
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!!
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
Best Answer
-
I think it would take you much shorter to look into TempBLOB table and functions available there, rather that write another post here...

Slawek Guzek - www.yitron.co.uk
Business Central, MS SQL Server, Wherescape RED;5
Answers
-
I do not know how, please explain to me.0
-
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 - www.yitron.co.uk
Business Central, MS SQL Server, Wherescape RED;0 -
What kind of variable is TempBLOB ?
Blob type variables can not be defined in the report0 -
What kind of variable is TempBLOB ?
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.Slawek Guzek - www.yitron.co.uk
Business Central, MS SQL Server, Wherescape RED;0 -
record type variable, ok
0 -
Slawek_Guzek Posts: 1,609Member
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.
0 -
I think it would take you much shorter to look into TempBLOB table and functions available there, rather that write another post here...

Slawek Guzek - www.yitron.co.uk
Business Central, MS SQL Server, Wherescape RED;5 -
thanks, you're very kind.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
