Free Perl API for Excel Spreadsheets Creation
Open Source Perl Excel Library that allows Excel XLSX Creation, Editing & Manipulation. It allows Excel Data Import/Export, Chart Generation, Cell Formatting & So on.
What is Excel-Writer-XLSX?
Microsoft Excel is a robust program that is frequently used for reporting, analysis, and data manipulation. One dependable and feature-rich option for programmatically modifying Excel files in Perl is the Excel-Writer-XLSX package. An open source Perl module called Excel-Writer-XLSX makes it possible to create and work with Excel files in the XLSX format, which Microsoft Excel has been using by default since 2007. It is a vital tool for automating data processing operations because it gives software developers an easy-to-use collection of tools and functions to create, edit, and format Excel spreadsheets.
Developers who want to work with Excel files programmatically have a plethora of options thanks to the Excel-Writer-XLS Perl module. There are several important features part of the library, such as handle Multiple worksheets, working with Strings and numbers, Cell formatting support, working with Formulas, insert and manage Images, working with Charts, Data validation support, Conditional formatting, insert & manage Tables, Rich string formats support, handle hyperlinks, Page set-up and printing options and many more.
Excel-Writer-XLSX is a flexible and user-friendly Perl library that makes creating and modifying Excel files easier. The library enables developers to automate data analysis and perform calculations within their Perl programs by supporting the generation of formulas inside cells and offering a number of functions to set formulas using standard Excel syntax. Excel-Writer-XLSX gives you the tools you need to optimize your productivity, whether you need to create reports, handle big datasets, or incorporate Excel features into your Perl apps.
Getting Started with Excel-Writer-XLSX
The recommend way to install Excel-Writer-XLSX is using standard Perl procedure. Please use the following command for a smooth installation.
Install Excel-Writer-XLSX via CPAN
cpan Excel::Writer::XLSX
You can also download it directly from GitHub.
Create & Manage Excel Spreadsheet via Perl
The open source Excel-Writer-XLSX library allows software developers to create and manipulate Excel spreadsheets inside their Perl applications. It allows the generation of new Excel spreadsheets from scratch with just a couple of lines of Perl code. It provides functions to define worksheets, set cell values, format cells, and apply various styling options such as font size, bold/italic, cell borders, background colors, and more. This flexibility allows for the creation of visually appealing and informative spreadsheets. The following example shows how software developers can create Excel spreadsheet and Populate the worksheet with data by specifying row and column indices using Perl commands.
How to Create Excel Files using Perl API?
use Excel::Writer::XLSX;
// initialize a new Excel workbook and add a worksheet:
my $workbook = Excel::Writer::XLSX->new('output.xlsx');
my $worksheet = $workbook->add_worksheet();
//Populate the worksheet with data by specifying row and column indices
$worksheet->write('A1', 'Hello');
$worksheet->write('A2', 'Excel');
$worksheet->write('B1', 'Welcome');
$worksheet->write('B2', 'to');
$worksheet->write('C1', 'excel-writer-xlsx');
Adding & Managing Charts in Spreadsheets via Perl
Visualizing data in the form of charts is a common requirement in Excel. The open source Excel-Writer-XLSX library offers support for creating various types of charts, including bar charts, line charts, pie charts, and more. Software Developers can specify the chart data range, customize chart appearance, and add titles, labels, and legends to enhance the visual representation of data. The following example demonstrates how to insert chart into an Excel worksheet using Perl code.
How to Add Chart into an Excel Worksheet via Perl Code?
my $chart = $workbook->add_chart(type => 'column', embedded => 1);
$chart->add_series(
categories => '=Sheet1!$A$1:$A$3',
values => '=Sheet1!$B$1:$B$3',
);
$worksheet->insert_chart('C4', $chart);
Import & Export Data from Excel File
The open source Excel-Writer-XLSX library make it easy for software developers to import and export data from an Excel file inside Perl applications. The library supports seamless data import and export from various data sources. It can read data from arrays, hashes, database query results, and CSV files, making it convenient for populating Excel sheets with existing data. Similarly, it enables exporting data from Excel sheets to these formats, facilitating data extraction and integration into other systems.