This Question is Answered

2 "helpful" answers available (2 pts)
7 Replies Last post: Feb 2, 2010 4:37 PM by Adam T  
  4 posts since
Mar 16, 2009
Currently Being Moderated

Mar 16, 2009 4:04 PM

Reading Chart from Excel and convert it to Image

Hi , i want to read Chart from Excel and convert it to Image.

The code i did is

 

SheetImpl s = (SheetImpl) w.getSheet(0);

 

 

Chart[] charts = s.getCharts();

 

I can able to get the no of Charts in Sheet , but when i try to get Byte[] and write it to

an image file, am unable to view the chart.

 

 

 

 

byte
[] imageDat = img.getImageData();

OutputStream osimg =

new FileOutputStream("image.jpg"
);

osimg.write(imageDat, 0, imageDat.

length
);

 

The above one is the code i tried to write byte array of chart to image .

 

but it is not working out.

 

Can any one help me in creating the Image from Charts using J-Excel API

 

Regards

 

Jana







 



TeamDev Ltd. 18 posts since
Aug 18, 2008
Currently Being Moderated
1. Mar 17, 2009 6:50 PM in response to: Janakiraman
Re: Reading Chart from Excel and convert it to Image

Hello Jana,

Thank you for your interest in JExcel product.

Using MS Excel stubs you can export charts into images. As an example you can try using ShapeSample.java from JExcel package samples.

Should you have further questions related to usage of JExcel product please do not hesitate to contact us.

P.S. The provided above code is not related to JExcel product at all. We do not have such methods. Please check that you are using our JExcel product, but not the opensource jexcelapi project. We do not provide support of jexcelapi project.

Roman Kazmin TeamDev Ltd. 154 posts since
Nov 21, 2008
Currently Being Moderated
3. Mar 18, 2009 2:17 PM in response to: Janakiraman
Re: Reading Chart from Excel and convert it to Image

Hello Jana,

 

You can find more infromation about our JExcel product and download it by the following address:

 

http://www.teamdev.com/jexcel

 

The mentioned above sample can be found in the samples folder of the JExcel distribution pack.

Also within the distribution pack you can find the Programmer's Guide and javadocs.

 

Yours sincerely,
Roman

Roman Kazmin TeamDev Ltd. 154 posts since
Nov 21, 2008
Currently Being Moderated
6. Mar 19, 2009 12:27 PM in response to: Janakiraman
Re: Reading Chart from Excel and convert it to Image

Jana,

 

The evaluation licenses are come with JExcel package if you selected "Get evaluation key" before downloading. Also in this case you shoul be sent with license files to e-mail address that you defined during download.

 

Please ensure that you made the following steps:

1. JAR file should be located in the program class path

2. Native library (jniwrap.dll file) can be placed somewhere within the program library search path (value of the java.library.pathsystem property, which is by default equal to the value of the system variable PATH on Windows or LD_LIBRARY_PATH on Linux)

3. Put license files (*.lic) in the same folder where the native JNIWrapper library (jniwrap.dll file) resides

 

 

Also, there is one universal way for redistribution of the runtime license file. You will just need to save this file to your application's JAR file, into its META-INF subfolder. For example, if you have some application called <application_name>.jar, the jniwrap.lic file should be located in the following folder:

    <application_name>.jar         \META-INF             jniwrap.lic


 

Please try these steps and let me know the result.

 

Yours sincerely,
Roman

Adam T   19 posts since
Sep 1, 2009
Currently Being Moderated
7. Feb 2, 2010 4:37 PM in response to: Roman Kazmin
Re: Reading Chart from Excel and convert it to Image

Is there a similar function to take an image of the table and cells?

More Like This

  • Retrieving data ...