Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ExportFormat.OOXML

    Hi Isomorphic,

    please take a look at this test case (v12.0p_2019-10-06/PowerEdition Deployment (built 2019-10-06)).

    Code:
    package com.smartgwt.sample.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.Version;
    import com.smartgwt.client.core.KeyIdentifier;
    import com.smartgwt.client.data.DSRequest;
    import com.smartgwt.client.types.ExportFormat;
    import com.smartgwt.client.util.Page;
    import com.smartgwt.client.util.PageKeyHandler;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.Button;
    import com.smartgwt.client.widgets.IButton;
    import com.smartgwt.client.widgets.Window;
    import com.smartgwt.client.widgets.events.ClickEvent;
    import com.smartgwt.client.widgets.events.ClickHandler;
    import com.smartgwt.client.widgets.grid.HeaderSpan;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    public class BuiltInDS extends VLayout implements EntryPoint {
        private IButton recreateBtn;
    
        public void onModuleLoad() {
            KeyIdentifier debugKey = new KeyIdentifier();
            debugKey.setCtrlKey(true);
            debugKey.setKeyName("D");
    
            Page.registerKey(debugKey, new PageKeyHandler() {
                public void execute(String keyName) {
                    SC.showConsole();
                }
            });
    
            setWidth100();
            setHeight100();
    
            recreateBtn = new IButton("Recreate");
            recreateBtn.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    new MyWindow().show();
                }
            });
            addMember(recreateBtn);
            new MyWindow().show();
            draw();
        }
    
        private class MyWindow extends Window {
            public MyWindow() {
                setWidth(400);
                setHeight(300);
                setMembersMargin(0);
                setModalMaskOpacity(70);
                setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")");
                setShowMinimizeButton(false);
                setIsModal(true);
                setShowModalMask(true);
                centerInPage();
    
                final ListGrid exportGrid = new ListGrid();
                exportGrid.setDataSource("animals");
    
                ListGridField commonNameLGF = new ListGridField("commonName");
                ListGridField scientificNameLGF = new ListGridField("scientificName");
                ListGridField lifeSpanLGF = new ListGridField("lifeSpan");
                ListGridField statusLGF = new ListGridField("status");
    
                HeaderSpan headerSpan = new HeaderSpan("HeaderSpan", new String[] { "scientificName", "status" });
                exportGrid.setHeaderSpans(headerSpan);
    
                exportGrid.setFields(commonNameLGF, scientificNameLGF, lifeSpanLGF, statusLGF);
                exportGrid.fetchData();
    
                Button exportButton = new Button("Export_data");
                exportButton.addClickHandler(new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
    
                        final DSRequest exportRequest = new DSRequest() {
                            {
                                setExportAs(ExportFormat.OOXML);
                            }
                        };
                        exportGrid.exportData(exportRequest);
                    }
                });
    
                addMember(exportGrid);
                addMember(exportButton);
            }
        }
    }
    When I export the data, I get an error
    Code:
    === 2019-10-07 16:47:24,079 [8-32] DEBUG ExcelDataExport - Export streaming mode: true
    java.lang.IllegalStateException: Cannot add merged region B1:B2 to sheet because it overlaps with an existing merged region (B1:C1).
        at org.apache.poi.xssf.usermodel.XSSFSheet.validateMergedRegions(XSSFSheet.java:480)
        at org.apache.poi.xssf.usermodel.XSSFSheet.addMergedRegion(XSSFSheet.java:413)
        at org.apache.poi.xssf.usermodel.XSSFSheet.addMergedRegion(XSSFSheet.java:367)
        at org.apache.poi.xssf.streaming.SXSSFSheet.addMergedRegion(SXSSFSheet.java:394)
        at com.isomorphic.rpc.ExcelDataExport.outputHeaderSpans(ExcelDataExport.java:1417)
        at com.isomorphic.rpc.ExcelDataExport.outputHeaders(ExcelDataExport.java:1082)
        at com.isomorphic.rpc.ExcelDataExport.getExportObject(ExcelDataExport.java:483)
        at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:646)
        at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:452)
        at com.isomorphic.rpc.RPCManager.completeResponse(RPCManager.java:1290)
        at com.isomorphic.rpc.RPCManager.send(RPCManager.java:723)
        at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:183)
        at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:148)
        at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119)
        at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
        at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:176)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
        at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
        at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:93)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:370)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
        at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Unknown Source)
    Exported file is broken:
    Click image for larger version

Name:	OOXML.png
Views:	215
Size:	2.0 KB
ID:	259587

    Bug or not?

    Best regards
    Pavo

    #2
    This was a bug, which is fixed now and available for download in nightly builds since Oct 10 (today).

    Comment


      #3
      Hi Isomorphic,

      I can confirm that it has beed fixed in my case as well, thank you!

      Best regards
      Pavo

      Comment

      Working...
      X