Spreadsheet is a control used to view and edit Excel spreadsheet files. It can be used on an Excel-like interface. It combines many of our most popular components, such as grid controls, ribbon components, formula engines, and many other controls. It is designed to create a control similar to Silverlight that allows you to view and edit Excel files.
In Windows, the online Excel File Read required by ActivePerl is usually Win32: Ole. For cross-platform platforms, it is best to select another Spreadsheet: parseexcel and spreadsheet: writeexcel. The former is used to read Excel files, and the latter is used to write Excel files.
Spreadsheet: parseexcel can only read Excel documents in 95-2003 format. For Office 2007 excel, install Spreadsheet: XLSX.
Install Spreadsheet
Install in Windows
Ppm> install ole: storage_lite
Ppm> install Spreadsheet: parseexcel
Ppm> install Spreadsheet: writeexcel
Install on Mac
Sudo Perl-mcpan-e "Install 'spreadsheet: parseexcel '"
Insert row/column in Spreadsheet
The spreadsheet API provided by owc does not directly add columns. You can execute the command to add columns.
The code for adding a new row is as follows in row 3rd:
VaR ssconstants = spreadsheet1.constants;
Spreadsheet1.activesheet. Row (3). Select ();
Spreadsheet1.commands (ssconstants. sscommandinsertrows). Execute ();
Add a new column in column 3rd. The Code is as follows:
VaR ssconstants = spreadsheet1.constants;
Spreadsheet1.activesheet. cells (2, 3). Select ();
Spreadsheet1.commands (ssconstants. sscommandinsertcols). Execute ();
From: http://www.6excel.com/doc/20052
Spreadsheet: writeexcel
# Usr/bin/perl-W
Use strict;
Use Spreadsheet: writeexcel;
My $ workbook = Spreadsheet: writeexcel-> new('perl.xls ');
My $ worksheet = $ workbook-> add_worksheet ('sheetname1 ');
$ Worksheet-> write ("A1", "Hello word! ");
Format function library
$ Contentstyle-> set_size (8 );
$ Contentstyle-> set_bold (); # Set the font to bold.
$ Contentstyle-> set_align ('center'); # Set the cell to center
$ Contentstyle-> set_text_wrap (); # whether to press enter to wrap
$ Contentstyle-> set_color ('red'); # Set the foreground color of a cell to red.
F_row = Workbook. add_format (: color => "black",: bold => 0,: italic => false,: text_wrap => true)
Spreadsheet supports cell merging, http://rubyforge.org/forum/message.php? Ms. g_id = 64873
Set the format attribute of the cell to be merged to: align =>: merge.
spreadsheet workbook control installation and usage summary