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
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035
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
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
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
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
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
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035 -
thanks, you're very kind.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions