Re: style color does not show up in Excel, Is it working with Excel or the feature only in Gnumeric????



On Mon, Jun 09, 2003 at 11:13:20AM -0400, Yan, Charlene wrote:

However, I have a new problem I'm wondering whether you can help.
I need to put a rectangle in one of the cells.  In Excel, I add
the rectangle to a cell by first clicking the rectangle of the
drawing toolbar, and then clicking anywhere on the active
spreadsheet, and then resizing it to fit into a cell.  The
following is the only infomation I found in the file format specs
that may match what I need to do.  Here are my questions.  Is
rectangle considered as an object?  If so, what is the syntax to
put it in a cell?  Any information is highly appreciated!!!

3.13 Objects
This section records details about any objects that have been added to the
worksheet. Cell comments are represented as objects:
<gmr:CellComment Author="" Text="" ObjectBound="D4"
ObjectOffset="0 0 0 0" ObjectAnchorType="33 32 33 32"/>

The xml syntax to store the parameters for a rectangle are fairly
simple.  However, at this time Gnumeric does not save objects out to
xls (either in XL95 or XL97/2k/XP formats).  I'd suspect HSSF
doesn't either as yet.  Gnumeric's xls exporter is now strong enough
to do it, but it has never been a priority.  Its probably on the
order of a 2 hour job.

The syntax for the objects is 2 fold
1) The wrapper that specifies the object type and its position
from gnumeric/src/sheet-object.c:sheet_object_write_xml

        ObjectBound : The range of cells that contain the object (D4
                        in your example)

        ObjectOffset : A set of 4 floats that specify the offset
                    from the edge of the bounding cells.  The
                    meaning of these is dependent on the next field.

        ObjectAnchorType : A set of 4 integers that encode the type
                    of offset for each of the corners.

                typedef enum {
                        SO_ANCHOR_UNKNOWN                       = 0x00,
                        SO_ANCHOR_PERCENTAGE_FROM_COLROW_START  = 0x10,
                        SO_ANCHOR_PERCENTAGE_FROM_COLROW_END    = 0x11,

                        /* only allowed for Anchors 2-3 to support fixed size */
                        SO_ANCHOR_PTS_ABSOLUTE                  = 0x30
                } SheetObjectAnchorType;

        Direction : Some objects have inherent direction associated
                with them (eg an arrow, vs a rectangle)
            SO_DIR_UP_LEFT    = 0x00,
            SO_DIR_UP_RIGHT   = 0x01,
            SO_DIR_DOWN_LEFT  = 0x10,
            SO_DIR_DOWN_RIGHT = 0x11,

Doing the export to xls 95 is fairly simple, but painstaking.  There
were once docs available for that format.  Generating newer versions
requires wrapping the content in an 'escher' wrapper.  Which is
rather irritating.  There are some simplisitic versions of that in
place now in order to export autofilters.  So this requires a bit
more work.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]