Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Groovy
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<h1>Why Scriptom? </h1> <p>There must be a dozen different libraries out there that support reading and writing <strong>Excel</strong> documents. Some, like <a href="http://poi.apache.org/hssf/index.html">POI</a> or <a href="http://www.extentech.com/estore/product_detail.jsp?product_group_id=228">OpenXLS</a>, let you manipulate <strong>Excel</strong> files directly from Java. These libraries don't use <strong>Microsoft Excel</strong>, so they work well in mixed OS environments. However, they don't support some key features of <strong>Excel</strong> (there are significant limitations), and their APIs don't correspond to <strong>Excel's</strong> <strong>COM</strong> <strong>API</strong>, so it can be difficult at times to figure out how use them to do even simple things. </p> <p>Other libraries, like <a href="https://com4j.dev.java.net/">COM4J</a>, <a href="http://sourceforge.net/projects/jcom">JCOM</a>, and <a href="http://sourceforge.net/projects/jacob-project/">JACOB</a> let you use <strong>Excel</strong> automation to read and create <strong>Excel</strong> files, either directly or through wrapper classes generated from <strong>COM</strong> type libraries. This gives you full access to the complete featureset of <strong>Excel</strong>. It also limits you to <strong>Windows.</strong> It can be sometimes be difficult to translate from Microsoft's Visual Basic-oriented documentation to the corresponding library/wrapper in Java. This can be particularly challenging if you aren't already up to speed on <strong>COM</strong> and the <strong>Excel API</strong> - which is probably true for most Java programmers. <strong>Excel</strong> automation is also a lot slower than direct file manipulation (process startup overhead, process-to-process communication). </p> <p><strong>Scriptom</strong> is a <strong>COM</strong> automation library for <strong>Groovy</strong>, so it falls squarely into the second group. In fact, <strong>Scriptom</strong> is an extension of <a href="http://sourceforge.net/projects/jacob-project/">JACOB</a>. <strong>JACOB</strong> does the heavy lifting, and <strong>Scriptom</strong> makes it groovy.</p> <p><em>So why would you use</em> <strong><em>Scriptom</em></strong> <em>over one of the alternatives?</em> </p> <p>Scriptom is intended to replicate the feel of COM scripting - as much as possible - but with Groovy instead of VBScript. It looks like COM scripting, and it feels like COM scripting. So when you are, for instance, translating a VBA macro to its equivalent Groovy, there is very little translation involved. You can't quite do a copy-paste, but it's close. And when you are programming against the Microsoft documentation for the Excel API, you don't have to ask a lot of questions. The code simply works the way it's documented. </p> <p>Additionally, Scriptom provides special support for scripting Excel. The Scriptom library contains definitions for all the constants in the Excel type library. Scriptom also includes <strong>ExcelHelper</strong> (<strong>org.codehaus.groovy.scriptom.util.excel.ExcelHelper</strong> - whew!), which gives you an easy way to work with Excel documents in a multiprocessing (server) environment.</p> <p>Are you feeling groovy yet?</p> <p>Scriptom is suitable for use in low-to-medium volume tasks where Excel is available. For example, it is useful in batch jobs, where you aren't too concerned about execution time. And it can be used to produce reports in Excel format for a web site (throw in a pie chart in a few lines of code), as long as you don't try to deliver more than one report every couple of seconds. </p> <p>If you feel the need for speed and you can live with its limitations, consider POI. In fact, many Java-based frameworks and libraries that provide Excel support out of the box (Cocoon, ColdFusion, etc.) use POI under the covers. However, if your goals are <em>easy-to-write</em>, <em>easy-to-maintain</em>, and <em>full-featured</em>, and the <strong>Windows/Excel</strong> thing isn't a showstopper, your best bet may be <strong>Scriptom</strong>. </p> <h1>Let's Get Started!</h1> <p>LINK TO DOCUMENT WITH INSTALLATION INSTRUCTIONS </p> <p>Enough with the introductions. Let's get started with an example that shows just how easy it is to work with Excel using Scriptom. <br class="atl-forced-newline" /> <br class="atl-forced-newline" /></p> <p><br class="atl-forced-newline" /> </p> <p><a href="http://poi.apache.org/hssf/index.html">http://poi.apache.org/hssf/index.html</a></p> <p>http://www.rgagnon.com/javadetails/java-0516.html \\\\\\\\- various ways to read and write Excel documents <br class="atl-forced-newline" /> <br class="atl-forced-newline" /></p> <p>minimalistic framework, and syntax that corresponds directly to the Microsoft documentation</p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced