Author Topic: Possible bug exporting to Excel with Copy:False and Hidden:True  (Read 3516 times)

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Possible bug exporting to Excel with Copy:False and Hidden:True
« on: November 24, 2016, 01:21:33 am »
I'm finally getting round to updating to version 3.3 and using the improved Excel export features, but I may have spotted a bug.

With this grid column model...

   var colDetail = [
      { title: "pick_part_id", minWidth: 75, maxWidth: 100, dataType: "integer", dataIndx: "pick_parts_id", resizable: false, copy: false, editable: false, hidden: true },
      { title: "picklist_id", minWidth: 75, maxWidth: 100, dataType: "integer", dataIndx: "picklist_id", resizable: false, copy: false, editable: true, hidden: true },
      { title: "Part Number", cls: 'bold_column', minWidth: 250, dataIndx: "partnumber", editable: true },
      { title: "Part Name", cls: 'bold_column', minWidth: 300, dataIndx: "partname", editable: false },
      { title: "Qty Per", minWidth: 100, dataType: "integer", dataIndx: "pickqtyper", align:"center", editable: true },
      { title: "Last Modified", minWidth: 175, dataIndx: "pick_parts_modified", align:"center", editable: false, dataType:"date" }
   ];

... I get four columns exported, which is fine because the first two column definitions have "copy: false".  However Excel hides its first two of the four (partnumber and partname) because it's taking the "hidden: true" definition from my non-copied columns (pick_part_id and picklist_id).  I've tested this two ways so far, first by setting 'hidden:false' on the picklist_id and then Excel only hides partnumber; and second I modified your "Local Export" demo http://paramquery.com/pro/demos/export_local adding

            { title: "Hidden Data", width: 130, dataIndx: "HiddenData", copy: false, hidden: true },
 
at the top of your definition.  With this changed, and then export to Excel, Excel hides the ContactName column.

Assuming I'm not simply doing something wrong...can you offer a workaround for this?

Many thanks.

Tony

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6126
    • View Profile
Re: Possible bug exporting to Excel with Copy:False and Hidden:True
« Reply #1 on: November 24, 2016, 05:48:52 pm »
Your observation is correct, thanks for reporting the issue.

I would let you know when its fix is available.

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Re: Possible bug exporting to Excel with Copy:False and Hidden:True
« Reply #2 on: November 24, 2016, 07:26:08 pm »
A workaround has just dawned on me and it seems to work...

Simply move the columns with copy:false and hidden:true to the bottom of the colmodel list and the export to Excel can't pick up the hidden definition by mistake.  All exported columns are immediately visible in Excel.

Thanks.

Tony

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Re: Possible bug exporting to Excel with Copy:False and Hidden:True
« Reply #3 on: December 09, 2016, 02:25:07 am »
You possibly already spotted this related bug...

The export to Excel also displays the wrong column widths having included all defined column widths even those with Copy: False.  This is very noticeable when exporting a grid that uses the first column as a dropdown/details control.  This column is traditionally very narrow (only displaying triangle icon), but this column width is used for the first exported data column.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6126
    • View Profile
Re: Possible bug exporting to Excel with Copy:False and Hidden:True
« Reply #4 on: January 11, 2017, 08:40:32 pm »
This issue has been corrected in v3.3.5