|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Converting this java code into cfscript?
Author: Richard White
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:63989#351520
Hi,
I am having difficulty understanding how i would change the follower Java code
into cfscript... specifically the 'new CellRangeAddress' section:
CellRangeAddress cellRangeAddress = sheet.getMergedRegion(i);
CellRangeAddress newCellRangeAddress = new CellRangeAddress(newRow.getRowNum(),
(newRow.getRowNum() +
(cellRangeAddress.getFirstRow() -
cellRangeAddress.getLastRow())),
cellRangeAddress.getFirstColumn(),
cellRangeAddress.getLastColumn());
thanks for your help
Author: Leigh
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:63989#351522
> CellRangeAddress cellRangeAddress = sheet.getMergedRegion(i);
Just drop the data type declarations in front of the variable names. Then
instantiate classes with init() instead of "new ClassName( ...)". You may also
want to break it up for better readability. I am heading out and cannot test
this, but something along these lines:
// not tested
cellRangeAddress = sheet.getMergedRegion(i);
firstRow = newRow.getRowNum();
lastRow = newRow.getRowNum() + (cellRangeAddress.getFirstRow() -
cellRangeAddress.getLastRow());
firstCol = cellRangeAddress.getFirstColumn();
lastCol = cellRangeAddress.getLastColumn();
cellRangeAddress = createObject("java",
"org.apache.poi.hssf.util.CellRangeAddress");
cellRangeAddress = cellRangeAddress.init(
f
Author: Leigh
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:63989#351523
See http://pastebin.com/M5CNshBp . Looks like my post got cut off again ...
-Leigh
Author: Richard White
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:63989#351553
Thanks Leigh, made a lot of sense and works perfect!!
>See http://pastebin.com/M5CNshBp . Looks like my post got cut off again ...
>
>
>-Leigh
|
May 20, 2013
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||