export-to-excel

how to save xls file as xlsx file using NPOI c#?

本小妞迷上赌 提交于 2020-01-03 08:36:31
问题 I'm using NPOI to open XLS file, then add some modifications to the XLS file. at the end i want to save it as XLSX file. i'm using this code to save it as XLS file: using (var fs = new FileStream(Name, FileMode.Create, FileAccess.Write)) { wb.Write(fs); } Is it possible to save this XLS file as XLSX file using NPOI in C# ? Thanks in advance for your response 回答1: It is possible in general, but not quite easy, rather it is significantly complicated task. XLS file format is handled by

Excel VBA query for a closed workbook

南笙酒味 提交于 2020-01-03 02:40:09
问题 I've been trying to adapt excel VBA queries for retreiving data from a closed workbook as an alternative option. I found a sample code online and I adjusted it as I thought to fit my needs. After frusterating few hours I can't quite figure out why it will not work. When I try to specify a table I get the error "Microsoft access database engine cannot find the object 'CompanyInFo' ... I tried replacing it with a defined name range aswell and still receive the same error. Heres the Code: Sub

Axlsx Rails. Generate .xlsx file and respond filename as json/html

一世执手 提交于 2020-01-02 10:00:24
问题 I am generating xlsx files with axlsx_rails gem. After collecting user input I am posting data to /basic_report_post.xlsx Controller action looks like def basic_report_post @config = params[:config] @data = params[:data] @filename = "#{Rails.root}/public/test.xlsx" respond_to do |format| format.xlsx { render xlsx: 'basic_report_post' } end end View file for this action basic_report_post.xlsx.axlsx wb = xlsx_package.workbook wb.add_worksheet(name: 'Data1') do |s| # Drawing columns end xlsx

Import tool Excel CSV

試著忘記壹切 提交于 2020-01-02 09:19:12
问题 I need an import tools for a web app. I've been looking around and found some, just not sure about their stability. I'm using the Zend Framework for part of the project and was hoping I could find an import tool there, since I already have the framework, but couldn't see one...am I looking in the wrong place? I would like the web users to be able to import csv, excel files into a mysql database. I'd like the tool to allow the users to select the columns of the spreadsheet/csv to match up to

How to export excel from dataset or datatable in c#?

旧时模样 提交于 2020-01-02 04:08:05
问题 I want to export data from Dataset or Data Table to Excel file in C# without using Gridview. 回答1: Get more ways : 9 Solutions to Export Data to Excel for ASP.NET I have this code but for this you need to include Excel Com Component Add reference of Microsoft.Office.Interop.Excel.dll in your project will do task for you. using Excel = Microsoft.Office.Interop.Excel; public static bool ExportDataTableToExcel(DataTable dt, string filepath) { Excel.Application oXL; Excel.Workbook oWB; Excel

JQGrid: Export Grid to PDF

Deadly 提交于 2020-01-02 00:18:12
问题 Is there any way of exporting JQGrid data to Excel/PDF. I am using SQL server 2008 R2 as database and WCF service for HTTP Request/response. Client is written using JavaScript and AJAX calls are made to interact with SQL database through WCF service. Will ' excelExport ' function of jqgrid work? Here is the code to collect Grid Data and store: enter code here function ExportExcel() { var mya=new Array(); mya = $("#PrjBudgetGrid").getDataIDs(); // Get All IDs var data = $("#PrjBudgetGrid")

Apache POI: cloning worksheets containing charts

不想你离开。 提交于 2020-01-01 16:45:12
问题 According to numerous sources, for example Limitations section on official page, probably the only good way to work with excel charts from POI is using Excel file with existing chart as a template and modify source cells used by chart. And it works great. The problem is that we need to have not only one but multiple (and we don't know how many at compile time) worksheets with the same chart but different (dynamically generated) data. Using cloneSheet(sheetNumber) is a way to duplicate a

Export HTML table to Excel JavaScript function add select file name

☆樱花仙子☆ 提交于 2020-01-01 04:19:11
问题 I have the following function that exports an HTML to excel: function generateexcel(tableid) { var table= document.getElementById(tableid); var html = table.outerHTML; window.open('data:application/vnd.ms-excel,' + encodeURIComponent(html)); } The problem is that, i can't put a specific file name to save as so the user gets something like: Do you want to save %3Ctable%20id%3D%22tableRslts%22%20tabindex%3D%2235%22%20 file? And the saved file is like: IytvT8Jo.xls.part.xls (at least in Firefox

export query result as CSV through PHP

蓝咒 提交于 2019-12-31 22:36:09
问题 Say I have stored a query in a variable called $query. I want to create small hyper link called "export as CSV" on the results page. How do i do this? 回答1: $query = "SELECT * FROM table_name"; $export = mysql_query ($query ) or die ( "Sql error : " . mysql_error( ) ); $fields = mysql_num_fields ( $export ); for ( $i = 0; $i < $fields; $i++ ) { $header .= mysql_field_name( $export , $i ) . "\t"; } while( $row = mysql_fetch_row( $export ) ) { $line = ''; foreach( $row as $value ) { if ( (

Export search results to excel in MVC 4

蓝咒 提交于 2019-12-31 07:31:24
问题 I have following controller. When i search for a specific grade i get a list. What i want is to export this result to excel. I have my export button works fine. But the only thing is that it tries to export everything in db to excel when i click on it. What i want is to export only the results. Any idea? public ActionResult Index(string searchBy, string search) { if (!String.IsNullOrEmpty(searchBy) && !String.IsNullOrEmpty(search)) { if (searchBy == "ID") { return View(db.students.Where(x =>