This commit is contained in:
Stefan Hutter
2025-01-12 16:18:11 +01:00
parent 11b4f840f0
commit 1e3c169d49
79 changed files with 449 additions and 199 deletions

View File

@@ -33,6 +33,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CSVNET">
<HintPath>..\CSVNET\bin\Debug\CSVNET.dll</HintPath>
</Reference>
<Reference Include="DOCGEN">
<HintPath>..\DOCGEN\bin\Debug\DOCGEN.dll</HintPath>
</Reference>

View File

@@ -1,12 +1,16 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CSVNET;
using FastExcel;
namespace Excel_Test
{
@@ -19,14 +23,58 @@ namespace Excel_Test
private void button1_Click(object sender, EventArgs e)
{
//if (openFileDialog1.ShowDialog() == DialogResult.OK)
//{
// ExcelNet.ExcelReader reader = new ExcelNet.ExcelReader();
// var sheets = new List<string>();
// sheets = reader.Get_ExcelSheets(openFileDialog1.FileName);
// sheets.
var settings = new CSVSettings()
{
FieldDelimiter = ';',
TextQualifier = '\'',
ForceQualifiers = true
};
DataTable dt = CSVDataTable.FromFile(@"x:\exceldata.csv",settings);
//MessageBox.Show("A");
//}
var inputFile = new FileInfo(@"X:\EXCELTESTDATA.xlsx");
FastExcel.FastExcel fast = new FastExcel.FastExcel(inputFile, true);
Worksheet worksheet0 = fast.Read(1);
enuToDatatable(worksheet0);
FastExcel.Worksheet ws = new FastExcel.Worksheet();
CellRange cs = new CellRange("8", "53",53,8);
FastExcel.Cell c;
//c= (Cell)Worksheet0.GetCellsInRange(cs);
}
public static void enuToDatatable(Worksheet worksheet)
{
IEnumerator enumerator = worksheet.Rows.GetEnumerator();
int count = 0;
while (enumerator.MoveNext())
{
if (count > 0)
{
Row row = (Row)enumerator.Current;
IEnumerator enumerator1 = row.Cells.GetEnumerator();
int i = 0;
while (enumerator1.MoveNext())
{
Cell cell = (Cell)enumerator1.Current;
dt[i] = int.Parse(cell.Value.ToString());
i = i + 1;
}
}
count += 1;
}
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
74c57a91c6ba4723efc7ad435960ebf6080513dec979c73eaf543239b835ac9a
36dfd6b03b10923072099de0e6e6f0ae356f333cf5b34594e6b74a4c890326bf

View File

@@ -66,3 +66,5 @@ E:\Software-Projekte\OnDoc\OnDoc\Excel_Test\bin\Debug\vbBarcodes.dll
E:\Software-Projekte\OnDoc\OnDoc\Excel_Test\bin\Debug\vbBarcodes.pdb
E:\Software-Projekte\OnDoc\OnDoc\Excel_Test\bin\Debug\vbBarcodes.xml
E:\Software-Projekte\OnDoc\OnDoc\Excel_Test\bin\Debug\MW6.SDK.dll
E:\Software-Projekte\OnDoc\OnDoc\Excel_Test\bin\Debug\CSVNET.dll
E:\Software-Projekte\OnDoc\OnDoc\Excel_Test\bin\Debug\CSVNET.pdb

Binary file not shown.

Binary file not shown.