Edit range of excel charts using macros - java

I am editing an excel sheet using POI here is a sample data:
Now there is a chart created for this data like this:
Now the number of rows of this data keeps changing everyday. So I need to set the range for this graph using macros. so how to change both series and category for a graph using macros? Or perhaps we can do it in POI itself?

Related

Moving Sheet order in Excel with apache POI; how to avoid changing formulas

Im trying to move a sheet in my excel between other sheets with Apache POI.
to accomplish that Im calling
workbook.setSheetOrder("sheetToMove", 1);
problem is in another sheet i have formulas like "=sheetToMove!A2"
if I do above call, the formula changes to "=unrelatedSheet!A2"
my current workaround involves going through all cells of the referencing sheet, storing away all the formulas + row/column information in a datastructure before changing sheet orders. after I changed the order, I go thorugh the stored formulas and put them in the correct cell. Is there a more efficient way of changing sheet order without changing the formulas?

How to assign values from an array to Text boxes in Webpage using selenium java

I have an Excel sheet with as 5 rows and 3 columns containing values.
What I need is :-
-To read the values row wise each time and input into corresponding 3 textboxes in a webpag e and click submit button
- Then page refreshes and then fetch the next row values in excel ,assign the values to the textfields perform the submit action
In a nutshell, how can we assign the values row wise enter image description here from an excel sheet to multiple textboxes in a page one after the other?
For read excel sheet and storing it into the variables in java probably the best way is to use Apache POI library .This library lets you manipulate excel documents and more. I found some example how to use Apache POI to read data from excel. After that you can you can store the cells inside the variables and use variables to insert the data into the website. Hope this gets you on the right track.
http://www.codejava.net/coding/how-to-read-excel-files-in-java-using-apache-poi

Applying Excel sheet drop down list validations using Java (Apache poi API)?

I've done coding for Excel sheet drop down list for a specific column but I want to apply validation.
For example - once the any value of drop down was selected in first row it'll not display in the second row.
How can I achieve this?

Java POI API - Drawing pie chart in XLS

I have searched for this and implemented it using a template file with sample data and the pie chart in it. I need the following:
I want to add more rows (add more data). Modifying the existing data in the defined data range works fine. (Adding extra row by using shiftRows() did not work)
I want to move the pie chart in the current sheet. I might have the pie chart in a specific position in the template. But, I need to modify the data and need to move it to a different position within the sheet.
If anyone can provide direction on this or point to a working example, it would be really helpful.
NOTE: I want a pure POI solution.
Please check if this can help.
JFreeChart

Inserting image in to the excel cell using jxl api

I have to insert image in to the excel cell using jxl api
I have tried with some sample code but it will insert at some coordinator, but I want in to at particular cell index or inside cell.
Here is sample code that I found while searching for this.
Anyone has solution for this?
From a discussion on channel9:
No version of Excel allows you to insert a picture into a cell. Pictures are inserted into the worksheet and will always float.
One of the properties of a picture can be set to "move and size with cells" but that only moves or stretches the picture when the underlying rows and columns are inserted, deleted or sized. It does not confine a picture to a cell.
Here is a step-by-step procedure on how to do it from Excel, maybe you can mime it programmatically.

Categories

Resources