Create a class like ExtractorFactory.java so that we can use POIFS effectively.
Thanks & Regards,
N.Murali Krishna.
Same goes for CreateCell
You did something wrong. I have no idea why you got this wired issue. This must not be a bug.
Not a issue. User error
string filepath = localpath + FileUpload1.FileName; // For XLS/XLSX extension
FileUpload2.PostedFile.SaveAs(filepath);
HSSFWorkbook hssfwb;
using (FileStream file = new FileStream(filepath, FileMode.Open, FileAccess.Read))
{
//here hit the error hssfwb = new HSSFWorkbook(file);
}
Forgot to add on, I am using VS2010, C#, .Net 4.0
Please make sure that you open with the correct namespace. For xls, you must use HSSF. For xlsx, you must use XSSF. The error occurs because you are trying to open xlsx with HSSFWorkbook. Instead, XSSFWorkbook should be used.
Not a bug
It looks a bin file of PrintSetup is not generated correctly in the current version of POI as well as NPOI. I'll try to fix it. This is confirmed as a bug
I would look at it myself but can't persuade CodePlex's SVN viewer to show me anything but the main 1.2.5 tree?
Hello, is there any particular reason to have this 'design'? For some users, this looks like a constraint anyway.
Thanks for your great work.
Hello
I'm having the same problem, but I can not solve it, this is the error log I have...
Managed Debugging Assistant 'BindingFailure' has detected a problem in 'c:\MyWork\Projects\exes\DataAnalysis.exe'.
Additional Information: The assembly with display name 'NPOI.OpenXmlFormats.XmlSerializers' failed to load in the 'LoadFrom' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'NPOI.OpenXmlFormats.XmlSerializers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1' or one of its dependencies. The system cannot find the file specified.
File name: 'NPOI.OpenXmlFormats.XmlSerializers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1'
=== Pre-bind state information ===
LOG: User = xxx\xxx
LOG: DisplayName = NPOI.OpenXmlFormats.XmlSerializers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL
(Fully-specified)
LOG: Appbase = file:///c:/MyWork/Projects/exes/
LOG: Initial PrivatePath = NULL
Calling assembly : System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: NPOI.OpenXmlFormats.XmlSerializers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL
LOG: Attempting download of new URL file:///c:/MyWork/Projects/exes/NPOI.OpenXmlFormats.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///c:/MyWork/Projects/exes/NPOI.OpenXmlFormats.XmlSerializers/NPOI.OpenXmlFormats.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///c:/MyWork/Projects/exes/NPOI.OpenXmlFormats.XmlSerializers.EXE.
LOG: Attempting download of new URL file:///c:/MyWork/Projects/exes/NPOI.OpenXmlFormats.XmlSerializers/NPOI.OpenXmlFormats.XmlSerializers.EXE.
This is my code...
using namespace NPOI::HSSF::UserModel;
using namespace NPOI::XSSF::UserModel;
using namespace NPOI::SS::UserModel;
using namespace NPOI::OpenXmlFormats;
...
IWorkbook^ book;
book = gcnew XSSFWorkbook(stream);
And I have all the DLLs referenced including NPOI.OpenXmlFormats.dll, I tried with the Alpha 2.0 release. My project is being compiled with .Net 3.5 using Visual C++ Express version.... as reference, I tried other library and also complains with the XML libraries (not using this one) so, there may be an issue with some XML patch or security setting....
When I try to list all members in the NPOI.OpenXmlFormats.dll I only see the namespaces:
Vml
Wordprocessing
Noting like XmlSerializers... as if this namespace or class were not included in the library...
Regards...
What's the detailed exception?
No workaround for now. We will try to optimize this issue in NPOI 2.1 or later version.