Open svadivel0006 opened 3 years ago
Hi,
Herewith I have attached the screenshot for your reference
Regards, Vadivel Sekar
Hi,
After adding the "ExcelDataReader.DataSet", the issue was resolved.
The below mentioned code is not working, confirm whether this depreciated
Depreciated Code:
//DataSet - Create column names from first row excelReader.IsFirstRowAsColumnNames = true;
The custom code is working:
using (var reader = ExcelReaderFactory.CreateOpenXmlReader(stream)) { var config = new ExcelDataSetConfiguration() { ConfigureDataTable = (tableReader) => new ExcelDataTableConfiguration() { UseHeaderRow = true } };
var result1 = reader.AsDataSet(config);
}
Please confirm whether the logic for access the data set values should be implemented inside the method/block itself or can be accessed out of the block too
Regards, Vadivel Sekar
Hi,
Kindly find the updated issue details:
Kindly confirm the correctness, find the attachments
Regards, Vadivel Sekar
Hi,
Update to the issue.
Added a new sheet such as "Sheet1" and when the below code is executed the success message is displayed and data reading is unsuccessful.
Code: [TestClass] public class TestExcelData {
[TestMethod]
public void TestReadExcel()
{
FileStream stream = new FileStream(@"TestCreateBugXlsb.xlsb", FileMode.Open, FileAccess.Read);
//IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);
var result = excelReader.AsDataSet(new ExcelDataSetConfiguration()
{
ConfigureDataTable = (_) => new ExcelDataTableConfiguration()
{
UseHeaderRow = true,
FilterRow = rowReader => rowReader.Depth > 0
}
});
DataTable table = result.Tables["Sheet1"];
for (int i=0; i < table.Rows.Count; i++)
{
var col = table.Rows[i];
for (int j=0; j < col.ItemArray.Length; j++)
{
Console.WriteLine("Data : {0}", col.ItemArray[j]);
}
}
}
}
}
Screenshot:
Please Note: The issue occurs in ".xlsx" and ".xlsb" files
Hello Vadivel, I had customized the code for a client’s use case long back. I am no more maintaining it so you are on your own.
Thanks, Rishi Raj
From: @.> Sent: 09 September 2021 04:59 To: @.> Cc: @.***> Subject: [rishios/ExcelDataReader] ExcelReader latest version(3.7.0-develop00310) is not working (#1)
Hi,
ExcelReader latest version(3.7.0-develop00310) is not working in the Selenium C# V"4.0.0-beta4" and V4.0.0-rc1
Code:
FileStream stream = new FileStream(@"\TestCreateBugXlxs.xlsx", FileMode.Open, FileAccess.Read);
IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);
DataSet result = excelReader.AsDataSet();
==========================
Here the errors are displayed
"CS0246 The type or namespace name 'DataSet' could not be found (are you missing a using directive or an assembly reference?) TestExcelData.cs 20 Active"
and
"CS1061 'IExcelDataReader' does not contain a definition for 'AsDataSet' and no accessible extension method 'AsDataSet' accepting a first argument of type 'IExcelDataReader' could be found (are you missing a using directive or an assembly reference?) TestExcelData.cs 20 Active"
Added the below mentioned system references:
System.xml System.Data System.Data.DataSetExtemsion
Kindly update how this can be resolved
Regards, Vadivel Sekar
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/rishios/ExcelDataReader/issues/1, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGDNIJZEVW3JKTXQ74WUE53UA7WVTANCNFSM5DV4ILFQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Hi,
ExcelReader latest version(3.7.0-develop00310) is not working
Code:
FileStream stream = new FileStream(@"\TestCreateBugXlxs.xlsx", FileMode.Open, FileAccess.Read);
IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);
DataSet result = excelReader.AsDataSet();
==========================
Here the errors are displayed
"CS0246 The type or namespace name 'DataSet' could not be found (are you missing a using directive or an assembly reference?) TestExcelData.cs 20 Active"
and
"CS1061 'IExcelDataReader' does not contain a definition for 'AsDataSet' and no accessible extension method 'AsDataSet' accepting a first argument of type 'IExcelDataReader' could be found (are you missing a using directive or an assembly reference?) TestExcelData.cs 20 Active"
Added the below mentioned system references:
System.xml System.Data System.Data.DataSetExtemsion
Kindly update how this can be resolved
Regards, Vadivel Sekar