Spreadsheet workbook control installation and usage Summary

Source: Internet
Author: User
Tags ole

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.