Import excel file with Page_Importing event

Already when I use the code for phpmaker 2022 it works successfully:

 // Page Importing event phpmaker2022
 function Page_Importing($reader, &$options) {
 	//var_dump($reader); // Import data reader
 	//var_dump($options); // Show all options for importing
 	//return FALSE; // Return FALSE to skip import
 
 	$options["headers"] = ["Management","SectID","GENDER","School_name","SchoolID","stage","almada","alsaf",
     "alfaqrat1","alfaqrat2","alfaqrat3","alfaqrat4","alfaqrat5","alfaqrat6",
     "alfaqrat7","alfaqrat8","alfaqrat9","alfaqrat10","alfaqrat11","alfaqrat12",
     "alfaqrat13","alfaqrat14","alfaqrat15",
 
 "alfaqrat16","alfaqrat17","alfaqrat18","alfaqrat19","alfaqrat20","alfaqrat21",
     "alfaqrat22","alfaqrat23","alfaqrat24","alfaqrat25","alfaqrat26","alfaqrat27",
     "alfaqrat28","alfaqrat29","alfaqrat30",
     "percentage","percentage1","number_students","week_id"
     ];
 	$options["offset"] = 12; // Skip the first 10th records
 
 
 	return TRUE;
 }

When using the phpmaker2023 code the import failsI noticed there is a difference between codeine
phpmaker2023 :($builder, &$options)
phpmaker2022 :($reader, &$options)

 // Page Importing event phpmaker2023
 function Page_Importing($builder, &$options) {
 	//var_dump($builder); // Import data builder
 	//var_dump($options); // Show all options for importing
 	//return FALSE; // Return FALSE to skip import
 
 	$options["headers"] = ["Management","SectID","GENDER","School_name","SchoolID","stage","almada","alsaf",
     "alfaqrat1","alfaqrat2","alfaqrat3","alfaqrat4","alfaqrat5","alfaqrat6",
     "alfaqrat7","alfaqrat8","alfaqrat9","alfaqrat10","alfaqrat11","alfaqrat12",
     "alfaqrat13","alfaqrat14","alfaqrat15",
 
 "alfaqrat16","alfaqrat17","alfaqrat18","alfaqrat19","alfaqrat20","alfaqrat21",
     "alfaqrat22","alfaqrat23","alfaqrat24","alfaqrat25","alfaqrat26","alfaqrat27",
     "alfaqrat28","alfaqrat29","alfaqrat30",
     "percentage","percentage1","number_students","week_id"
     ];
 	$options["offset"] = 12; // Skip the first 10th records
 
 
 	return TRUE;
 }

You did not use the $reader argument, so the change does not affect your code, you may test if your old code still works with the latest template. If it does not work, you may follow https://discourse.hkvstore.com/t/failed-to-import/6562/1 and learn how to debug.

The code is working successfully in phpmaker2023

 // Page Importing event phpmaker2022
 function Page_Importing($reader, &$options) {
 	//var_dump($reader); // Import data reader
 	//var_dump($options); // Show all options for importing
 	//return FALSE; // Return FALSE to skip import
 
 	$options["headers"] = ["Management","SectID","GENDER","School_name","SchoolID","stage","almada","alsaf",
     "alfaqrat1","alfaqrat2","alfaqrat3","alfaqrat4","alfaqrat5","alfaqrat6",
     "alfaqrat7","alfaqrat8","alfaqrat9","alfaqrat10","alfaqrat11","alfaqrat12",
     "alfaqrat13","alfaqrat14","alfaqrat15",
 
 "alfaqrat16","alfaqrat17","alfaqrat18","alfaqrat19","alfaqrat20","alfaqrat21",
     "alfaqrat22","alfaqrat23","alfaqrat24","alfaqrat25","alfaqrat26","alfaqrat27",
     "alfaqrat28","alfaqrat29","alfaqrat30",
     "percentage","percentage1","number_students","week_id"
     ];
 	$options["offset"] = 12; // Skip the first 10th records
 
 
 	return TRUE;
 }

The import using version v2023.3.0 is now successful :

// Page Importing event
function Page_Importing(&$builder, &$options) {
	//var_dump($builder); // Import data reader
	//var_dump($options); // Show all options for importing
	//return FALSE; // Return FALSE to skip import

	$options["headers"] = ["Management","SectID","GENDER","School_name","SchoolID","stage","almada","alsaf",
    "alfaqrat1","alfaqrat2","alfaqrat3","alfaqrat4","alfaqrat5","alfaqrat6",
    "alfaqrat7","alfaqrat8","alfaqrat9","alfaqrat10","alfaqrat11","alfaqrat12",
    "alfaqrat13","alfaqrat14","alfaqrat15",

"alfaqrat16","alfaqrat17","alfaqrat18","alfaqrat19","alfaqrat20","alfaqrat21",
    "alfaqrat22","alfaqrat23","alfaqrat24","alfaqrat25","alfaqrat26","alfaqrat27",
    "alfaqrat28","alfaqrat29","alfaqrat30",
    "percentage","percentage1","number_students","week_id"
    ];
	$options["offset"] = 12; // Skip the first 10th records


	return TRUE;
}

But there is a note
I have very large records, so I do not want them to appear in the import, as in the image below

You may disable Import records with transaction option under Tools → Advanced Settings, after that re-generate ALL the script files again.

The selection has been removed as in the image below
Unfortunately, it still displays the log lines.

saleh wrote:

Unfortunately, it still displays the log lines.

That is not “log lines”, it is the import result, but it seems that it is not displayed properly in your RTL site.

There are only two problems:1- The problem of formatting from the Arabic language file, while in English the format appears successfully2- Processed 85 of 96 records from aa.xlsx (success: 85, failure: 0)
$options[“offset”] = 11; // Skip the first 10th records
I have, for example, start importing records from record No. 11
But counting records starts from record 1
Processed 85 of 96 records : 85+11=96
I hope you understand what I’m saying

Update template and try again.

Webmaster wrote:

Update template and try again.

تمت معالجة 85 من 85 سجلات من aa.xlsx (نجاح: 85, فشل: 0)It works successfully
Both problems are over
thank you