boopathi s
asked on
I created an Xlsx export using cold fusion.It throws the following Errors 1.java heap space,GC overhaed limit and Software caused connection abort: socket write error.
This is my Piece of code:
// Procedure to get results
<cfquery name="ExportData" datasource="#session.DataS ource#">
EXEC xxx 6, #yy#,'#Dateformat(now(),'m m/dd/yyyy' )#','#Star tDate#', '#EndDate#', #rx#, NULL
</cfquery>
This procedure gives the result set more than 1 lakh records.From this I formed the 'QoQ' from the above procedure.
'Query of Queries to get result set'
<cfquery name="Residents" dbType="query">
SELECT ContactID, State, Location, Name, MIDate, MODate, MoveOutReason, MovedToDesc, DateOfBirth, Race, Gender, FirstTotalPts, LastTotalPts
FROM ExportData
WHERE SectionIND = 'Residents'
</cfquery>
<cffunction name="QueriesToXLS" access="public">
<cfargument name="queryArr" required="true" /><!--- An Array of Query Objects --->
<cfargument name="sheetNameArr" required="false" /><!--- Optional sheet names to use instead of "Sheet1","Sheet2",... --->
<cfset tempPath = GetTempDirectory() & CreateUuid() & ".xlsx" /><!--- Creaete a Temp XLS File --->
<cfset counter = 1 />
<cfloop array="#ARGUMENTS.queryArr #" index="i">
<cfset sheetName = "Sheet#counter#" />
<cfif isDefined("ARGUMENTS.sheet NameArr")>
<cfset sheetName = ARGUMENTS.sheetNameArr[cou nter] />
</cfif>
<cfspreadsheet action="update" filename="#tempPath#" query="i" sheetName="#sheetName#" />
<cfset counter += 1 />
</cfloop>
<cfreturn SpreadsheetRead(tempPath) />
</cffunction>
// function to form xlsx file --
<cfset xlsData = QueriesToXLS(
[Residents, x,y,z,a,f],
["Residents", " x","y","z","a","f"]) />
If I runs the Procedure for smaller date range it gives the excel file.When runs for larger date ranges for example 13 thousand records it throws the above mentioned errors?How to overcome these errors.Please help me out on this.
// Procedure to get results
<cfquery name="ExportData" datasource="#session.DataS
EXEC xxx 6, #yy#,'#Dateformat(now(),'m
</cfquery>
This procedure gives the result set more than 1 lakh records.From this I formed the 'QoQ' from the above procedure.
'Query of Queries to get result set'
<cfquery name="Residents" dbType="query">
SELECT ContactID, State, Location, Name, MIDate, MODate, MoveOutReason, MovedToDesc, DateOfBirth, Race, Gender, FirstTotalPts, LastTotalPts
FROM ExportData
WHERE SectionIND = 'Residents'
</cfquery>
<cffunction name="QueriesToXLS" access="public">
<cfargument name="queryArr" required="true" /><!--- An Array of Query Objects --->
<cfargument name="sheetNameArr" required="false" /><!--- Optional sheet names to use instead of "Sheet1","Sheet2",... --->
<cfset tempPath = GetTempDirectory() & CreateUuid() & ".xlsx" /><!--- Creaete a Temp XLS File --->
<cfset counter = 1 />
<cfloop array="#ARGUMENTS.queryArr
<cfset sheetName = "Sheet#counter#" />
<cfif isDefined("ARGUMENTS.sheet
<cfset sheetName = ARGUMENTS.sheetNameArr[cou
</cfif>
<cfspreadsheet action="update" filename="#tempPath#" query="i" sheetName="#sheetName#" />
<cfset counter += 1 />
</cfloop>
<cfreturn SpreadsheetRead(tempPath) />
</cffunction>
// function to form xlsx file --
<cfset xlsData = QueriesToXLS(
[Residents, x,y,z,a,f],
["Residents", " x","y","z","a","f"]) />
If I runs the Procedure for smaller date range it gives the excel file.When runs for larger date ranges for example 13 thousand records it throws the above mentioned errors?How to overcome these errors.Please help me out on this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"Update" uses more memory than spreadsheet functions.