Open excelfile with an preselected cell - java

i have an application where i read an excelfile(.xls), make some calculations and present the result. At the result is a button implemented which opens the original excelfile.
Is it possible to provide the specific cell as an arguement to show the cell directly, so that the user does not have to select the cell by himself?

The selected cell is stored within the Excel file. You have to study the API of your Excel writing library to find out, how to set this.
E.g. with POI it would be http://poi.apache.org/apidocs/org/apache/poi/xssf/usermodel/XSSFSheet.html#setActiveCell(java.lang.String)

Like Holger and Moritz said in their comments, it seems that that it is not possible to startup excel with a given cell preselected.

Related

Write with Java Apache Excel file with item and text component as cell values

I worte a code, that generated an output, where other people should choose an acknowledgment value 0,1 or 2. But some people ignored the "value rules" and they wrote other things into the cells. Now I want to generate the output with radio buttons and a textfield for comments. It should not be possible anymore to write other things into the ACKValue cells.
Is this possible to code with Java Apache? Can somebody give me some keyword how to do it. At the end it should be possible to read in the file again and sort the rows with respect to the chosen value.

Petaho kettle Java expression to split cell and duplicate value in excel horizontally

I am using Kettle for data migration for moving data, I come across a scenario where i got a excel where the column header is merged, When i read it only the first cell gets the name others are empty, Kettle can only duplicate values vertically, I have a macro which does the exact same thing, But some one has to do it manually, Is there a java code i could run to achieve this?
What do you mean by merged? In the excel file is there one cell with all the values? Is there a separator? If it's not a great deal of columns I'd just manually add them or change them to what I want using a select step. If you'd like to upload files I'll take a look.
I think, got the solution. Here Java code is not required. Please follow the step to achieve your result.
Step1: Drag and drop Microsoft Excel Input to the canvas.And go to Content uncheck Header.
Step2: Go to !Fields tab. See the below image and fill up like below image.
Step3:Go to Additional output fields tab and then check for sheet row nr field and fill up the check box with row_number.
Step4:Finally, click on preview button. You get the result like below.
If you see the result. First three rows are unnecessary. You can filter those three rows by using Filter step this part I'am not done.

Issue during Grouping and Ungrouping using Apache POI and java

I am able to write to excel Sheet by Using Apache POI with Java.
Also, I am able to groupby Row, as mentioned in the requirement.
But, the issue which I am facing is:
I create multiple sheets in the workbook, and use "groupRow" to group data in the sheets.
And, I need to activate the 2nd sheet, by default. All, works fine, apart from the expand(+) button to "Ungroup" the "group".
Basically, when I open the excel, the 2nd sheet is selected by default and the similiar data are grouped also. But, when I click the "Ungroup" button(+), It does not work.
Note: If I navigate to some other sheet and come back to the same sheet, then the "Ungroup" button works fine.
Its due to the fact that the "Data Tab" is deactivated by default.
How do I activate the "Data Tab" by default, so that the "Ungroup" button works fine.
So, Basically, I need the "Ungroup" button to work ,without navigating to some other sheet.
Appreciate your help and Support.
If possible please share code snippet.
Below are the code Snippets:
sheetx = wb.createSheet();
sheetx.groupRow(4, 11);
sheetx.setRowGroupCollapsed(4, true);
wb.setActiveSheet(1);

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.

How to write two hyperlink in Excel cell using java

Is there is any way to write hyperlink in Excel cell using java.
e.g. I want to write two hyperlink in one cell.
When i click on google.com it should open google site and same for yahoo site.
www.google.com | www.yahoo.com
Thanks
It is impossible to have more than one hyperlink per XLS cell. However, that link gives a "cheat" which involves using multiple linked shapes (which I doubt POI supports).
If you are using Apache POI, you can use the setFormula [1] method of HSSFCell to write a formula
HYPERLINK("http://example.com")
[1] http://poi.apache.org/spreadsheet/formula.html

Categories

Resources