Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

export() produces no output #23

Open
jcardali opened this issue Jun 22, 2017 · 0 comments
Open

export() produces no output #23

jcardali opened this issue Jun 22, 2017 · 0 comments

Comments

@jcardali
Copy link

jcardali commented Jun 22, 2017

The export functionality is meant to be called by a button click from the UI, most of this code is based off of the snippets found here

export() produces no output, or at least I have found no way to identify where the output is, I've hacked around this for now with the code in the try/catch, which does indeed produce a file at the specified location

Any assistance would be very appreciated.

        Button exportBt = new Button("Export", new Button.ClickListener() {
            @Override
            public void buttonClick(Button.ClickEvent event) {
                ExportToExcelUtility<Investment> exportUtility = customExport();
                exportUtility.setSourceUI(UI.getCurrent());
                exportUtility.setResultantExportType(ExportType.XLSX);
                exportUtility.setExportWindow("_blank");
                exportUtility.export();
                //TODO: Find where this is going, verify contents
                System.out.println(exportUtility.getExportExcelConfiguration().getExportFileName());
                try {
                    File f = File.createTempFile("vaadin", ".xlsx", new File("C:\\Users\\test\\Documents\\Mako"));
                    FileOutputStream fos = new FileOutputStream(f);
                    exportUtility.getWorkbook().write(fos);
                } catch (Exception e) {
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                }
            }
        });
@jcardali jcardali changed the title export() produces no output, no data rows in output export() produces no output Jun 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant