Leftbower / cfspreadsheet-lucee-5

A cfspreadsheet extension for Lucee 5
23 stars 10 forks source link

<cfspreadsheet action="write" overwrite="true"> not working with sheetname attribute #4

Open chrisdpeters opened 8 years ago

chrisdpeters commented 8 years ago

Running Lucee 5.0.0.252 on Linux.

When calling an overwrite action on a specific sheet like so:

<!--- Slightly contrived example :) --->
<cfspreadsheet
  action="write"
  filename="/path/to/sheet.xls"
  name="spreadsheet"
  sheetname="xyz"
  overwrite="true"
>

I get the following error. It appears that the write action is ignoring overwrite="true" when attempting to update a sheet by name.

Lucee 5.0.0.252 Error (org.cfpoi.spreadsheet.Spreadsheet)
Message     Invalid Sheet Name
Detail  The workbook already contains a sheet named [02].
Stacktrace  The Error Occurred in
C:\dev\lucee\WEB-INF\lucee-server\context\components\org\cfpoi\spreadsheet\Spreadsheet.cfc: line 193
called from /opt/lucee/server/lucee-server/context/library/tag/spreadsheet.cfc: line 174
...

(I also find it somewhat strange that it's showing a Windows-style path in the stacktrace when I'm running this on Linux. 😕)

Leftbower commented 8 years ago

It appears that when Lucee creates the .lar file, it does so with an absolute path to the archive folder, rather than a relative one? I will need to investigate. There is very little in the way of documentation on creating/maintaining these files. Using the archive was the only way to get around Lucee's current inability to deploy a component into the component directory.

chrisdpeters commented 8 years ago

@Leftbower I hear you on the lack of documentation. That's why I've been relatively useless in helping out.

We may take a stab at fixing the actual error described in this issue, but I don't think it's a priority at this time.

Leftbower commented 8 years ago

Looking at the Spreadsheet.cfc source code, under the write function, the boolean argument overwrite="true" does not appear to be implemented.