Announcement

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

  • svashi
    replied
    Hello Isomorphic,

    Thanks for the fix for second problem.
    But in export file - the column titles are named as internal field names instead of field titles (localized)
    I have tried to set the PropertyIdentifier in sample code :
    dsRequestProperties.setExportPropertyIdentifier(PropertyIdentifier.TITLE);
    but it doesn't work.

    Thanks in advance.

    Regards,
    Sonia

    Leave a comment:


  • Isomorphic
    replied
    We were not able to reproduce the first issue in 5.0 either, so please try again using the latest code of this version. Also, the fix for the 2nd issue has been backported to 5.0. So, please try the next nightly build, dated May 23.

    Regards
    Isomorphic Software

    Leave a comment:


  • svashi
    replied
    Hello Isomorphic,

    I forgot to mention, but we use version 5.0 -p<20171110>.
    Could you port back the solution for second problem to 5.0 as well?
    Can you reproduce the first issue for version - 5.0? If it is reproducible, Could you please also provide a fix for it?

    Thanks in advance.

    Regards,
    Sonia

    Leave a comment:


  • Isomorphic
    replied
    We were not able to reproduce your first issue. Please, try again with a more recent build. Moreover, we've applied a fix to solve the 2nd issue. So, please try the next nightly build, dated May 22.

    Regards
    Isomorphic Software

    Leave a comment:


  • svashi
    started a topic Client-side export with custom formatting

    Client-side export with custom formatting

    Hello, Isomorphic. We stumbled upon a problem when trying to do some custom formatting in client side export.


    We are using client side formatted export, I checked the showcase example “com.smartgwt.sample.showcase.client.dataintegration.java.others.FormattedExportSample”.

    But our case is little bit different - we are using DataSource.fetchData() and manually set this data to listGrid.setData() in success callback. The DataSource.fetchData() is invoked onClick event of the button “LoadData” button that I have added to the sample and fetch Data based on some criteria.
    The problems that we face are:

    1. The cell formatters are not being invoked for export. I am using a CellFormatter for unitPriceField , it works for grid, but not for export :
    ListGridField unitPriceField = new ListGridField("unitPrice");
    unitPriceField.setAlign(Alignment.RIGHT);
    unitPriceField.setWidth(64);
    unitPriceField.setAlign(Alignment.RIGHT);
    unitPriceField.setCellAlign(Alignment.RIGHT);
    unitPriceField.setExportRawValues(false);
    final NumberFormat numFormatter = NumberFormat.getFormat("###,###,###.000");
    unitPriceField.setCellFormatter(new CellFormatter() {
    public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
    double price=record.getAttributeAsDouble("unitPrice");
    return numFormatter.format(price/10);
    }
    });
    What we want to show in export the “value”, where value = someCustomizedFormatter(fieldValue/10) ; so is there any other way that we can customize formatting the data for export?
    I also checked the “setExportFormat()” method, but it is using a fixed format string, it can’t be used for complex calculations.

    2. The other problem is with ListGridField, which is not being shown in the grid but has to be shown in the export. If these field is shown in grid, only then it is being displayed in export, otherwise not.
    The idea is we want to show some different fields in export other than showing in grid.
    In sample code I made the orderDateField.setHidden(true);
    And tried to use setExportFields() in sample code
    dsRequestProperties.setExportFields(new String[]{"orderID", "itemID", "unitPrice", "orderDate", "itemTotalField"}); but in export it is showing only "orderID", "itemID", "unitPrice", "itemTotalField"

    You can find the changed showcase sample in attachments.
    Thanks in advance for your support.

    Best regards,
    Sonia

    Attached Files
Working...
X