WebRatio and Excel files

19 Dec '12, 09:37 AM
5,849 Views
No Forum Badges

Buongiorno,

I'm using WebRatio 5.1.x and I have to modify an Excel file by adding some cells to an existing Excel spreadsheet.

I'm planning to use a library, but I have some doubts:

1) Which library would you use for this purpose? I had a look at http://jxl.sourceforge.net/ , do you have any alternatives?

2) What is the the best approach to modify an existing Excel file in WebRatio?. Where could I store it on the server? Is there any WebRatio feature that may be useful in this case?

Thanks, Salvatore

 
x 0
Follow
Answer Answer at this question and get points!
No Forum Badges

Hi,

for the moment the Excel Unit doesn't allow to write/update a protected Excel file.

You can customize the layout of the cell by specifying the "Value Style" property of a Cell Info. The style value has the same format of the style attribute used into the Excel Style. For example, to set a background color and a text color:

Value Style = background:#CC0000;color:#2D7808

For more information about the Excel style: Help > Web Modeling User Guide > Reference > Default Styles Reference > Excel

   
x 0
No Forum Badges

Hi,

is there a particular reason why are you planning to use a library for interacting with the Excel spreadsheet ?

In WebRatio you can easily modify an Excel file with the Excel Unit. The Excel Unit reads, writes and updates an Excel file. In your case, you need update an existing Excel file to add the new cells and the Excel Unit will return as output the BLOB data representing the updated file.

For more details and examples about the Excel Unit, refer to this article:

Getting started with the Excel Unit

 
x 1
No Forum Badges

Ciao Laura,

thank you for providing me with information about the Excel Unit, it is actually a better approach than using an external library (I took it into consideration because it is already used in one of our custom units).

Now I'm wondering whether:

1) The Excel Unit (WebRatio 5.1.x) supports the protection of cell / cell ranges

2) What is the correct syntax to set both the background/foreground cell color to white. I guess that I have to specify the "Value Style" of the specific Cell Info based on the parameters available in Excel.attr.template. Something like: cellbackground:white, cellcolor:white, but I'm not sure if that's the correct way of doing it.

Grazie,

Salvatore

 
x 0
Answer at this question and get points!