Avatar of dshrenik
dshrenikFlag for United States of America

asked on 

Installing jxls

If anybody has tried out jxls, please let me know how I can get started. If possible, please give me a step-by-step procedure.
http://jxls.sourceforge.net/

Not sure where I need to copy the extracted folder (from downloads) and how I can set up the classpath and dependencies.

Thanks!
JavaMicrosoft Excel

Avatar of undefined
Last Comment
dshrenik
ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of dshrenik
dshrenik
Flag of United States of America image

ASKER

I'm using Eclipse.
Avatar of for_yan
for_yan
Flag of United States of America image

If you need the functionaliy described below, you'll also need to have jxls-reader-1.0-RC-2.jar
in your classpath or in your project. Chances are you would not need it

In addition to Excel generation functionality jXLS also contains jxls-reader module which provides a great help if you need to parse Excel files created in a predefined format to pull in the data. jXLS-reader allows you to describe parsing rules in a simple XML and all the other work on reading Excel file and population of your Java objects will be done automatically.
Avatar of dshrenik
dshrenik
Flag of United States of America image

ASKER

I don't need the reader. Just need to create xls files with charts.
SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of dshrenik
dshrenik
Flag of United States of America image

ASKER

When I try the code on http://jxls.sourceforge.net/samples/chartsample.html,
I get an errors saying "Syntax error on token "add", = expected after this token" on line 2.

Please let me know if I have to post this as a different question.
Avatar of for_yan
for_yan
Flag of United States of America image

This code is just a snippet - you need to put it within the class, etc.
Did you place it in a classwith main method .etc?
Avatar of dshrenik
dshrenik
Flag of United States of America image

ASKER

I did.
Avatar of for_yan
for_yan
Flag of United States of America image

Perhaps, something like that:
public class TestJXL{
public TestJXL(){
List staff = new ArrayList();
				        staff.add(new Employee("Derek", 35, 3000, 0.30));
				        staff.add(new Employee("Elsa", 28, 1500, 0.15));
				        staff.add(new Employee("Oleg", 32, 2300, 0.25));
				        staff.add(new Employee("Neil", 34, 2500, 0.00));
				        staff.add(new Employee("Maria", 34, 1700, 0.15));
				        staff.add(new Employee("John", 35, 2800, 0.20));
				        staff.add(new Employee("Leonid", 29, 1700, 0.20));
				        Map beans = new HashMap();
				        beans.put("employee", staff);
				        XLSTransformer transformer = new XLSTransformer();
				        transformer.markAsFixedSizeCollection("employee");
				        transformer.transformXLS(templateFileName, beans, destFileName);
}
public static void main(String [] args){

new TestJXL();
}
}

Open in new window

Avatar of for_yan
for_yan
Flag of United States of America image

Post your whole code, I'll have a look
Avatar of dshrenik
dshrenik
Flag of United States of America image

ASKER

Not sure why mine did not work. Yours does. Thanks!
Avatar of for_yan
for_yan
Flag of United States of America image

Great!
SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of dshrenik
dshrenik
Flag of United States of America image

ASKER

Thanks all!
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo