I'm trying to figure out what is going awry with my use of XSLF.
It doesn't seem to be a POI issue per se, but maybe some weird interaction 
between libraries or calls?
I can't really figure out where to look.

The situation: I am providing a netbeans module for use within a commercial 
software (STARCCM) that itself is implemented using netbeans.
When using POI to create a pptx with tables, the content is not be added 
correctly. For testing, I am using a simple bit of common code (see below), but 
the results depend on how I call it.

If I call the PoiTests. runTest() method from a SystemAction (eg, from a menu 
or top component), the table gets generated with content (no issues). If, 
however, I use dynamically compiled and loaded java (they call it NeoScript) to 
call the code, the table gets generated but without any content. It gets even 
weirder though. If I use dynamic code to simply open a top component that 
embeds the original SystemAction, the table is generated but without content!.
It appears that involving the NeoScript mechanism anywhere in the calling chain 
it somehow influences the behavior of POI (maybe xmlbeans?) and inhibits proper 
filling of the table content. 

I can unfortunately not simply avoid the dynamic code bits, since these are my 
only entry point for interacting with STARCCM for batch processes. I've 
contacted the vendor (cdadapco), but they couldn't provide any answers at the 
moment.

Does anyone have any ideas or even guesses about what might be going on here? 
What could be going on behind the scenes within POI that could even slightly 
explain this behaviour? I naturally suspect xmlbeans, but for no reason other 
than everything about it is a mystery to me.

Thanks in advance for any guesses, hints, suggestions, etc.
Maybe someone has experienced similar odd interactions with other software that 
might help put me on the right path.

/mark

-----

public class PoiTests
{
    public static void runTest(String outputName)
    {
        System.out.println("run test with output to " + outputName);
        XMLSlideShow ppt = new XMLSlideShow();
        XSLFSlide slide = ppt.createSlide();
        tableTest0(slide.createTable());

        try
        {
            FileOutputStream os = new FileOutputStream(outputName);
            ppt.write(os);
        }
        catch (IOException ignore)
        {}
    }

    public static void tableTest0(XSLFTable table)
    {
        final int ncols = 4;
        final int nrows = 2;

        table.setAnchor(new Rectangle2D.Double(100, 100, 0, 0));

        for (int rowI=0; rowI < nrows; ++rowI)
        {
            XSLFTableRow row = table.addRow();

            for (int colI=0; colI < ncols; ++colI)
            {
                XSLFTableCell cel = row.addCell();
                cel.addNewTextParagraph().addNewTextRun().setText
                (
                    "r" + rowI + " c" + colI
                );
            }
        }
    }
}

This electronic transmission (and any attachments thereto) is intended solely 
for the use of the addressee(s). It may contain confidential or legally 
privileged information. If you are not the intended recipient of this message, 
you must delete it immediately and notify the sender. Any unauthorized use or 
disclosure of this message is strictly prohibited.  Faurecia does not guarantee 
the integrity of this transmission and shall therefore never be liable if the 
message is altered or falsified nor for any virus, interception or damage to 
your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to