Git Product home page Git Product logo

exporter's People

Contributors

alex-marchenko avatar binbalenci avatar haijian-vaadin avatar haiwan avatar simpletasks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

exporter's Issues

Custom grid column header text, for vaadin flow grid

Column header text in exported excel is different from set column header text in vaadin grid.
Exporter in current state use column key to find property and use property name.
I added proposal for custom column headers in exported excel in pull request #24
Tested with vaadin 13.

Use Exporter as Action.Handler on a table

Hello,

Thanks for this addon, it is really great.

I don't want to add a specific button on the bottom of my view, so I would like to add ExcelExporter as Action.Handler(right click) of my Table. Do you know a way to achieve that?

Thanks!

Error on null nested properties

The Exporter 2.0.2 go to error when the column of the grid has nested property ("town.name" for example) and first property is null (town == null for example). The vaadin grid 8.9.3 permits it with NestedNullBehavior.ALLOW_NULLS option:

example:
column = grid.addColumn("town.name", renderer, NestedNullBehavior.ALLOW_NULLS);

Encoding problem

Encoding of CSV is differently by OS. Now for Linux - UTF-8, for Windows - ANSI. I want to same encoding for all OS. How to set own encoding format to content of CSV?

Null Pointer

Hi I get an error if I don't provide the visible colums.
(see stack trace). If I provide them, I just get an empty file.
Could you please help.$
thx

java.lang.NullPointerException
at org.vaadin.haijian.filegenerator.FileBuilder.buildColumnHeaders(FileBuilder.java:80)
at org.vaadin.haijian.filegenerator.FileBuilder.buildFileContent(FileBuilder.java:70)
at org.vaadin.haijian.filegenerator.FileBuilder.getFile(FileBuilder.java:53)
at org.vaadin.haijian.Exporter.getStream(Exporter.java:101)
at com.vaadin.server.StreamResource.getStream(StreamResource.java:141)
at com.vaadin.server.FileDownloader.handleConnectorRequest(FileDownloader.java:140)
at com.vaadin.server.ConnectorResourceHandler.handleRequest(ConnectorResourceHandler.java:83)

Problem set dateformat Exporter

There is a problem with setting the setting of the dateformat of the exporter.
The dateformat is used in the fileBuilder but when you initialise the exporter with the data container the filebuilder is created and the method 'setDateFormat' does not update this filebuilder, thus this dateformat is not used.
ex.

This will not work:
excelExporter = new ExcelExporter(table.getContainerDataSource(), table.getContainerDataSource().getContainerPropertyIds().toArray());
excelExporter.setDateFormat("dd-MM-yyyy");

This works:
excelExporter = new ExcelExporter();
excelExporter.setDateFormat("dd-MM-yyyy");
excelExporter.setContainerToBeExported(table.getContainerDataSource());// here the fileBuilder is created and the dateformat of this builder is set!!!
excelExporter.setVisibleColumns(table.getContainerDataSource().getContainerPropertyIds().toArray());

Kind regards,
Erik

NullPointerException in setDownloadFileName method

I downloaded latest 0.0.5.5 plugin, included in my Report view and upon runnin, I am getting this error. Can someone explain me why am I getting this issue? It sees getDownloadFileName method is having some issue?

Caused by: java.lang.NullPointerException
at org.vaadin.haijian.Exporter.setDownloadFileName(Exporter.java:106)
at com.prod_dc.views.LoginView$1.selectedTabChange(LoginView.java:166)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)
... 59 more

Possible conflict with POI Libraries

Export throws an Exception in exportAsExcel :

java.lang.NoSuchMethodError: org.apache.poi.ss.usermodel.Font.setBoldweight(S)V
at org.vaadin.haijian.ExcelFileBuilder.getBoldStyle(ExcelFileBuilder.java:82)
at org.vaadin.haijian.ExcelFileBuilder.buildColumnHeaderCell(ExcelFileBuilder.java:76)

mabe due to the fact that there is another depebdency POI ( 3.17 ) on my Classpath.

Can't export from sub-context

My application isn't pure Vaadin, so some are mapped to something else, and some for Vaadin

That's my web.xml:

default
org.apache.catalina.servlets.DefaultServlet

debug
1


listings
true

<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>/log_in</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>/Styles/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>/Images/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>/Scripts/*</url-pattern>
</servlet-mapping>

<servlet>
    <servlet-name>EpaymentUI</servlet-name>
    <servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
    <init-param>
        <description>Vaadin UI class to use</description>
        <param-name>UI</param-name>
        <param-value>com.gizasystems.stcepayment.ui.EpaymentUI</param-value>
    </init-param>
</servlet>
<servlet-mapping>
    <servlet-name>EpaymentUI</servlet-name>
    <url-pattern>/VAADIN/*</url-pattern>
</servlet-mapping>

now each time i call the exporter i always get this error:

com.vaadin.server.VaadinServlet serveStaticResourcesInVAADIN
INFO: Requested resource [/VAADIN/APP/connector/1/42/dl/exported-excel.xls] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.

what should i do?

How do you show Grid/Table Column header in proper format?

Hi,

One thing I noticed is that this add-on does not allow proper heading to be exported in .pdf or excel format... For example

if I have column with name Sample 1 Sample 2 ... Sample 10 Sample 11 then it displays:
Sample 1 Sample 10 Sample 11 Sample 2 ... and so on.

How do you avoid such sorting?

Can we do something like this:
excelExport.setColumnSorting(false); ??

NPE in FileBuilder class

In Exporter there is the constructor with one argument - Container container. This calls the constructor with two arguments - Container container, Object[] visibleColumns , with null value for visibleColumns. In this constructor, the call this.setContainerToBeExported(container) , eventually creates the FileBuilder and ends up in the setContainer(container) method which also set's the visibleColumns. Then in the same constructor you set again the visibleColumns, to null this time, because it is the value passed in as parameter.
This leads to NPE in FileBuilder in methods like buildColumnHeaders, where you check the length on the visibleColumns array which is in fact null - if (this.visibleColumns.length != 0) .

My solution:

    public Exporter(Container container, Object[] visibleColumns) {
        this();
        this.setCaption("Exporter");
//set visible columns first
        this.setVisibleColumns(visibleColumns);
//then, the container
        this.setContainerToBeExported(container);
    }

Vaadin 8- ExporterOption

I am running Vaadin 8 and using version 2.0.2 I export a grid in Excel. I also use ExporterOption as indicated in the release notes. However, it does not work as inclined. More specifically, I am not able to change the name of the column in the exported excel file, whatever I try.

V7 fix issue where downloading could use cache instead of refreshed data in screen

If you are on a table or grid and export it to Excel, it works fine. If you then refresh the data in the grid/table, it often downloads the same exact file. Even setting the name using setDownloadFileName("newname.xls"); does not work because by that time the FileDownloader is already created and will never get refreshed until you leave the screen and come back. Since fileDownloader is private, I cannot call fileDownloader.setCacheTime(0); to get around this issue, as per vaadin/framework#10909. I think the simplest solution would be to change this from private to protected. I am pretty sure if it was protected, I could sub-class it and just call fileDownloader.setCacheTime(0); to get around the issue. Is that possible, or am I missing something?

Check how it works with CrudGrid

The filter in DataCommunicator is null when buildRows method is called even though I have set filter in grid and can see a CrudFilter in the DataProvider while debugging.

Invalid Pom

Your pom for version 0.0.5.4 has a version "0.0.3.1":
0.0.3.1

This made our artifactory cache repository go crazy.

export date column type not an Excel date type, but a General type

Is there a way to export dates as dates to Excel? I am not talking about the format of the date, as MM/DD/YYYY, which the API already handles. I am talking about the resulting Excel. Right now, the data type is "General" when you right click the cell in Excel, unless you actually edit the date column. Once you edit it, it is in the proper Excel "Date" type, and is right justified in the Excel Cell.

In the code, we have setDateFormat("MM/dd/yyyy");, so the Excel looks correct. It is purely the Excel column type that is the problem.

BTW, using version 1.0.1 for a Vaadin 7 application.

I attached the screen I am exporting, with a date column, and the corresponding excel export, to explain what I mean.
OpenConsumptionScreen

exported-excel-20211015155230.xls

V7 compatibility mode

Are there plans to make a V7 compatibility mode for those converting from Vaadin7 to Vaadin8?

Support Vaadin 8

Any plan to support Vaadin 8 Grid?
I am looking for the export functionality Vaadin 8 Grid data to the comma delimited file.
If no plan for supporting Vaadin 8 Grid soon, then any other suggestion?

Jennifer.

Problem generating PDF export of columns with format

I'm generating a PDF export of a table with multiple columns and for some strange reason some of the exported cells have values like "com.vaadin.ui.Label@5d25c914" instead of the correct value.

I noticed that this behavoir occurs before a formatted column (date format or amount format) and causing the cells to shift so they don't correspont to their column headers.

Excel export works correctly.

2014-12-01_11-33-25

2014-12-01_11-34-38

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.