House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Converting this java code into cfscript?

  << Previous Post |  RSS |  Tree View |  Sort Latest First |  Subscribe to this Group Next >> 

Converting this java code into cfscript?

Hi, Richard White 06/09/2012 11:09 AM
> CellRangeAddress cellRangeAddress = sheet.getMergedRegion(i); Leigh 06/09/2012 05:54 PM
See <A HREF="http://pastebin.com/M5CNshBp" target="_blank" rel="nofollow">http:/ Leigh 06/09/2012 05:59 PM
Thanks Leigh, made a lot of sense and works perfect!! Richard White 06/12/2012 07:23 AM

06/09/2012 11:09 AM
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
06/09/2012 05:54 PM
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
06/09/2012 05:59 PM
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
06/12/2012 07:23 AM
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
<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 20, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference