Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RowFlushedException on render-to-file with more than 100 rows #33

Open
dpetranek opened this issue Apr 21, 2016 · 8 comments
Open

RowFlushedException on render-to-file with more than 100 rows #33

dpetranek opened this issue Apr 21, 2016 · 8 comments

Comments

@dpetranek
Copy link

dpetranek commented Apr 21, 2016

When I run render-to-file on datasets longer than 100 rows, I get a RowFlushed Exception:

(render-to-file
     "templates/test.xlsx"
     "repltest.xlsx"
     {"Sheet1" {0 (mapv #(conj [] %) (range 101))}})

=> ; RowFlushedException Row 0 has been flushed, cannot evaluate all cells org.apache.poi.xssf.streaming.SXSSFFormulaEvaluator.evaluateAllFormulaCells (SXSSFFormulaEvaluator.java:117)

I'm using a blank .xlsx workbook as the template, so there shouldn't be any problem with the SXSSFFormulaEvaluator.

If I change (range 101) above to (range 100), it works as expected.

@tomfaulhaber
Copy link
Owner

Ahh, I think that this is a side-effect of the change we made in #12. I'm going to back that out and see if I can't figure out another way to solve that. In the meantime, you might try release 0.3.0 and see if that works better for you.

@dpetranek
Copy link
Author

Thanks for the quick reply! Unfortunately, switching back to 0.3.0 is giving me guff - I'm getting an unfamiliar stack trace every time I try to compile - https://www.refheap.com/118065

I've got this in the project.clj dependencies: [com.infolace/excel-templates "0.3.0"]
And this is in the namespace declaration of the file where I use it:

(ns emv.routes.report
  (:require [excel-templates.build :as excel]))

@tomfaulhaber
Copy link
Owner

@dpetranek That looks like you've got a mixed up class path. It says that chart.clj is looking for something from Apache Commons that wasn't added until 0.3.2. I checked the git history and clojars and I think this is right.

Is there some way that you have a version of chart.clj from master or 0.3.3 on your classpath?

@dpetranek
Copy link
Author

Thanks Tom. I finally got round to picking this back up, and deleting my target/classes folder cleared it up the ExceptionInInitializerError that was being thrown before. However now when I try to render-to-file, it doesn't write to disk or throw an error:

(excel-writer/render-to-file
                    "resources/test.xlsx"
                    "repltest.xlsx"
                    {"Sheet1" {0 (mapv #(conj [] %) (range 101))}})

=> nil

It returns nil but doesn't actually create repltest.xlsx. The only change I made was to change my dependency to [com.infolace/excel-templates "0.3.0"].

@tomfaulhaber
Copy link
Owner

Does it work if you create a single cell A1 on the template with a 0 in it?

@dpetranek
Copy link
Author

I'm afraid not.

@gwzbenjamin
Copy link

tested with data 46(cols) * 10000 (rows), it will take about 20 minutes to finish rendering, can you take a look and see if this can be make faster? as it only take me about 2 minutes to operate the copy & paste for those data in my excel template.

@gwzbenjamin
Copy link

(excel/render-to-file
"resources/template.xlsx"
"e:/tmp/71_test.xlsx"
{"new"
{1 (take 10000 rows1)}
}
)
OutOfMemoryError Java heap space [trace missing]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants