Charles Robertson
11/30/2022, 3:41 PMzackster
11/30/2022, 3:46 PMCharles Robertson
11/30/2022, 3:48 PMzackster
11/30/2022, 3:48 PMCharles Robertson
11/30/2022, 3:58 PMcfspreadsheet is that we won't have to change too much syntax, because it emulates the tag based format of ACF's cfspreadsheet
cfsimplicty doesn't really emulate any of the syntaxzackster
11/30/2022, 4:01 PMcfspreadsheet will be installed under your lucee-server folder, you can edit the files there directlyCharles Robertson
11/30/2022, 4:03 PM<http://cfspreadsheet-lucee5-3-9_166.com|cfspreadsheet-lucee5-3-9_166.com>\wwwroot\cfspreadsheet-lucee-5-master\lar\org\cfpoi\spreadsheet\Spreadsheet.cfc
The change is not present, when I reload the page?Charles Robertson
11/30/2022, 4:04 PMCharles Robertson
11/30/2022, 4:06 PMcfspreadsheet and I will publish any changes to the:
https://github.com/Leftbower/cfspreadsheet-lucee-5/
Once, my contract has finished...
Thanks for your help @zacksterCharles Robertson
11/30/2022, 4:19 PM.lex file to;
.CommandBox\server\9AC33D0DF8B8FA3A47AE7BDADE2130CB-cfspreadsheetLucee539166\lucee-5.3.9.166\WEB-INF\lucee-web\deploy
How does this talk to the cfspreadsheet Coldfusion files in my webroot?Charles Robertson
11/30/2022, 4:24 PMcfspreadsheet folder in my webroot?
But, in this case, the extension's root folder is not called:
cfspreadsheet
It is called:
cfspreadsheet-lucee-5-masterCharles Robertson
11/30/2022, 4:31 PM.lex file into:
.CommandBox\server\9AC33D0DF8B8FA3A47AE7BDADE2130CB-cfspreadsheetLucee539166\lucee-5.3.9.166\WEB-INF\lucee-web\deploy
What actually happens?
I cannot see how the .lex file knows where the cfspreadsheet folder is?Charles Robertson
11/30/2022, 4:32 PMManifest-Version: 1.0
mapping-type: cfc
Bundle-Description: this is a cfc mapping generated by Lucee.
mapping-id: 1mz0ez85r04pz
Bundle-SymbolicName: 1mz0ez85r04pz
mapping-top-level: true
Require-Bundle: lucee.core
Bundle-ManifestVersion: 2
mapping-virtual-path: /cfspreadsheet
mapping-readonly: false
mapping-hidden: false
mapping-physical-first: true
Bundle-Name: cfspreadsheet
Bundle-Version: 1.0.0.1q4cgun7t1cgiCharles Robertson
11/30/2022, 4:50 PMcfspreadsheet folder somewhere under the server webroot folder, that commandbox creates at:
C:\Users\cdesi\.CommandBox\server\9AC33D0DF8B8FA3A47AE7BDADE2130CB-cfspreadsheetLucee539166\lucee-5.3.9.166zackster
11/30/2022, 4:58 PMC:\lucee\tomcat\lucee-server\context\libraryzackster
11/30/2022, 4:59 PMCharles Robertson
11/30/2022, 4:59 PMCharles Robertson
11/30/2022, 5:00 PMCharles Robertson
11/30/2022, 5:01 PMC:\domains\<http://cfspreadsheet-lucee5-3-9_166.com|cfspreadsheet-lucee5-3-9_166.com>\wwwroot\cfspreadsheet-lucee-5-master\lar\org\cfpoi\spreadsheet\Spreadsheet.cfczackster
11/30/2022, 5:01 PMCharles Robertson
11/30/2022, 5:03 PMzackster
11/30/2022, 5:03 PMzackster
11/30/2022, 5:04 PMCharles Robertson
11/30/2022, 5:05 PMCharles Robertson
11/30/2022, 5:06 PMzackster
11/30/2022, 5:06 PMzackster
11/30/2022, 5:07 PMCharles Robertson
11/30/2022, 5:07 PMzackster
11/30/2022, 5:08 PMzackster
11/30/2022, 5:08 PMzackster
11/30/2022, 5:09 PMzackster
11/30/2022, 5:09 PMCharles Robertson
11/30/2022, 5:13 PMlar folder
Where do I put the stuff that was in the lar folder?zackster
11/30/2022, 5:23 PMzackster
11/30/2022, 5:26 PMzackster
11/30/2022, 5:26 PMCharles Robertson
11/30/2022, 5:27 PMjamiejackson
11/30/2022, 6:11 PMCharles Robertson
11/30/2022, 6:12 PM<cfscript>
component {
this.name = 'cfspreadsheetLucee539166';
this.sessionManagement = true;
this.dbLocation = replace(getDirectoryFromPath( getCurrentTemplatePath() ),'\','/','all') & 'db/cfdocexamples';
this.customTagsLocation = replace(getDirectoryFromPath( getCurrentTemplatePath() ),'\','/','all') & 'cfspreadsheet-lucee-5-master/extension/tags';
this.datasources['cfdocexamples'] = {
class: 'org.apache.derby.jdbc.EmbeddedDriver'
, connectionString: 'jdbc:derby:#this.dbLocation#;create=true;'
};
this.customtagpaths = [this.customTagsLocation];
function onApplicationStart() {
}
}
</cfscript>Charles Robertson
11/30/2022, 6:13 PMCharles Robertson
11/30/2022, 6:14 PM<cfoutput>
#Now()#
<!--- Read data from two datasource tables. --->
<cfquery name="courses" datasource="cfdocexamples" cachedwithin="#CreateTimeSpan(0, 6, 0, 0)#">
SELECT CORNUMBER,DEPT_ID,COURSE_ID,CORNAME
FROM COURSELIST
</cfquery>
<cfquery name="centers" datasource="cfdocexamples" cachedwithin="#CreateTimeSpan(0, 6, 0, 0)#">
SELECT *
FROM CENTERS
</cfquery>
<cfscript>
//Use an absolute path for the files. --->
theDir=GetDirectoryFromPath(GetCurrentTemplatePath());
theFile=theDir & "courses.xls";
//Create two empty ColdFusion spreadsheet objects. --->
theSheet = SpreadsheetNew("CourseData");
theSecondSheet = SpreadsheetNew("CentersData");
//Populate each object with a query. --->
SpreadsheetAddRows(theSheet,courses);
SpreadsheetAddRows(theSecondSheet,centers);
</cfscript>
<!--- Write the two sheets to a single file --->
<cfspreadsheet action="write" filename="#theFile#" name="theSheet"
sheetname="courses" overwrite=true>
<cfspreadsheet action="write" filename="#theFile#" name="theSecondSheet"
sheetname="centers" overwrite=true>
<!--- Read all or part of the file into a spreadsheet object, CSV string,
HTML string, and query. --->
<cfspreadsheet action="read" src="#theFile#" sheetname="courses" name="spreadsheetData">
<cfspreadsheet action="read" src="#theFile#" sheet=1 rows="3,4" format="csv" name="csvData">
<cfspreadsheet action="read" src="#theFile#" format="html" rows="5-10" name="htmlData">
<cfspreadsheet action="read" src="#theFile#" sheetname="centers" query="queryData">
<h3>First sheet row 3 read as a CSV variable</h3>
<cfdump var="#csvData#">
<h3>Second sheet rows 5-10 read as an HTML variable</h3>
<cfdump var="#htmlData#">
<h3>Second sheet read as a query variable</h3>
<cfdump var="#queryData#">
<!--- Modify the courses sheet. --->
<cfscript>
SpreadsheetAddRow(spreadsheetData,"03,ENGL,230,Poetry 1",8,1);
SpreadsheetAddColumn(spreadsheetData,
"Basic,Intermediate,Advanced,Basic,Intermediate,Advanced,Basic,Intermediate,Advanced",
3,2,true);
</cfscript>
<!--- Write the updated Courses sheet to a new XLS file --->
<cfspreadsheet action="write" filename="#theDir#updatedFile.xls" name="spreadsheetData"
sheetname="courses" overwrite=true>
<!--- Write an XLS file containing the data in the CSV variable. --->
<cfspreadsheet action="write" filename="#theDir#dataFromCSV.xls" name="CSVData"
format="csv" sheetname="courses" overwrite=true>
</cfoutput>Charles Robertson
11/30/2022, 6:17 PMCharles Robertson
11/30/2022, 6:18 PMapplication.cfc this.customTagPaths doesn't seem to work? Unless I have to restart the server after adding this variable?Charles Robertson
11/30/2022, 6:22 PMorg folder out of the lar folder, into the webroot
2. I have added the this.customTagPaths variable to the application.cfcCharles Robertson
11/30/2022, 6:23 PMCharles Robertson
11/30/2022, 6:24 PMCharles Robertson
11/30/2022, 6:25 PMCharles Robertson
12/01/2022, 10:12 AMSpreadsheet.cfc inside the following folder:
C:\domains\<http://cfspreadsheet-lucee5-3-9_166.com|cfspreadsheet-lucee5-3-9_166.com>\wwwroot\cfspreadsheet-lucee-5-master\extension\components\org\cfpoi\spreadsheet
Can you tell me how I repackage the extension?
I have read:
https://docs.lucee.org/guides/lucee-5/extensions.html
But it says that I should just zip up the:
C:\domains\<http://cfspreadsheet-lucee5-3-9_166.com|cfspreadsheet-lucee5-3-9_166.com>\wwwroot\cfspreadsheet-lucee-5-master\extension\META-INF\MANIFEST.MF
Is this correct? I am not sure how a 1KB file becomes a 15,743KB file?
Or maybe, I am meant to zip up the contents of:
C:\domains\<http://cfspreadsheet-lucee5-3-9_166.com|cfspreadsheet-lucee5-3-9_166.com>\wwwroot\cfspreadsheet-lucee-5-master\extension
But not the actual extension folder itself?Charles Robertson
12/01/2022, 10:21 AMC:\domains\<http://cfspreadsheet-lucee5-3-9_166.com|cfspreadsheet-lucee5-3-9_166.com>\wwwroot\cfspreadsheet-lucee-5-master\extension\components\org\cfpoi\spreadsheet\spreadsheet_cfc$cf.class
Why can't I just read the java methods from:
C:\domains\<http://cfspreadsheet-lucee5-3-9_166.com|cfspreadsheet-lucee5-3-9_166.com>\wwwroot\cfspreadsheet-lucee-5-master\extension\jars\cfspreadsheet_3.0.1.jarCharles Robertson
12/01/2022, 10:35 AMC:\Users\cdesi\.CommandBox\server\9AC33D0DF8B8FA3A47AE7BDADE2130CB-cfspreadsheetLucee539166\lucee-5.3.9.166\WEB-INF\lucee-server\context\components\org\cfpoi\spreadsheet\Spreadsheet.cfc
Nothing changes?
Do, I need to clear the cache, somehow?zackster
12/01/2022, 10:35 AMzackster
12/01/2022, 10:36 AMCharles Robertson
12/01/2022, 10:38 AMCharles Robertson
12/01/2022, 10:39 AMApplication.cfc?Charles Robertson
12/01/2022, 10:41 AMC:\domains\<http://cfspreadsheet-lucee5-3-9_166.com|cfspreadsheet-lucee5-3-9_166.com>\wwwroot\cfspreadsheet-lucee-5-master\extension\components\org\cfpoi\spreadsheet\spreadsheet_cfc$cf.class
I don't have a clue what is does or why it is there?Charles Robertson
12/01/2022, 10:43 AMCharles Robertson
12/01/2022, 10:47 AMCharles Robertson
12/01/2022, 10:47 AMC:\Users\cdesi\.CommandBox\server\9AC33D0DF8B8FA3A47AE7BDADE2130CB-cfspreadsheetLucee539166\lucee-5.3.9.166\WEB-INF\lucee-server\context\lucee-server.xmlCharles Robertson
12/01/2022, 10:50 AMzackster
12/01/2022, 10:51 AMCharles Robertson
12/01/2022, 10:57 AMzackster
12/01/2022, 11:00 AMzackster
12/01/2022, 11:00 AMCharles Robertson
12/01/2022, 11:02 AMCharles Robertson
12/01/2022, 11:04 AMlocalhost:4200 and then for production we build stuff into obfuscated JS.zackster
12/01/2022, 11:05 AMCharles Robertson
12/01/2022, 11:12 AMthis.extensions = [
{
id: 'unique_id',
name: 'name_of_extension',
path: 'absolute_path_to_extension'
},
];
Then we can edit the extension files directly.zackster
12/01/2022, 11:13 AMCharles Robertson
12/01/2022, 11:13 AMCharles Robertson
12/01/2022, 11:14 AMlucee-server.xml, but it doesn't change the caching policy?zackster
12/01/2022, 11:14 AMzackster
12/01/2022, 11:14 AMCharles Robertson
12/01/2022, 11:15 AMCharles Robertson
12/01/2022, 11:16 AMthe correct way is to set this up so it can be run when not installed for hackingCould you expand a little
zackster
12/01/2022, 11:16 AMCharles Robertson
12/01/2022, 11:21 AMcfspreadsheet, like a custom tag, which is what is at the heart of the extension, but it doesn't work, because none of the functions can be called, due to referencing issues.
I tried looping through the functions folder to make them globally accessible:
Application.cfc
component {
this.name = 'cfspreadsheetLucee539166';
this.sessionManagement = true;
this.mappings['/org'] = getDirectoryFromPath(getCurrentTemplatePath()) & 'cfspreadsheet-lucee-5-master\org';
this.dbLocation = replace(getDirectoryFromPath( getCurrentTemplatePath() ),'\','/','all') & 'db/cfdocexamples';
this.customTagsLocation = getDirectoryFromPath( getCurrentTemplatePath() ) & 'cfspreadsheet-lucee-5-master\extension\tags';
this.functionLocation = getDirectoryFromPath( getCurrentTemplatePath() ) & 'cfspreadsheet-lucee-5-master\extension\functions';
this.datasources['cfdocexamples'] = {
class: 'org.apache.derby.jdbc.EmbeddedDriver',
connectionString: 'jdbc:derby:#this.dbLocation#;create=true;'
};
this.customtagpaths = [this.customTagsLocation];
function onApplicationStart() {
}
function onRequestStart() {
var local = StructNew();
local.qGetFiles = DirectoryList(this.functionLocation,false,'query','*.cfm','asc','file');
WriteDump(var=local.qGetFiles);
cfloop(query=local.qGetFiles){
cfinclude(template='./cfspreadsheet-lucee-5-master/extension/functions/' & local.qGetFiles.Name);
}
}
}
But it doesn't work?zackster
12/01/2022, 11:35 AMthis.functionPaths not this.functionLocation https://luceeserver.atlassian.net/browse/LDEV-1995Charles Robertson
12/01/2022, 11:36 AMzackster
12/01/2022, 11:37 AMCharles Robertson
12/01/2022, 11:37 AMzackster
12/01/2022, 11:41 AMCharles Robertson
12/01/2022, 11:54 AMcomponent {
this.name = 'cfspreadsheetLucee539166';
this.sessionManagement = true;
this.mappings['/org'] = getDirectoryFromPath(getCurrentTemplatePath()) & 'cfspreadsheet-lucee-5-master\org';
this.dbLocation = replace(getDirectoryFromPath( getCurrentTemplatePath() ),'\','/','all') & 'db/cfdocexamples';
this.customTagsLocation = getDirectoryFromPath( getCurrentTemplatePath() ) & 'cfspreadsheet-lucee-5-master\extension\tags';
this.functionLocation = getDirectoryFromPath( getCurrentTemplatePath() ) & 'cfspreadsheet-lucee-5-master\extension\functions';
this.functionpaths = [];
this.datasources['cfdocexamples'] = {
class: 'org.apache.derby.jdbc.EmbeddedDriver',
connectionString: 'jdbc:derby:#this.dbLocation#;create=true;'
};
this.customtagpaths = [this.customTagsLocation];
function onApplicationStart() {
}
function onRequestStart() {
var local = StructNew();
local.qGetFiles = DirectoryList(this.functionLocation,false,'query','*.cfm','asc','file');
cfloop(query=local.qGetFiles){
local.functionPath = local.qGetFiles.Directory & '\' & local.qGetFiles.Name;
ArrayAppend(this.functionpaths, local.functionPath);
}
WriteDump(var=this.functionpaths, label='this.functionpaths');
}
}
And, still none of the functions can be found?Charles Robertson
12/01/2022, 11:56 AM<cfoutput>
<!---<cfinclude template='cfspreadsheet-lucee-5-master/extension/functions/SpreadsheetNew.cfm' />--->
#Now()#
<!--- Read data from two datasource tables. --->
<cfquery name="courses" datasource="cfdocexamples" cachedwithin="#CreateTimeSpan(0, 6, 0, 0)#">
SELECT CORNUMBER,DEPT_ID,COURSE_ID,CORNAME
FROM COURSELIST
</cfquery>
<cfquery name="centers" datasource="cfdocexamples" cachedwithin="#CreateTimeSpan(0, 6, 0, 0)#">
SELECT *
FROM CENTERS
</cfquery>
<cfscript>
//Use an absolute path for the files. --->
theDir=GetDirectoryFromPath(GetCurrentTemplatePath());
theFile=theDir & "courses.xls";
//Create two empty ColdFusion spreadsheet objects. --->
theSheet = SpreadsheetNew("CourseData");
theSecondSheet = SpreadsheetNew("CentersData");
//Populate each object with a query. --->
SpreadsheetAddRows(theSheet,courses);
SpreadsheetAddRows(theSecondSheet,centers);
</cfscript>
<!--- Write the two sheets to a single file --->
<cf_spreadsheet action="write" filename="#theFile#" name="theSheet"
sheetname="courses" overwrite=true>
<cf_spreadsheet action="write" filename="#theFile#" name="theSecondSheet"
sheetname="centers" overwrite=true>
<!--- Read all or part of the file into a spreadsheet object, CSV string,
HTML string, and query. --->
<cf_spreadsheet action="read" src="#theFile#" sheetname="courses" name="spreadsheetData">
<cf_spreadsheet action="read" src="#theFile#" sheet=1 rows="3,4" format="csv" name="csvData">
<cf_spreadsheet action="read" src="#theFile#" format="html" rows="5-10" name="htmlData">
<cf_spreadsheet action="read" src="#theFile#" sheetname="centers" query="queryData">
<h3>First sheet row 3 read as a CSV variable</h3>
<cfdump var="#csvData#">
<h3>Second sheet rows 5-10 read as an HTML variable</h3>
<cfdump var="#htmlData#">
<h3>Second sheet read as a query variable</h3>
<cfdump var="#queryData#">
<!--- Modify the courses sheet. --->
<cfscript>
SpreadsheetAddRow(spreadsheetData,"03,ENGL,230,Poetry 1",8,1);
SpreadsheetAddColumn(spreadsheetData,
"Basic,Intermediate,Advanced,Basic,Intermediate,Advanced,Basic,Intermediate,Advanced",
3,2,true);
</cfscript>
<!--- Write the updated Courses sheet to a new XLS file --->
<cf_spreadsheet action="write" filename="#theDir#updatedFile.xls" name="spreadsheetData"
sheetname="courses" overwrite=true>
<!--- Write an XLS file containing the data in the CSV variable. --->
<cf_spreadsheet action="write" filename="#theDir#dataFromCSV.xls" name="CSVData"
format="csv" sheetname="courses" overwrite=true>
</cfoutput>Charles Robertson
12/01/2022, 11:58 AMCharles Robertson
12/01/2022, 12:06 PM<cfinclude>
In the:
index.cfm
Not sure why you can't execute cfinclude inside the application.cfc?
Now I am getting this:Charles Robertson
12/01/2022, 12:07 PMjavaloader on:
C:\domains\<http://cfspreadsheet-lucee5-3-9_166.com|cfspreadsheet-lucee5-3-9_166.com>\wwwroot\cfspreadsheet-lucee-5-master\extension\jars\cfspreadsheet_3.0.1.jarCharles Robertson
12/01/2022, 12:08 PMCharles Robertson
12/01/2022, 12:12 PMcfspreadsheet_3.0.1.jar to:
C:\Users\cdesi\.CommandBox\server\9AC33D0DF8B8FA3A47AE7BDADE2130CB-cfspreadsheetLucee539166\lucee-5.3.9.166\WEB-INF\lucee-server\bundles
Now we are back to the function not found errors:Charles Robertson
12/01/2022, 12:14 PMapplication.cfc, so that they are available globally, but Lucee doesn't like this strategy?zackster
12/01/2022, 12:26 PMCharles Robertson
12/01/2022, 12:28 PMCharles Robertson
12/01/2022, 12:29 PMzackster
12/01/2022, 12:30 PMthis.functionpaths = [getDirectoryFromPath( getCurrentTemplatePath() ) & 'cfspreadsheet-lucee-5-master\extension\functions'];Charles Robertson
12/01/2022, 12:35 PMCharles Robertson
12/01/2022, 12:35 PMCharles Robertson
12/01/2022, 12:36 PMspreadsheet.cfczackster
12/01/2022, 12:36 PMCharles Robertson
12/01/2022, 12:37 PMzackster
12/01/2022, 12:39 PMCharles Robertson
12/01/2022, 12:43 PMcomponent {
this.name = 'cfspreadsheetLucee539166';
this.sessionManagement = true;
this.dbLocation = replace(getDirectoryFromPath( getCurrentTemplatePath() ),'\','/','all') & 'db/cfdocexamples';
this.customTagsLocation = getDirectoryFromPath( getCurrentTemplatePath() ) & 'cfspreadsheet-lucee-5-master\extension\tags';
this.functionpaths = [getDirectoryFromPath( getCurrentTemplatePath() ) & 'cfspreadsheet-lucee-5-master\extension\functions'];
this.datasources['cfdocexamples'] = {
class: 'org.apache.derby.jdbc.EmbeddedDriver',
connectionString: 'jdbc:derby:#this.dbLocation#;create=true;'
};
this.customtagpaths = [this.customTagsLocation];
}Charles Robertson
12/01/2022, 12:44 PMjars to:
C:\Users\cdesi\.CommandBox\server\9AC33D0DF8B8FA3A47AE7BDADE2130CB-cfspreadsheetLucee539166\lucee-5.3.9.166\WEB-INF\lucee-server\bundlesCharles Robertson
12/01/2022, 12:45 PM<cfspreadsheet>
To:
<cf_spreadsheet>zackster
12/01/2022, 12:45 PMCharles Robertson
12/01/2022, 1:07 PMCharles Robertson
12/01/2022, 1:59 PMcomponent {
this.functionpaths = [path_to_cfspreadsheet_functions_directory];
this.customtagpaths = [path_to_cfspreadsheet_extension_tags_directory;
this.javasettings.bundle = [path_to_cfspreadsheet_extension_jars_directory];
}
I am going to try and find a solution for the:
cf_
Issue?
We should be able to access to do this:
<cfspreadsheet>Charles Robertson
12/01/2022, 2:11 PMC:\domains\<http://cfspreadsheet-lucee5-3-9_166.com|cfspreadsheet-lucee5-3-9_166.com>\wwwroot\cfspreadsheet-lucee-5-master\extension\components\org\cfpoi\spreadsheet\Spreadsheet.cfc
Do not get processed?Charles Robertson
12/01/2022, 2:13 PMC:\domains\<http://cfspreadsheet-lucee5-3-9_166.com|cfspreadsheet-lucee5-3-9_166.com>\wwwroot\cfspreadsheet-lucee-5-master\extension\jars\cfspreadsheet_3.0.1.jar
I think I need to refresh this jar, each time I make an edit to the POI cfc?zackster
12/01/2022, 2:14 PMzackster
12/01/2022, 2:14 PMzackster
12/01/2022, 2:14 PMCharles Robertson
12/01/2022, 2:15 PMCharles Robertson
12/01/2022, 2:32 PMzackster
12/01/2022, 2:33 PMcfsimplicity
12/01/2022, 2:50 PMcfsimplicity doesn't really emulate any of the syntaxSpreadsheet CFML certainly doesn't support the
<cfspreadsheet> tag itself, but it's not hard to rewrite using Spreadsheet.read() and Spreadsheet.write(). It supports all of the ACF spreadsheet functions with mostly the same arguments so you can just change SpreadsheetAddRows(workbook, data) to Spreadsheet.addRows(workbook, data).cfsimplicity
12/01/2022, 2:50 PMorg\cfpoi\spreadsheet\Spreadsheet.cfc was actually my starting point back in 2015 and I've spent the last 7 years fixing and expanding what it can do. It now runs on the very latest Apache POI v5 and with a wide range of additional functionality and options. I understand you'd prefer not to modify your code, but it's likely to take less time than you've already spent wrangling the extension.cfsimplicity
12/01/2022, 2:50 PM<cfscript>
Spreadsheet = New spreadsheet.SpreadSheet()
//Use an absolute path for the files. --->
theDir=GetDirectoryFromPath(GetCurrentTemplatePath());
theFile=theDir & "courses.xls";
//Write a single workbook with 2 populated sheets
theSheet = Spreadsheet.new("courses");
Spreadsheet.addRows(theSheet,courses);
Spreadsheet.createSheet(theSheet,"centers");
Spreadsheet.setActiveSheet(theSheet,"centers");
Spreadsheet.addRows(theSheet,centers);
Spreadsheet.write(theSheet,theFile,true);
//Read all or part of the file into a spreadsheet object, CSV string, HTML string, and query
spreadsheetData = Spreadsheet.read(src=theFile,sheetName="courses");
csvData=Spreadsheet.read(src=theFile,sheetNumber=1,rows="3,4",format="csv");
htmlData=Spreadsheet.read(src=theFile,rows="5-10",format="html");
queryData=Spreadsheet.read(src=theFile,sheetName="centers",format="query");
</cfscript>
<h3>First sheet row 3 read as a CSV variable</h3>
<cfdump var="#csvData#">
<h3>Second sheet rows 5-10 read as an HTML variable</h3>
<cfdump var="#htmlData#">
<h3>Second sheet read as a query variable</h3>
<cfdump var="#queryData#">
<!--- Modify the courses sheet. --->
<cfscript>
Spreadsheet.setActiveSheet(theSheet,"courses")
Spreadsheet.addRow(spreadsheetData,"03,ENGL,230,Poetry 1",8,1);
Spreadsheet.addColumn(spreadsheetData,
"Basic,Intermediate,Advanced,Basic,Intermediate,Advanced,Basic,Intermediate,Advanced",
3,2,true);
Spreadsheet.write(spreadsheetData,"#theDir#updatedFile.xls",true);
Spreadsheet.writeToCsv(spreadsheetData,"#theDir#dataFromCSV.xls",true)
</cfscript>Charles Robertson
12/01/2022, 2:53 PMcfsimplicity.
To be honest, we haven't come to a final decision yet.
We are just researching the best way to proceed.
Anyway, thanks for all the information. I will pass this on to my manager. πCharles Robertson
12/01/2022, 3:32 PMpoi.cfc in the .jar file:Charles Robertson
12/01/2022, 3:37 PMpoi-3.15.jarzackster
12/01/2022, 3:56 PMCharles Robertson
12/01/2022, 3:58 PMcfspreadsheet-lucee-5-master\extension\jars\cfspreadsheet_3.0.1.jar -> poi-3.15.jarCharles Robertson
12/01/2022, 3:58 PMzackster
12/01/2022, 3:58 PMCharles Robertson
12/01/2022, 4:05 PMCharles Robertson
12/01/2022, 4:21 PMC:\domains\<http://cfspreadsheet-lucee5-3-9_166.com|cfspreadsheet-lucee5-3-9_166.com>\wwwroot\cfspreadsheet-lucee-5-master\extension\components\org\cfpoi\spreadsheet\spreadsheet_cfc$cf.classCharles Robertson
12/01/2022, 4:22 PMzackster
12/01/2022, 4:22 PMzackster
12/01/2022, 4:23 PMCharles Robertson
12/01/2022, 4:24 PMzackster
12/01/2022, 4:24 PMCharles Robertson
12/01/2022, 4:26 PMextension\components\org\cfpoi\spreadsheet\Spreadsheet.cfczackster
12/01/2022, 4:26 PMCharles Robertson
12/01/2022, 4:26 PMCharles Robertson
12/01/2022, 4:27 PMzackster
12/01/2022, 4:27 PMzackster
12/01/2022, 4:27 PMCharles Robertson
12/01/2022, 4:35 PMCharles Robertson
12/01/2022, 4:42 PMCharles Robertson
12/01/2022, 4:43 PMzackster
12/01/2022, 5:16 PMCharles Robertson
12/01/2022, 5:50 PMCharles Robertson
12/01/2022, 6:16 PMspreadsheet.cfc
I see what you mean now.
Because I placed the org folder in the component folder [which I shall need to do when I come to package the extension], the references were incorrect.
The only error I had to fix was for:
this.javasettings.bundle = [
expandpath(".\jars")
];
I had to copy the:
C:\domains\<http://cfspreadsheet-zac-lucee5-3-9_166.com|cfspreadsheet-zac-lucee5-3-9_166.com>\wwwroot\jars\cfspreadsheet_3.0.1.jar
To:
C:\Users\cdesi\.CommandBox\server\FF98D9E0BAACD295A1A469616ACBE222-cfspreadsheetZacLucee539166\lucee-5.3.9.166\WEB-INF\lucee-server\bundles
Anyway, I now feel I have an extension that I can edit properly. π
Thank you so much for all your help.
I have no idea how you know all this stuff!
Thank god you do πzackster
12/01/2022, 6:45 PMzackster
12/01/2022, 6:46 PMzackster
12/01/2022, 6:47 PMzackster
12/01/2022, 6:49 PMCharles Robertson
12/01/2022, 11:32 PMcfspreafsheet
It will all come down to how many references we use in the codebase. I havenβt actually got access to the codebase yet [after 5 weeks: donβt ask π΅βπ«]
If we decide to use cfsimplify, I may update cfspreadsheet in my own time.Charles Robertson
12/02/2022, 10:22 AMcfspreadsheet-lucee-5/lar/org/cfpoi/spreadsheet
Encounters an empty string.
The fix is based on:
https://stackoverflow.com/questions/43005125/using-ben-nadel-poi-to-read-excel
I will talk to LeftBower about whether he can add a link on his repo to my repo.
It seems like he no longer maintains this repository?
https://github.com/Leftbower/cfspreadsheet-lucee-5Charles Robertson
12/02/2022, 10:32 AM