0

When taking 1 or more .xls documents, I want to take the content from a specific tab/sheet (skipping the first line) and add it to the bottom of a different, specific .xls document on a specific tab/sheet in Clojure/Docjure. Here's what I've tried so far:

(use 'dk.ative.docjure.spreadsheet)
(def destinationDoc "/Users/nreilly/Desktop/Compiled.xls")
(def dwb (load-workbook destinationDoc))
(def swb (load-workbook  "/Users/nreilly/Desktop/test.xls"))
(def newdata (rest (row-seq (select-sheet "Data" swb))))
(add-rows! (select-sheet "Data" dwb) newdata)
(save-workbook! destinationDoc dwb)

Loading the data seems to be working fine, however, when calling add-rows! I get the following error:

IllegalArgumentException No matching method found: setCellValue for class org.apache.poi.hssf.usermodel.HSSFCell clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:79)

Not sure if this is a bug in my code, or the library, or I'm just not going about it in the right way.

Any suggestions on where to look?

(As a note, keeping it in the .xls format is important as the destination doc has some fancy pivot tables and other formulas that use the data I'm trying to consolidate)

Thanks, Nathan

Nathan
  • 115
  • 8

1 Answers1

1

This is what happens when you try to take data from an HSSFRow and expect it to automagically cast to an XSSFRow, I believe this is a way to convert the document How to convert HSSFWorkbook to XSSFWorkbook using Apache POI? , but you might want to consider working with XSSFworkbook or HSSFworkbook to reduce complexity and scope for error.

Community
  • 1
  • 1