Announcement

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

    Excel export not working with the latest nightly

    Code:
    @Override
    
    public void onModuleLoad() {
    
    
    
    
            final VLayout vlayout = new VLayout();
    
    
    
    
            final ListGrid lg = new ListGrid();
    
            ListGridField nameField = new ListGridField("f_name", "name");
    
            lg.setFields(nameField);
    
            lg.setDataSource("simpleTable");
    
            lg.fetchData();
    
    
    
    
            IButton but = new IButton("click me");
    
            but.addClickHandler(new ClickHandler() {
    
    
    
    
                @Override
    
                public void onClick(ClickEvent event) {
    
                    DSRequest properties = new DSRequest();
    
                    properties.setExportFilename("Export");
    
                    properties.setExportAs(ExportFormat.XLS);
    
                    properties.setExportDisplay(ExportDisplay.DOWNLOAD);
    
                    lg.exportData(properties);
    
                }
    
            });
    
    
    
            vlayout.addMember(lg);
    
            vlayout.addMember(but);
    
            vlayout.setWidth100();
    
            vlayout.setHeight100();
    
            vlayout.draw();
    
    
    
    
        }
    If you click on the "click me" button you get an empty excel file. Using smartgwt 6.1-p20180215 power

    For completeness: (although it should be reproducible with any datasource)
    Code:
    <DataSource ID="simpleTable" serverType="sql" tableName="t_schueler">
    
    
    
    
    <fields>
    
    <field name="f_schueler_id" type="sequence" primaryKey="true" />
    
    <field name="f_name" type="text" />
    
    </fields>
    
    
    
    </DataSource>
    Last edited by edulid; 15 Feb 2018, 07:20.

    #2
    If this were reproducible with any DataSource, our online samples wouldn't work, right? Can you point to some setting that is not used in the samples that you believe is the problem?

    Comment


      #3
      Hi Isomorphic,

      as my simple testcase works before the upgrade to the newest smartgwt version and it does not work after the upgrade, my first thought was that something was broken with the framework.
      After testing again in the builtinds project, I discovered that the new smartgwt nightly needs a newer version of apache poi. I had version 3.9 and smartgwt uses 3.17. After upgrading apache poi, the code is working again. My apologies.
      As I am using maven, I thought apache poi was a smartgwt dependency, but examining the transitive dependencies I see it isn't.

      Thanks,
      edulid

      Comment

      Working...
      X