Examples of toFormulaString()


Examples of org.apache.poi.hssf.record.formula.AttrPtg.toFormulaString()

                    // similar to tAttrSpace - RPN is violated
                    continue;
                }
                if (attrPtg.isSum()) {
                    String[] operands = getOperands(stack, attrPtg.getNumberOfOperands());
                    stack.push(attrPtg.toFormulaString(operands));
                    continue;
                }
                throw new RuntimeException("Unexpected tAttr: " + attrPtg.toString());
            }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.MemFuncPtg.toFormulaString()

        MemFuncPtg ptgA = (MemFuncPtg)def.get(0);
        Area3DPtg ptgB = (Area3DPtg)def.get(1);
        Area3DPtg ptgC = (Area3DPtg)def.get(2);
        UnionPtg ptgD = (UnionPtg)def.get(3);
        assertEquals("", ptgA.toFormulaString(wb));
        assertEquals(refA, ptgB.toFormulaString(wb));
        assertEquals(refB, ptgC.toFormulaString(wb));
        assertEquals(",", ptgD.toFormulaString(wb));

        assertEquals(ref, nr.getAreaReference(wb));
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.MemFuncPtg.toFormulaString()

        MemFuncPtg ptgA = (MemFuncPtg)def[0];
        Area3DPtg ptgB = (Area3DPtg)def[1];
        Area3DPtg ptgC = (Area3DPtg)def[2];
        UnionPtg ptgD = (UnionPtg)def[3];
        assertEquals("", ptgA.toFormulaString());
        assertEquals(refA, ptgB.toFormulaString(eb));
        assertEquals(refB, ptgC.toFormulaString(eb));
        assertEquals(",", ptgD.toFormulaString());

        assertEquals(ref, HSSFFormulaParser.toFormulaString(wb, nr.getNameDefinition()));
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.MemFuncPtg.toFormulaString()

        MemFuncPtg ptgA = (MemFuncPtg)def[0];
        Area3DPtg ptgB = (Area3DPtg)def[1];
        Area3DPtg ptgC = (Area3DPtg)def[2];
        UnionPtg ptgD = (UnionPtg)def[3];
        assertEquals("", ptgA.toFormulaString());
        assertEquals(refA, ptgB.toFormulaString(eb));
        assertEquals(refB, ptgC.toFormulaString(eb));
        assertEquals(",", ptgD.toFormulaString());

        assertEquals(ref, HSSFFormulaParser.toFormulaString(wb, nr.getNameDefinition()));
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.NamePtg.toFormulaString()

        AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[0];
        assertEquals("externalflag", tfunc.getName());

        NamePtg tname = (NamePtg) ptg[1];
        assertEquals("FOO", tname.toFormulaString(w));
    }

    public void testEmbeddedSlash() {
        FormulaParser fp = new FormulaParser("HYPERLINK(\"http://www.jakarta.org\",\"Jakarta\");",null);
        fp.parse();
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.NamePtg.toFormulaString()

    HSSFWorkbook w = new HSSFWorkbook();
    Ptg[] ptg = FormulaParser.parse("FOO()", w);

    // the name gets encoded as the first arg
    NamePtg tname = (NamePtg) ptg[0];
    assertEquals("FOO", tname.toFormulaString(w));

    AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[1];
    assertTrue(tfunc.isExternalFunction());
  }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.NamePtg.toFormulaString()

    Ptg[] ptg = HSSFFormulaParser.parse("myFunc()", w);
    // myFunc() actually takes 1 parameter.  Don't know if POI will ever be able to detect this problem

    // the name gets encoded as the first arg
    NamePtg tname = (NamePtg) ptg[0];
    assertEquals("myFunc", tname.toFormulaString(book));

    AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[1];
    assertTrue(tfunc.isExternalFunction());
  }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.NamePtg.toFormulaString()

        fp.parse();
        Ptg[] ptg = fp.getRPNPtg();

        // the name gets encoded as the first arg
        NamePtg tname = (NamePtg) ptg[0];
        assertEquals("FOO", tname.toFormulaString(w));

        AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[1];
        assertTrue(tfunc.isExternalFunction());
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.NamePtg.toFormulaString()

    Ptg[] ptg = HSSFFormulaParser.parse("myFunc()", w);
    // myFunc() actually takes 1 parameter.  Don't know if POI will ever be able to detect this problem

    // the name gets encoded as the first arg
    NamePtg tname = (NamePtg) ptg[0];
    assertEquals("myFunc", tname.toFormulaString(book));

    AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[1];
    assertTrue(tfunc.isExternalFunction());
  }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.NamePtg.toFormulaString()

        AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[0];
        assertEquals("externalflag", tfunc.getName());

        NamePtg tname = (NamePtg) ptg[1];
        assertEquals("FOO", tname.toFormulaString(w));
    }

    public void testEmbeddedSlash() {
        FormulaParser fp = new FormulaParser("HYPERLINK(\"http://www.jakarta.org\",\"Jakarta\");",null);
        fp.parse();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.