ExcelLibrary has been superseded by the exceptional EPPlus - epplus. Jan updates it regularly. Have been using it and it is one of the finest open source projects we've worked with. It should be noted that ExcelLibrary has a lot of performance issues when dealing with large datasets larger than rows with lots of columns.
Currently doing a heavy modification of the code base at work so we can use it in a project. Use the Dispose method of this interface to explicitly release unmanaged resources in conjunction with the garbage collector.
The consumer of an object can call this method when the object is no longer needed. What about ClosedXML? I may prove to be useful in your projects. I tried ExcelLibrary, all it could do was produce a 'corrupted file', nothing fancy just 3 columns, small file. Excel wouldn't open. Tried the automatic file generation rom DataTable. Show 5 more comments. License is now LGPL, release notes here: epplus. The examples were helpful.
I was able to change my code from using Microsoft interop library horribly slow to this library version 4. My benchmark writes a file with two tabs and about , cells. Using MS interop it took 13 minutes. Using EPPlus it took 10 seconds, a roughly 80x speedup. Very happy! You only need to open source changes you make to ClosedXml or if you directly put the source code as opposed to referencing the ClosedXml assemblies inside of your application then you need to open source your application.
Paul Chernoch: We populate large Excel sheets with interop very quickly. The secret is to do a bulk update. Create a object [,] block, populate that, then write that matrix to Excel at one time: excelWorksheet. Show 2 more comments. But certainly the easiest and fastest solution which works for me.
Just a heads up that v2. This means you have to know the XML structure of an Excel file, which is very complicated. It's much easier to use a wrapper such as EPPlus, mentioned above, which simplifies things. Using the solutions above, Especially Vincent Tom's sample Poly Math , it's easy to build a writer that streams through big sets of data, and writes records in a manner similiar and not too much more complex to what you'd do for CSV; but that you're instead writing xml.
And you can always rename them from. Show 3 more comments. Take a look at my blog posts: Creating Excel spreadsheets. Does work well for populating an existing template. Can someone confirm if this works when running in x64? I am pretty sure Jet only works if your app is compiled or running in bit mode.
Be very careful with this -- it's a big ugly cludge for example, sometimes it guesses a column type and discards all the data that does not fit. One should be very careful if using this method. I've found it very flaky for data that isn't in a perfect format. It sometimes is not able to retrieve a cell value just because it couldn't understand the format. It doesn't have a delete operation. It works totally different and unpredictable even with a slightest provider change.
I'd say go for a proven commercial solution. You have a great product but I think a lot of people here are expecting free solutions. That might explain the down votes. I had a hard time with it and eventually switched to ExcelLibrary. Definitely true.
My only concern, compared to NPOI for example, is performance, e. It's so ad hoc but it works not to mention excel issuing a warning on opening and is so simple, it deserves to have a place as a solution. Though only for showing that you can export an excel file : — Luka Ramishvili. This solution worked fine for me, just note you cannot use.
Some people at my organization can't open excel files made this way in Office and above. An even more lightweight version is to just create a csv file, which Windows associates with Excel.
Add "Sample Sheet" ; worksheet. Cell "A1". SaveAs "HelloWorld. I tried using this in a project that builds pretty large Excel sheets. Excellent library, but extremely poor in performance. It works fine. You might be impressed if you haven't tried them. Please be warned of Microsoft's stance on this: Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component including ASP, ASP.
But you have to make sure that you dispose of everything manually, otherwise you will leak memory — MagicKat. Ricky B: Also, in my experience with the interop is that it does use excel. Every time we used it, if Excel wasn't installed on the machine, we would get COM exceptions.
WooCommerce Product bundles Plugin Allows shop owners to create impressive sales deals or discounts for combined group products or individual items. Import your WordPress website content into other languages and add to pages, posts, wc-products, etc,.
Try our live demo here Request a free trial by visiting here and Click Try Now option to generate your own WordPress test environment. Super buggy. Support was good but there are other software that accomplish the same thing at a less expensive price and don't have any bugs. Get WPAllImport instead. Very useful software with incredibly fast and knowledgable support. I had an issue and went on the support chat. Literally within 5 minutes, the support engineer Allan James had logged in to my backend, spotted the error, completed the import and reported back to me with future instructions.
This company has just raised the bar for real-time support. I'm still speechless. The plugin works wonderfully for what we needed it to do with the exception of one piece. After a brief conversation with support, they were able to provide a solution! Great support - very responsive. Very good plugin to work with which you can import everything from Drupal to WordPress.
Super fast support and very customer friendly. Super fast support, it was not an exchange of letters, but a chat I like it when support is not too lazy to make a video explanation just for me. The main thing is that the plugin solves my problem beautifully and is not afraid of high loads. Good luck to you! Thank you! Contributors smackcoders Smackcoders Support. Interested in development? Changelog 6. Added: WP Custom field widget in advanced mode Fixed: Default custom field case sensitive issue in create wp custom field widget 6.
Added: Recommended addon setup page. Fixed: single row xml import. Fixed: Page template import. Posts,Pages,Comments,Categories and Archives. Added: Seperate Media Handling Section. Fixed: CSV Headers with whitespace issue. Added: Support for navigation menus. Added: Comment reply support. Added: Import featured-image based on ID.
Fixed: post-format import issue Fixed: Deprecated: Non-static method 6. If user have not installed the exporter plugin, It contains the download link. Improved: UI — In plugins page inside csv importer. If a plugin is installed show it as already installed.
Fixed: : Timer not stopping after import issue. Modified: Changed video url in documentation. Added: Header Manipulation fields can now hold static text content along with any CSV header content. Added: Media upload section to import Image from computer. Added: progress bar for desktop upload. Fixed: : WordPress core custom fields issue.
Fixed: : Post slug import in drag and drop method. Added: Compatibility for WordPress 4. Removed: Export 5.
Fixed: : data loss when page refresh export. Fixed: : warning during Upload. Fixed: : user export above records. Fixed: : Custom Field Suite issue. Fixed: : Forced quotes issue. Added: Ultimate member plugin support for Users Import. Fixed: : Issue with Post format.
Fixed: : Month order in dashboard charts. Fixed: : Issue in duplicate handling to skip the duplicate records. In this example, we will work with the Northwind example. The Northwind example is available in this URL:. There are collections of data like Categories, CustomerDemographic, Customers, etc. For example the following URL will show the data of the categories collection:.
Add new zappysys json driver. Press OK. OData properties json driver. Our ZappySys driver is a very intuitive tool and you can write queries to data like a simple database table. It is also valid to comment code. The following example shows how to comment a single line the where clause :. Check this article to learn more.
Here is a sample command line. You can automate it via Scheduled Job e. Viewing XSL results in Firefox. For this reason, it is not yet practical to rely on browser support for XSLT in a real-world website. What happens if you need to transform your own XML document into an XML document that meets the needs of another organization or person?
Not to worry — XSLT will save the day! You see, Web browsers only supply collapsible tree formatting for XML documents without style sheets. XML documents that result from a style sheet transformation are displayed without any styling at all, or at best are treated as HTML — not at all the desired result. There are several things that need to be added to your style sheet to signal to the browser that the document is more than a plain XML file, though.
Here we have declared a default namespace for tags without prefixes in the style sheet. Next up, we can flesh out the output element to more fully describe the output document type:.
Internet Explorer for Windows displays XHTML documents in Quirks Mode when this declaration is present, so by omitting it we can ensure that this browser will display it in the more desirable Standards Compliance mode. The rest of the style sheet is as it was for the HTML output example we saw above. Now, we need to identify exactly what we need for our news items, binary files, and Web copy.
We must also manage and track site administrators using XML. Compared to our article content type, news will be fairly straightforward. We will need to track these pieces of information:. The easiest way to keep track of copy is to treat each piece a little like an article. An XML document that tracks a piece of Web copy will look like this:. We will need to keep track of each administrator on the site, as these are the folks who can log in and make changes to advertisement copy, articles, news pieces, and binary files.
After that, you should have enough of a working knowledge of XML and its wacky family to really start development. In fact, in many contexts, consistency can be a very beautiful thing. Remember that XML allows you to create any kind of language you want. In many cases, as long as you follow the rules of well-formedness, just about anything goes in XML.
However, there will come a time when you need your XML document to follow some rules — to pass a validity test — and those times will require that your XML data be consistently formatted. What we need is a way to enforce that kind of rule. A DTD document type definition is a tried and true if not old-fashioned way of achieving consistency. Each of these technologies contains lots of hidden nooks and crannies crammed with rules, exceptions, notations, and side stories.
Speaking of side stories, did you know that DTD actually stands for two things? It stands not just for document type definition, but also document type declaration. The declaration consists of the lines of code that make up the definition. As for the first question, many possible answers spring to mind:.
Using a system to ensure consistency allows your XML documents to interact with all kinds of applications, contexts, and business systems — not just your own. The way DTDs work is relatively simple. A DTD might look something like this:. Those of you who are paying attention should have noticed some remarkable similarities between this DTD and the Letter to Mother example that we worked on in Chapter 2, XML in Practice. In fact, if you look closely, each line of the DTD provides a clue as to how our letter should be structured.
This is called an element declaration. You can declare elements in any order you want, but they must all be declared in the DTD. A DTD element declaration consists of a tag name and a definition in parentheses.
These parentheses can contain rules for any of:. In this case, we want the letter element to contain, in order, the elements to , from , and message. As you can see, the sequence of child elements is comma-delimited.
In fact, to be more precise, the sequence not only specifies the order in which the elements should appear, but also, how many of each element should appear. In this case, the element declaration specifies that one of each element must appear in the sequence. If our file contained two from elements, for example, it would be as invalid as if it listed the message element before to. How will you do that? With a neat little system of notation, defined in Table 3. Table 3.
After the letter declaration, we see these three declarations:. So whenever you see this notation in a DTD, you know that the element must contain only text. This notation allows the paragraph element to contain any combination of plain text and b , i , u , and highpriority elements.
Note that with mixed content like this, you have no control over the number or order of the elements that are used.
What about elements such as the hr and br , which in HTML contain no content at all? These are called empty elements, and are declared in a DTD as follows:. Remember attributes? An attribute declaration is structured differently than an element declaration. For one thing, we define it with! Also, we must include in the declaration the name of the element that contains the attribute s , followed by a list of the attributes and their possible values.
Basically, this attribute can contain any string of characters or numbers. In DTD-speak, this means that the attribute is optional. Instead of allowing any arbitrary text, however, the DTD limits the values to either male or female. If, in our document, an actor element fails to contain a gender attribute, or contains a gender attribute with values other than male or female , then our document would be deemed invalid.
The actorid attribute has been designated an ID. In DTD-speak, an ID attribute must contain a unique value, which is handy for product codes, database keys, and other identifying factors. In our example, we want the actorid attribute to uniquely identify each actor in the list.
The ID type set for the actorid attribute ensures that our XML document is valid if and only if a unique actorid is assigned to each actor. Incidentally, if you want to declare an attribute that must contain a reference to a unique ID that is assigned to an element somewhere in the document, you can declare it with the IDREF attribute type. An entity is a piece of XML code that can be used and reused in a document with an entity reference. There are different types of entities, including general, parameter, and external.
General entities are basically used as substitutes for commonly-used segments of XML code. For example, here is an entity declaration that holds the copyright information for a company:. Parameter entities are both defined and referenced within DTDs. What this says is that each of the elements paragraph , intro , sidebar , and note can contain regular text as well as b , i , u , citation , and dialog elements. Not only does the use of a parameter entity reduce typing, it also simplifies maintenance of the DTD.
External entities point to external information that can be copied into your XML document at runtime. For example, you could include a stock ticker, inventory list, or other file, using an external entity.
An external DTD is usually a file with a file extension of. First, you must edit the XML declaration to include the attribute. This will search for the letter. If the DTD lives on a Web server, you might point to that instead:. Finally, XML Schema provides very fine control over the kinds of data contained in an element or attribute. Most of the criticism aimed at XML Schema is focused on its complexity and length.
Okay, now you know a lot more about DTDs than you did before. The first thing you do is you take a look at the dozens of corporate memos you and your colleagues have received in the past few months. After a day or two of close examination, a pattern emerges. Although your first impulse might be to run out and create a sample XML memo document, please resist that urge for now.
Because these memos are internal to the company, and there may be a need for a separate external memo DOCTYPE, you decide to use internalmemo as your root element name:. The first element — the root element — is internalmemo. This element will contain all the other elements, which hold date, sender, recipient, subject line, and all other information.
Because these represent a lot of elements, it would be useful to split your document into two logical partitions: header and body. The header will contain recipient, subject line, date, and other information. The body will contain the actual text of the memo.
In DTD syntax, the above declaration states that our internalmemo element must contain one header element and one body element. Next, we will indicate which elements these will contain. In DTD syntax, the above declaration states that the header element must contain single date , sender , and recipients elements, an optional blind-recipients element, and then a subject element. In DTD syntax, the above declaration states that the body element must contain one or more para elements, followed by a single sig element.
Most of the other elements will contain plain text, except the para elements, in which we will allow bold and italic text formatting. That was simple enough. Those pieces of information are hardly ever displayed on a document — they are used only for administrative purposes.
In any case, we want to be able to control the data that document creators put in for values such as priority. The best way to store these pieces of information is to add them as attributes to the root element. To do that, we need to add an attribute declaration to our DTD:. The result should look a lot like Figure 3.
Figure 3. Validating our first case with Dreamweaver MX. Do you see how, under Results, it reads No errors or warnings found.? In Dreamweaver MX , the results list for a valid document is simply empty, and the status bar beneath the list reads Complete. What happens if some things are out of place? What would happen then? Error resulting from a bad attribute value. Notice that Dreamweaver MX tells you where the problem lies with a specific line number and provides a description of the problem.
The validator catches that too, as you can see in Figure 3. Error resulting from a misplaced element. Again, the validator gives you a line number and a description that can lead you to resolve the problem. All you need to do is put the sender element back in the prescribed order, and the document will validate once more.
In that case, we embedded the DTD right into the file. You now have a reusable DTD that you can apply to other internal memos. We now understand articles, news stories, binary files, and Web copy, and are well on our way to completing the requirements-gathering phase of the project — we can start coding soon! If you recall, we are tracking author, status, keyword, and other vital information in separate files.
That is, each individual article, news story, binary file, and Web copy file keeps track of its own keywords, status, author, and dates. If we wanted to display all documents for a certain author, we would have to dig through all of our files to find all the matches.
Never fear — I have a proposal that will solve this problem. In fact, the rest of this chapter will be devoted to tackling this issue.
0コメント