DataGrid export to pdf and excel error showing


when exporting the error showing


1 Reply

TP Tamilarasan Paranthaman Syncfusion Team March 3, 2022 06:16 PM UTC

Hi Shuhaib,

Based on provided information, we are not able to reproduce your reported issue. Its working fine at our end. We have prepared a sample for your reference. Please check the following sample

In the getCellValue Method, we are mapping the cell values based on the column names mentioned in the GridColumn.columnName and in the buildRow method. We suspect that you are setting different names, please make sure whether you set the same name on both methods.
Code Snippet:
GridColumn(
columnName: 'Name',
label: Container(
padding: const EdgeInsets.all(8.0),
alignment: Alignment.center,
child: const Text('Name'))),
EmployeeDataSource({required List employeeData}) {
_employeeData = employeeData
.map((Employee e) => DataGridRow(cells: [
DataGridCell(columnName: 'ID', value: e.id),
DataGridCell(columnName: 'Name', value: e.name),
DataGridCell(
columnName: 'Designation', value: e.designation),
DataGridCell(columnName: 'Salary', value: e.salary),
]))
.toList();
}

We hope this helps. Please let us know if need any further assistance.


Regards,
Tamilarasan



Loader.
Up arrow icon