Problem while generating Excel file from classic report

poppinspoppins Member Posts: 647
Hi everyone,
I am trying to generate an Excel file from a report.I have a trouble with the following line of code:
ExcelBuf.AddColumn('(01)',FALSE,'',TRUE,FALSE,TRUE,'');
I want the value (01) to be displayed in the column header, but what I get in the Excel file is -1.
How can I display what I want?
Thanks in advance :)

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    If you start up Excel and type (01) in a cell, you also get -1. You need to precede your text with '.
    When you type '(01) then you see (01) in the cell.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • lubostlubost Member Posts: 627
    Hi,

    you should use ' (apostroph) as a first char in such fields. Excel shows such fields without apostroph and doesn't perform formatting (for Excel such fields are strings).
Sign In or Register to comment.