Paul,

    If you look at Workbook.java in the src folder line 49 you will that the
the constructor is
protected the class is not. Luckly the Workbook class has static methods you
can call directly line 283 says public static WritableWorkbook
createWorkbook(){} therefore you can bypass the protected constructor.
Jexcel only works because of its static methods however not all class have
these. Nice try however.


On 7/23/06, Paul Hastings <[EMAIL PROTECTED]> wrote:
>
> Dan Plesse wrote:
> > Try the jexcel API with Spikes example and then try JavaLoader.cfc and
> you
> > will find that Workbook only with works my CFC.
>
> works for me:
>
> <cfscript>
> paths=listToArray("c:\inetpub\wwwroot\testCF\excel\jxl.jar");
> loader=createObject("component", "cfc.JavaLoader").init(paths);
> outFile = createObject("java",
> "java.io.File").init("c:\inetpub\wwwroot\testCF\excel\test.xls");
> workBook=loader.create("jxl.Workbook").createWorkbook(outFile);
> labelObj=loader.create("jxl.write.Label");
> numberObj=loader.create("jxl.write.Number");
> sheet=workBook.createSheet("First Sheet", 0);
> thisLabel=labelObj.init(0,0,"happy happy gizmo");
> sheet.addCell(thisLabel);
> thisNumber=numberObj.init(0, 1, 3.1459);
> sheet.addCell(thisNumber);
> workbook.write();
> workbook.close();
> </cfscript>
>
> if you're talking about andy khan's cool jxl lib, the Workbook class
> isn't protected.
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:247432
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to