Streaming Excel module skips empty rows in xlsx file, so the app cannot get the physical rows number.

0
Streaming Excel is very lightweight and fast and works well in our app. However, it skips empty rows in the xlsx file, so the app can't get the physical row number of each row. I know this is because POI XSSF Eventmodel skips empty rows in xlsx files. But this is bothering us because our app needs to tell the user exactly which row in the xlsx the data came from. In the POI XSSF Eventmodel, you can get the exact physical row number by using attributes.getValue("r") in 'case "row"' in the startElement method of DefaultHandler. Therefore, I think that the physical row number obtained here can be inserted as the first column just before adding the row data to the row buffer in ''case "row"' in the endElement method. Of course, it would be good to make this function selectable as an optional function with a flag parameter. I have implemented this modification in our app and confirmed that it works well, but I hope that it will be adopted as a standard in the Streaming Excel module. How about you guys? I would be happy if the author Taner san sees this post and agrees with it.  
asked
5 answers
1

Thanks, Yuta, for the suggestion! I’m currently working on an update for the module and will try to implement this request. Appreciate your input!

 

Best regards, Taner.

answered
1

Hi Yuta,

 

Thank you once again for the valuable input. I appreciate the clear example regarding includePhoneticRuns. I’ll include this adjustment in the upcoming update so that phonetic runs won’t be mixed into the cell strings in Japanese environments. Thanks for helping improve the module.

 

Best regards, Taner.

answered
1

Hi Taner-san,

 

Thanks for your work to adopt our requests. I confirmed StreamingExcelImport action in v2.1.0 and find includePhoneticRuns option.

Will it take more to add physical row number support to StreamingExcelImport action?

 

Best regards,

Yuta.

answered
1

Hi Taner-san,

Sorry for the unclear request. but we actually wanted you to add physical row number feature to import action.

We have made the following changes to StreamingSheetHandler.java(v1.1.0), which we hope you will adopt as an option.

 

33a34> private String physicalRowIndex = "0";  // added by yuta

85a87> physicalRowIndex = attributes.getValue("r");;  // added by yuta

148a151> currentRow.cells.add(0, physicalRowIndex);;  // added by yuta

 

{370F6B1B-2403-43D3-9ADC-86B1C314DD30}.png

{B7BF548D-7A63-4D2A-B54F-3B499DBFB6DD}.png{35EFF9DA-67ED-47AF-8438-F9577D9275F1}.png

 

Best regards,

Yuta Suzuki.

answered
0

Hi Yuta,

 

I think I already added this functionality. The StreamingExcelExport Action has an "addRowNumber" property.

 

If set to true, each row in the exported Excel file will be prefixed with a sequential row number in the first column, starting at 1 for the first data row. This helps in tracking and referencing specific rows when analyzing exported data. If set to false, no row numbers are added.

 

addRowNumber parameter

 

Can you please confirm if this is what you are looking for?

 

With kindest regards,

 

Taner.

answered