error with bigtext in report

kanikakanika Posts: 204Member
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!!

Answers

  • BlackTigerBlackTiger Posts: 1,165Member
    BigText has own stream. You have to copy streams.
    "You can’t just ask customers what they want and then try to give that to them.
    By the time you get it built, they’ll want something new.” Steve Jobs
  • kanikakanika Posts: 204Member
    I do not know how, please explain to me.
  • Slawek_GuzekSlawek_Guzek Posts: 1,596Member
    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-03
  • kanikakanika Posts: 204Member
    edited 2018-11-06
    What kind of variable is TempBLOB ?
    Blob type variables can not be defined in the report
  • Slawek_GuzekSlawek_Guzek Posts: 1,596Member
    edited 2018-11-06
    kanika wrote: »
    What kind of variable is TempBLOB ?
    fzln79hpa2gv.png
    kanika wrote: »
    Blob type variables can not be defined in the report
    uefbduwei5r3.png
    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-03
  • kanikakanika Posts: 204Member
    record type variable, ok
Sign In or Register to comment.