{"id":814,"date":"2014-05-19T12:38:02","date_gmt":"2014-05-19T12:38:02","guid":{"rendered":"http:\/\/mindfusion.eu\/blog\/?p=814"},"modified":"2021-01-14T11:09:58","modified_gmt":"2021-01-14T11:09:58","slug":"mindfusion-spreadsheet-import-and-export","status":"publish","type":"post","link":"https:\/\/mindfusion.dev\/blog\/mindfusion-spreadsheet-import-and-export\/","title":{"rendered":"MindFusion.Spreadsheet: Import and Export"},"content":{"rendered":"<p>The following scheme illustrates the file formats supported by MindFusion.Spreadsheet for WinForms:<\/p>\n<p><a href=\"http:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2014\/05\/spreadsheet-formats.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-815\" src=\"http:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2014\/05\/spreadsheet-formats-300x244.png\" alt=\"spreadsheet-formats\" width=\"300\" height=\"244\" srcset=\"https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2014\/05\/spreadsheet-formats-300x244.png 300w, https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2014\/05\/spreadsheet-formats.png 895w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><strong>Importing<\/strong><\/p>\n<p>MindFusion.Spreadsheet can load data from CSV (comma-separated values), XLSX (Office Open XML), ODS (OpenDocument Spreadsheet), and its native binary and XML formats. The files are imported through a set of importer classes: CsvImporter for CSV, ExcelImporter for XLSX, and CalcImporter for ODS. To import a file, create an instance of the respective importer class, set the necessary properties, and call its Import method. The following code demonstrates how to import a workbook from an existing XLSX file:<\/p>\n<pre>var excelImporter = new ExcelImporter();\nexcelImporter.Import(workbook, @\"d:\\workbook.xlsx\");<\/pre>\n<p>Importing from CSV can be further facilitated through the use of a built-in CsvImportForm. The form provides the user interface to enter various options and preview the data before it is actually imported.<\/p>\n<p><strong>Exporting<\/strong><\/p>\n<p>MindFusion.Spreadsheet can export data to a variety of formats, including image, PDF, CSV, XLSX, ODS, HTML and MHTML. In addition the workbooks can be previewed and printed to paper and XPS. The workbooks and worksheets are exported through a set of exporter classes: ImageExporter for images, PdfExporter for PDF, CsvExporter for CSV, ExcelExporter for XLSX, CalcExporter for ODS, HtmlExporter for XHTML, and so on. Printing is done through the WorkbookPrinter class. To export a workbook, create an instance of the respective exporter class, set the necessary properties, and call the Export method. The following code demonstrates how to export a workbook to ODS:<\/p>\n<pre>var calcExporter = new CalcExporter();\ncalcExporter.Export(workbook, @\"c:\\mysheet.ods\");<\/pre>\n<p>The following image illustrates a workbook exported to an XHTML file using the HtmlExporter class:<\/p>\n<p><a href=\"http:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2014\/05\/spreadsheet-xhtmlexport.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-818\" src=\"http:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2014\/05\/spreadsheet-xhtmlexport-300x240.png\" alt=\"spreadsheet-xhtmlexport\" width=\"300\" height=\"240\" srcset=\"https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2014\/05\/spreadsheet-xhtmlexport-300x240.png 300w, https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2014\/05\/spreadsheet-xhtmlexport-1024x819.png 1024w, https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2014\/05\/spreadsheet-xhtmlexport.png 1280w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Additional information about the importing and exporting capabilities of MindFusion.Spreadsheet can be found in the online documentation of the component:<\/p>\n<p><a href=\"http:\/\/www.mindfusion.dev\/onlinehelp\/spreadsheetwinforms\/index.htm?Importing.htm\">http:\/\/www.mindfusion.dev\/onlinehelp\/spreadsheetwinforms\/index.htm?Importing.htm<\/a><br \/>\n<a href=\"http:\/\/www.mindfusion.dev\/onlinehelp\/spreadsheetwinforms\/index.htm?Exporting_0.htm\">http:\/\/www.mindfusion.dev\/onlinehelp\/spreadsheetwinforms\/index.htm?Exporting_0.htm<\/a><\/p>\n<p>The trial version of MindFusion.Spreadsheet for WinForms can be downloaded from here:<\/p>\n<p><a href=\"https:\/\/mindfusion.dev\/SpreadsheetTrial.zip\">Download MindFusion.Spreadsheet for WinForms Trial Version<\/a><\/p>\n<p><em>About MindFusion.Spreadsheet for WinForms<\/em>: A powerful .NET spreadsheet component with great capabilities for editing, styling and formatting large amounts of data.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following scheme illustrates the file formats supported by MindFusion.Spreadsheet for WinForms: Importing MindFusion.Spreadsheet can load data from CSV (comma-separated values), XLSX (Office Open XML), ODS (OpenDocument Spreadsheet), and its native binary and XML formats. The files are imported through &hellip; <a href=\"https:\/\/mindfusion.dev\/blog\/mindfusion-spreadsheet-import-and-export\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[163],"tags":[171,165,31,97,219,136,218,173,30,220,164,166,192,217,172],"class_list":["post-814","post","type-post","status-publish","format-standard","hentry","category-spreadsheet","tag-csv","tag-excel","tag-export","tag-html","tag-image","tag-import","tag-mhtml","tag-ods","tag-pdf","tag-png","tag-spreadsheet-2","tag-workbook","tag-worksheet","tag-xhtml","tag-xlsx"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3RlKs-d8","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/posts\/814","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/comments?post=814"}],"version-history":[{"count":6,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/posts\/814\/revisions"}],"predecessor-version":[{"id":2492,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/posts\/814\/revisions\/2492"}],"wp:attachment":[{"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/media?parent=814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/categories?post=814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/tags?post=814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}