humanemulator.net — справка.
Продукт, демо и покупка — на
хуманэмулятор.рф
|
Демо
|
Купить
|
API
|
лог изменений
get_cols_count
get_cols_count($path,$sheet); - Получить количество столбцов в Листе файла ExcelФункция на вход принимает параметры:
После выполнения функции возвращаемое значение будет равно одному из двух :
Пример использования
<?php $xhe_host = "localhost:7010"; // Connect functional objects if not already connected if (!isset($path)){ $path = "../../../Templates/init.php"; require($path); } // Scenario: Demonstrate getting the number of columns in a sheet // info echo "\n<span >excelDataReader->" . basename (__FILE__) . "</span>\n"; // Kill any existing Excel processes SYSTEM::$excel->kill(); // Example 1: Get number of columns in sheet 0 echo("\n\nExample 1: Get number of columns in sheet 0\n"); $filePath = "test/test.xlsx"; $sheetIndex = 0; echo("File path: $filePath, Sheet index: $sheetIndex\n"); $colsCount = SYSTEM::$excelDataReader->get_cols_count($filePath, $sheetIndex); echo("Number of columns: $colsCount\n"); // Example 2: Get number of columns in sheet 4 (error case) echo("\nExample 2: Get number of columns in sheet 4 (error case)\n"); $filePath = "test/test.xlsx"; $sheetIndex = 4; echo("File path: $filePath, Sheet index: $sheetIndex (invalid)\n"); $colsCount = SYSTEM::$excelDataReader->get_cols_count($filePath, $sheetIndex); echo("Number of columns: $colsCount\n"); // Quit the application WINDOW::$app->quit(); ?>
# Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7010" from xweb_human_emulator import * # начало echo("<hr><font color=blue>excelDataReader->get_cols_count</font><hr>") # 1 echo("1. Получим количество столбцов в 0 листе : ") echo(excelDataReader.get_cols_count("test/test.xlsx", 0)) # посмотрим app.shell_execute("open","test/test.xlsx") # Quit app.quit()
#region using using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Threading; using XHE; using XHE.XHE_DOM; using XHE.XHE_System; using XHE.XHE_Window; using XHE.XHE_Web; #endregion class Program:XHEScript { static void Main(string[] args) { // init XHE server = "localhost:7010"; InitXHE(); // начало echo("<hr><font color=blue>excelDataReader.get_cols_count</font><hr>"); // 1 echo("\n1. Получим количество столбцов в 0 листе : "); echo(excelDataReader.get_cols_count("test/test.xlsx", 0)); // 2 echo("\n1. Получим количество столбцов в 4 листе : "); echo(excelDataReader.get_cols_count("test/test.xlsx", 4)); app.quit(); } }
xhe_host = "127.0.0.1:7010"; // подключим функциональные объекты, если еще не подключен require("../../../Templates JS/init.js"); // начало echo("<hr><font color=blue>excelDataReader->get_cols_count</font><hr>"); // 1 echo("1. Получим количество столбцов в 0 листе : "); echo(excelDataReader.get_cols_count("test/test.xlsx", 0)); // посмотрим app.shell_execute("open","test/test.xlsx"); // Quit app.quit();
=============================================
excelDataReader Объекты DOM System Vision Web Window
=============================================
если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
.