I am using Angular/Infragistics 12.0.3.
I have a data grid that runs a lot of calculations before exposing data. I am also pinning the first 5 columns as a result of the size of the grid.
The grid looks correct, but when I export it, the pinned columns contain the first 5 unpinned columns' worth of data and the last 5 columns contain the pinned column data. The column headers are in the right place, but the data is not.
Additionally, the header row is not also pinned in the export, so when scrolling down, the column headers don't stay put, as would be expected.
For the column data being in the wrong place, I suspect it is because of the "pinned" attribute I added to the column definitions. Perhaps I have named it incorrectly?
this.columns = [ { field: 'Scenario', type: GridColumnDataType.String, pinned: true, width: '250' }, { field: 'Design', type: GridColumnDataType.String, pinned: true, width: '110' }, { field: 'Family', type: GridColumnDataType.String, pinned: true, width: '80' }, { field: 'Facility', type: GridColumnDataType.String, pinned: true, width: '80' }, { field: 'Process', type: GridColumnDataType.String, pinned: true, width: '75' }, ];
I dynamically allocate other columns for the time period the data falls within:
if (this.rollup !== 'WW' ) { this.scenarioService.getCompareTimePeriods(this.scenarioWorkweeks, startIndex, endIndex, this.rollup).forEach(w => this.columns.push({ field: w, type: GridColumnDataType.Number, pinned: false, width: shorter ? '80' : '115', formatter: this.formatColumnData })); } else { for (let i:number = startIndex; i < endIndex; i++) { this.columns.push({ field: this.scenarioWorkweeks[i].name, type: GridColumnDataType.Number, pinned: false, width: shorter ? '80' : '115', formatter: this.formatColumnData }); } }
Column width and styling depend on the parameter being processed. I doubt this is cause for error in exporting Excel, though, since they come out properly in the sheet.
Hello Chris,
Thank you for contacting Infragistics Community!
After investigating this matter I have tried to replicate your scenario within the following sample. As you can observe the table within the exported excel file has the same structure as the once the igxGrid has. The column headers are aligned in the correct order and so is the data bellow them. In order to be able to assist you further could you please modify the provided sample so that it replicates the issue you’re facing and send it back to me. Having such a sample will be highly appreciated and will allow me to debug it on my side and to provide you with solution as soon as possible.
Currently freezing the columns headers has been determined to be a feature request. You can submit feature request in our GitHub repository here.
Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case.
This will give you the opportunity do directly communicate with our development team regarding the issue and get notifications whenever a new information is available.
Please let me know if you need any further assistance.
Best Regards, Martin Evtimov Associate Software Developer Infragistics, Inc.
I have expanded your sample to show the dynamic columns mentioned in my question initially. For whatever reason, the grid doesn't actually render as it does for me, and the downloaded version is as expected: empty. Please let me know what I may be doing wrong in this instance.
I have also submitted the enhancement request.
Thank you for getting back to me!
I'm glad that you find the provided fix helpful.
Thank you for using Infragistics Components.
Best Regards,Martin EvtimovSoftware DeveloperInfragistics, Inc.
I am now using 12.3 for both AG and IG.
The issue is resolved with one of the newer versions.
Thank you for the provided sample!
I have investigated this behavior further and it seems to be an issue which I have logged in our GitHub Repository. My suggestion would be to subscribe to this issue in order to get notifications whenever a new information is available. Feel free to add any additional information, or questions that you might have.
Please let me know if you need any further assistance with this matter.
Thank you for choosing Infragistics components!
Knowing that it needed to be a string could have helped me solve the issue with presentation. I was passing a number, not an object. I have fixed it with a simple ".toString()" suffix and it is publishing the downloaded grid as expected: my issue is present with pinned column data being pushed to the end of the worksheet.
Here is the updated sample. I hope you are still online to view this and lend some insight so I don't have to wait until tomorrow to make some progress again.
As you can observe within the provided sample, everything is exported as expected and it seems that the issue is caused due to some additional logic implemented on application level. Having this in mind, I will not be able to investigate the described behavior further and to provide you with solution without having a working sample reproducing the issue you are facing, which I can debug.
I have investigated the modified sample and there seems to be several issues. Probably the most noticeable one is within the grid-toolbar-pinning.component.ts file on lines 52 and 53 where you’re passing an entire objects to the filed property of the igxGridColumns which expects a string.
Please take your time to create a working sample reproducing the described issue and send it back to me for further investigation.
Thank you for logging the feature request!
Best Regards,Martin EvtimovAssociate Software DeveloperInfragistics, Inc.