ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: qfinsoft on June 10, 2015, 11:43:53 pm

Title: Export to Excel - Rendered cell values not being exported as displayed in grid
Post by: qfinsoft on June 10, 2015, 11:43:53 pm
I currently have export to excel functionality working for the most part, except for one or two issues.

First, in the case of exporting a grid to excel, where a column's cell is rendered to display text different than it's value (in this case, displays the territory name rather than territory id), it exports the id rather than the rendered text.  Is this by design?  Is there a way to export what has been rendered in the cells, rather than its stored 'value'?  Keep in mind I need to keep column filtering working

Here is the colModel for the column I am referring to:

Code: [Select]
{
                    title: "Territories",
                    width: 85,
                    dataType: "string",
                    dataIndx: "territories",
                    editable: false,
                    render: function(ui) {
                        if (ui.rowData.territories !== undefined) {
                            var terrDisplay = "";

                            for (var i = 0, len = ui.cellData.length; i < len; i++) {
                                terrDisplay += territoryLookup[ui.cellData[i]];
                                if (i+1 < len) { terrDisplay += ","; }
                            }

                            return terrDisplay;
                        }
                    },
                    filter: {
                        type: 'select',
                        listeners: ['change'],
                        labelIndx: 'name',
                        valueIndx: '_id',
                        options: localstorage.territories,
                        prepend: {"": ""}
                    }
},

On a somewhat related note, cells in other columns (not necessarily the territories column above) with empty values are currently being exported with value 'undefined'.  Is there a simple way around this little quirk as well?

Thanks!
Title: Re: Export to Excel - Rendered cell values not being exported as displayed in grid
Post by: paramvir on June 11, 2015, 12:07:44 am
1) rendered cells are not exported but only the data is exported.

2) There is property column.copy which when set to false could be used to prevent export of certain columns.

http://paramquery.com/pro/api#option-column-copy
Title: Re: Export to Excel - Rendered cell values not being exported as displayed in grid
Post by: Sunny on September 30, 2015, 08:34:30 pm
Hi,

Is there any way or workaround to export the rendered cells ? In that way it solves two issues,

1. It will prevent showing Id instead of Value(in drop-down columns) and
2. other it would prevent displaying 'undefined' where some cells are blank..

Appreciate in advance.

Regards.
Title: Re: Export to Excel - Rendered cell values not being exported as displayed in grid
Post by: paramvir on October 01, 2015, 03:43:15 pm
Currently there isn't a way to export the rendered cells.

But it has been added as an option in the upcoming version .
Title: Re: Export to Excel - Rendered cell values not being exported as displayed in grid
Post by: Sunny on October 02, 2015, 06:37:14 am
Thank you very much.