Hi Libin, I've got some bad news for you.  I've been talking with Andy about the Ptg records.  Apparently that whole formula package is considered experimental and is being disabled completely in the 1.5 release.  This means I can't apply your patch yet and is probably the cause of some of the problems I've had. 
 
We are just waiting for the current dev build to be tested further by our users then 1.5 full release should be right to go and the formula stuff will be readded (although it will still be experimental and subject to change).
 
Sorry for the inconvenience.
 
Regards,
 
Glen Stampoultzis  (TriNexus Pty Ltd)
+63 3 9753-6850     0402 835 458
ICQ:  62722370    EMail:  [EMAIL PROTECTED]
----- Original Message -----
Sent: Thursday, April 18, 2002 7:07 PM
Subject: Re: Named Ranges

Hi,
 
Here I did some small Named Range Example
 
        POIFSFileSystem fs  = null;
        HSSFWorkbook wb     = null;
        try {
            fs = new POIFSFileSystem(new FileInputStream("c:\\1.xls"));
            wb = new HSSFWorkbook(fs);
        } catch (FileNotFoundException ex){
        } catch (IOException ex){
        }
       
        file://Getting NAmed Range
        HSSFName namedRange1 = wb.getNameAt(0);
        //Getting it sheet name
        String sheetName = namedRange1.getSheetName();
        //Getting its reference
        String referece = namedRange1.getReference();
       
        //Creating new Named Range
        HSSFName newNamedRange = wb.createName();
       
        //Getting Sheet Name for the reference
        sheetName = wb.getSheetName(0);
       
        //Setting its name
        newNamedRange.setNameName("RangeTest");
        //Setting its reference
        newNamedRange.setReference(sheetName + ".$D$4:$E$8");
       
       
        try {
            FileOutputStream fileOut = new FileOutputStream("c:\\1.xls");
            wb.write(fileOut);
            fileOut.close();
        } catch (FileNotFoundException ex){
        } catch (IOException ex){
        }
 
 I hope its says it all :))
 
                                                        Libin Roman
----- Original Message -----
Sent: Wednesday, April 17, 2002 5:02 PM
Subject: Re: Named Ranges

Okay, I have applied that patch to my local copy.  Unfortunately the patches did not contain unit tests, documentation or examples so I'm adding those and it will not be available until that's finished.  Thanks for your work... looks good so far.
 
Regards,
 
Glen
 
----- Original Message -----
Sent: Tuesday, April 16, 2002 5:33 PM
Subject: Named Ranges

Hi ,
 
I have sent the Named Ranges patch to the bugzilla.
Hope to see it soon in the cvs :)))
 
From HSSFWorkbook you can create a new named range. From HSSFWork you can get the HSSFName (high level of named range) by name or by index , which from you get get the reference or to set it.
 
 
 
                                                    Hope you like it :)),
                                                        Libin Roman
 

Reply via email to