I use ColdFusion to export a fairly small number of rows (about 1000), but a large number of columns (about 300) in Excel. This is a multi-page Excel file with at least two sheets with a large number of columns. Using cfspreadsheet causes a Java heap error. Updating the value of JVM parameters does not improve. What is the best way to export to Excel without throwing a Java heap error?
Edit: I tried several ways to fix the problem inside the program. I use the xml Workbook in cfsavecontent to create multiple sheets and render the result using cfcontent. In this case, cfcontent can use a large amount of memory, which leads to an error in the heap area.
<cfsavecontent variables="REQUEST.xmlData"> <cfoutput> <xml version="1.0"?> <?mso-application progid="Excel.sheet"?> <Workbook> ...other contents </Workbook> </cfoutput> </cfsavecontent>
In the second workaround, I use querynew to create content and upload the final result to excel using <Cfspreadsheet action="write"> . For subsequent sheets, I use <cfspreadsheet action="update"> . The ultimate goal is to use excel using <cflocation url="excelPath"> , but in this case, updating cfspreadsheet permanently eliminates a memory error.
If updating jvm is not an option, what other methods do you propose to implement to fix memory problems.
coldfusion excel coldfusion-9
Dg3
source share