apache Poi / npoi - get a sheetidentifier from a sheet - apache-poi

I'm trying to construct a Ref3dPxg - and need a sheetIdentifier from it - I have a sheet, but can't figure out how to construct it in a nice way - I've tried
new SheetIdentifier( "", new NameIdentifier( mySheet.name, false)), which works, but there has to be a better way?

Related

Calculated PivotFields in the Excel Javascript add-in API

I'm attempting to create a pivot table through the Excel Javascript API, based off of some old code. With VBA, I could write something like
Worksheets(1).PivotTables(1).CalculatedFields.Add "PxS", _
"= Product * Sales"
to add a calculated field to a pivot table. I can't find an equivalent through the excel javascript api and I'm not sure if it just hasn't been added yet, or if I'm missing a feature somewhere.
The closest thing I've found is ShowAsRule, but I don't think the functionality there is equivalent (you can't use a custom formula)
can you check the doc of Add rows and columns to a PivotTable segment in the url https://learn.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-pivottables ? A workaround is creating a new column with like C=A*B, and add C directly

Create formatted excel file from PL/SQL

I'm trying to create excel file formatted like this:
I tried to use https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:769425837805, but it is good for putting ONLY simple table in report - I need data like Info1/2/3 etc.
I tried csv, sperated by ';', but that makes excel unformatted, and it is unreadable.
Any ideas?
PS If there is a way to paint cell - great, but if not - it isn't necessary.
PS2 2nd thought - column number in bottom part of raport varies between diffrent input data. So that makes tool from link useless
You might want to check out the following tzwo options:
Free as part the Alexandria tools: https://github.com/mortenbra/alexandria-plsql-utils/blob/master/ora/xlsx_builder_pkg.pkb
Commercial option: https://www.oraexcel.com

How to check data update using selenium webdriver?

I am having job portal for testing. I am testing that once job seeker update his/her resume then actually all field data is updating or not?
I have automated above for easy and fast regression testing. At this time I am doing like :
1 - Store resume data in to excel - Before Update
2 - Update Resume data
3 - Store resume data again into same excel - After Update
4 - Now I am comparing cell data of Before Update & After Update one by one and checking that if data matches or mismatches. If data mismatch then it means data updated.
So Am I doing it in right way? Is there any other easy way in selenium webdriver to check above things , I mean to check whether data is updated or not?
I can suggest you 2 approaches:-
1) Without using excel sheet:-(Recommended)
- you can use hash map(key-value) to store data before updating resume.
- Then After updating resume, you can store updated values in another map.
- Now, you can compare both map data.
2) Using excel sheet:(Only if you need to data for future reference)
- Yes, in this case, as you did, save data in 2 different sheets of same worksheet of an excel file.
- Use poi jar, to retrieve and write data in these excel sheets.
- Compare data for verification. But using excel should be avoided if not required to store data for future reference. Excel have chances to get corrupt and also excel connection is little bit time consuming as compared to 1st approach.

Creating a new row when there is more than one column

How would you force create a new row in Excel wherever there is a an additional column (i.e. more than one) - as seen below?
I'm currently doing this manually and it is quite time consuming.
I recently had to do this exact thing, and came up with two solutions:
1) Export as CSV, run several search+replaces on the data with a text tool, re-import into Excel, then use a formula to create the duplicate user numbers for empty first rows.
2) Write 15 lines of PHP code to turn the CSV into a new CSV.
The second is MUCH more effective and flexible, but it requires a basic coding environment.

How to "format as table" in Excel or apache POI?

In Excel 2010 it's possible to "format as table" a group of cells - enabling easy sorting and filtering (Home > Format As Table).
Can I do the same in Apache POI? Alternatively, can one accomplish the above directly in Excel via a macro/formula (as opposed to CTRL+T or clicking on a toolbar button)?
There's a fairly new feature in POI that may deliver what you need. Grab a recent nightly/svn build (or wait for POI 3.8 beta 3 in a week or so), and take a look at XSSFTable. You should now be able to add one to a sheet, specify the range it applies to (the range you want to be made a table), and that hopefully will do you. It's quite new though, so you may need to join the POI dev list and help with the development of the feature if it's not quite there for you!

Resources