Closed aimchina closed 9 years ago
Please show your config and Excel file.
$importer = new Importer([
'filePath' => Yii::getAlias('@backend/web/upload/234.xlsx'),
'standardModelsConfig' => [
[
'className' => ShipIng::className(),
'standardAttributesConfig' => [
[
'name' => 'ship_id',
'valueReplacement' => function ($value) {
return $value;
},
],
[
'name' => 'tender_id',
'valueReplacement' => function ($value) {
return $value ? Html::tag('p', $value) : '';
},
],
[
'name' => 'company_id',
'valueReplacement' => function ($value) {
return $value;
},
],
],
],
],
]);
please as soon as reply
Make sure there are no redundant spaces and line breaks in attribute names in Excel file.
Current standard attributes config doesn't make sense, you need to modify it according to your model..
The component is designed for user friendly filling, it's better to write actuak company names instead of ids.
Did my answer help?
I'm closing this because of missing feedback. Reopen if it's necessary.
Hi, I just had the same problem, so I proceeded to debug the library and managed to find the call to that exception; In this way I realized that in order not to fall in it the cabacera of the xlsx file must be equal to that of the attributeLabels of the model. :D
Error when preparing data for import: sheet "Tests", cell "A1". Attribute not exist.