Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to format cells in Excel integration via SET_ORMAT_STRING

ErickT
Explorer
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

2 REPLIES 2

Former Member
0 Kudos

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.

0 Kudos

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