FastReport and (x)harbour

Hi I am new with FastReport but I already love it!
Using 4.12.1 version

My problem seems to be simple but it bothers me a lot:
cCompanyName := ALLTRIM(vcompany->TITLE)
private m_fr := frreportmanager():new()
 
// x = ALIAS()
// n = SELECT() 
 m_fr:SetWorkArea(x,n)    //"xreport", n)
    // Now to define which FIELDS we want to show on the report
 m_fr:SetFieldAliases(x,   "NAME;SSN;DATEENTER;TOTALH;TOTALL;TOTALB;BALANCEH;PAIDH;DEPARTMENT")        // DEPARTMENT is only needed if we sort by DEPARTMENT


     m_fr:LoadFromFile(m_pj)

    m_fr:AddVariable( "MyVars", "CoName",  " ' cCompanyName ' "  )
     //m_fr:AddVariable( "MyVars", "CoName",  '"cCompanyName"'  )
    //m_fr:AddVariable( "MyVars", "CoName",  "'" + cCompanyName +"'"  )
    
     m_fr:DesignReport()

    m_fr:DestroyFR()
    return nil

No "Addvariable()" function call yields the result
When the previev of the report loads, I can see the variable "CoName" in section "MyVars" and I can drag it an drop into the report
But when I run the preview of the report, the following dialog error shows:

"the following error(s) has occured:
CoName: Error in expression "BROKEN YOLK CAFFEE":";" expected

Comments

  • edited 8:58AM
    I found the solutiion

    The syntax for string is

    m_fr:AddVariable( "MyVars", "CoName", (cCompanyName +CRLF) )

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.