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
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.
hi Viacheslav Pak
Thank for your reply,
Actually am new to reading Chart from Excel.
Where do i get the the example ShapeSample.java and supporting jars for it.
So that i can run that code.
Regards
Jana
Hello Jana,
You can find more infromation about our JExcel product and download it by the following address:
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
Hi Roman,
Thanks for your reply.
I have downloaded the evaluation package and executed the ShapeSample.java
file from sample package by placing 3 .lic file and jniwrap.dll file in bin
folder.The problem am facing is No valid license found.
JNIWrapper license check failed: No valid license found.
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.jniwrapper.win32.jexcel.Application.<clinit>(Application.java:47)
at nativepeer.graphics.ShapeSample.main(ShapeSample.java:32)
Caused by: java.lang.RuntimeException: JNIWrapper license check failed: No valid license found.
I didn't modified the licence file , just i copied and pasted in my bin folder thats it.
Please can u help out in this, so that i can execute it.
Hi Roman,
can you provide me the evaluation license.
Regards
Jana
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
Is there a similar function to take an image of the table and cells?