0

I had use XSSFWorkbook which was work fine in all device(even for MAC), But now i migrate on SXSSFWorkbook, So now i face one problem xlsx file not able to view on MAC

In detail Question

So how can i achieve this as like in XSSFWorkbook.

HybrisHelp
  • 5,518
  • 2
  • 27
  • 65
  • What program are you using on the Mac to view the file? Microsoft Office for Mac? OpenOffice? Something else? – Gagravarr Aug 13 '14 at 12:23

1 Answers1

1

Without knowing what program you're using, it's hard to be sure. However, assuming your program is similar to the problematic iOS one in the several-year-old thread you mention, then what you need to do is tell SXSSF to write strings to the Shared Strings table rather than inline. Be aware that this will result in higher memory use.

You can do that using this constructor to SXSSFWorkbook by passing a value of true for the boolean useSharedStringsTable

Assuming you're creating a new file, and your constructor code was

Workbook wb = new SXSSFWorkbook(20);

You'd now do:

Workbook wb = new SXSSFWorkbook(null, 20, false, true);

Have a look at the JavaDocs for more on the various constructor options and their impacts

Gagravarr
  • 47,320
  • 10
  • 111
  • 156
  • `Gagravarr`, I think MAC use its own viewer(am not sure), This was bug in development which already fix in (3.11-beta1) version. I have migrate from `XSSF` to `SXSSF` due to this memory issue `XSSF` use in memory, So as per your comment to solve this bug again i have to use `useSharedStringsTable` which create memory problem(all think are kept in memory), So now what is benefit of `SXSSF` if i am going to use `useSharedStringsTable` . – HybrisHelp Aug 18 '14 at 06:33
  • Shared Strings is not the only kind of thing kept in memory, so it'll still help using SXSSF. Other than that, try getting Apple to follow the specification rather than taking short cuts... – Gagravarr Aug 18 '14 at 07:14