Skip to Content
author's profile photo Former Member
Former Member

how to format cells in Excel integration via SET_ORMAT_STRING

hi,

does anybody know how to use the method SET_FORMAT_STRING of interface I_OI_SPREADSHEET?

specifically, how to use the parameter formatstring? is there any documentation on this?

thanks in advance

erick

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 02, 2005 at 04:36 PM

    I know this reply is a long time after the post, but I was needing to find out the same info. Just by trial and error, I figured out how the parameter formatstring works. In my case, what I needed to do was to set a "custom" format for a cell - specifically, I needed to not display zero amounts, display a zero if the amount was under $1.00, and set a place holder on positive number so that the positive and negative numbers would line up in the column. (While in Excel, you can view the help on cell formatting to get the particular formatting you need.) For what I needed, here is the command I used:

    call method spreadsheet->set_format_string
             exporting rangename    = p_datarange
                       formatstring = '#,##0_);#,##0-;" "'
                       no_flush     = no_flush
             importing error        = error
                       retcode      = retcode.
    

    I hope this helps someone out in future searches of this site.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Kris.

      I have long solved this problem. And honestly, I've forgotten what I did. But definitely not as simple as your solution. A late reply is still better than no reply.

      Cheers

      Erick