FAQ Database Discussion Community


Convert JSON to CSV and save from browser to computer

php,json,csv,export-to-excel
I have this JSON: {"data":[{"ID":1,"br":"1-2015","kupac":"ADAkolor","datum":"2015-05-19","rok":"2015-05-21","status":"placeno"},{"ID":2,"br":"2-2015","kupac":"Milenk","datum":"2015-05-27","rok":"2015-05-28","status":""}]} How to convert this to CSV file or Exel XLS using php pdo? Also in this example: if (empty($argv[1])) die("The json file name or URL is missed\n"); $jsonFilename = $argv[1]; $json = file_get_contents($jsonFilename); $array = json_decode($json, true); $f = fopen('php://output', 'w'); $firstLineKeys = false; foreach...

Excel Get External data from Sql Server: Excel Column order rearranged

sql-server,export-to-excel,linked-server
I created a views on sql server with the following column order: Below are orders of the column when I select the view vwTable Shift_id | Client_ip | Machine_Center but when I'm going to select the views using get external data from the excel: SELECT * FROM vwTable The order...

MVC5: Create Multi-Select list of all Model Properties?

c#,asp.net-mvc,razor,model-view-controller,export-to-excel
In my MVC5 Code-First application, I am working on some Export to Excel Functionality using EPPlus. The View I'm working with is my ExportController - Index.cshtml view. The Model I'm attempting to loop through is my main Model, INV_Assets. I saw the below posted in several similar questions (checkbox just...

DataTable export to excel is not working

jquery,datatables,jquery-datatables,export-to-excel
I need my datatables to export the data to an excel file,but i am trying to use the example provided by the datatables.net.But my datatable is not responding to that functionality. I am posting my code here : <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/jquery.dataTables.css"> <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/dataTables.tableTools.css"> <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/metallic.css">...

How to write matrices from matlab to .xlsx with special formatting tables

matlab,matrix,formatting,export,export-to-excel
I have one problem with exporting matrices from Matlab to Excel. This is not a problem, but I need some formatting. I made matrices A and B and I printed them to .xlsx document. filename = 'example.xlsx'; A; sheet = 1; xlRange = 'A9'; xlswrite(filename,A,sheet,xlRange) B; xlRange2= 'B9'; xlswrite(filename,B,sheet,xlRange2) And...

How do I export dicom datasets to excel?

python,python-2.7,metadata,export-to-excel,dicom
I am still quite new to coding, and have a couple of questions. I was working on a few MRI Images with the file extension '.dcm'. I imported the 'dicom' module which allows me to extract specific parameters (such as the Patients Name Age, Type of Scan, etc.) from the...

Exporting treetable to Excel/CSV

java,export-to-excel,oracle-adf,export-to-csv
I'm trying to export a treetable to excel/CSV using this tutorial However, I can't import some stuff like: WritableSheet, WritableFont, WorkbookSettings, etc... What do I need?...

SSIS Lookup to Excel file causes export to excel destination to fail

ssis,export-to-excel
I have an SSIS package that is all tested and working fine except for one part. When I try to export data to an Excel file that was previously used in a Lookup function, it returns this error: [Excel Destination 1 [3340]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB...

I want to export any xml file to excel file (xls or tab delimited)

javascript,jquery,xml,export-to-excel,tab-delimited
I want to export any xml file to excel (xls or tab delimited). I am using Jquery to open the xml. I created a recursive function that is testing whether a node has children or not and this is where I am stuck. An example of what I would want:...

Export to Excel from GridView gives exception

c#,asp.net,gridview,export-to-excel
My code is as below : .cs file : protected void ExporttoExcel_Click(object sender, EventArgs e) { ExportGridToExcel(GridView2, "myExcel"); } public void ExportGridToExcel(GridView grdGridView, string fileName) { Response.Clear(); Response.AddHeader("content-disposition", string.Format("attachment;filename={0}.xls", fileName)); Response.Charset = ""; Response.ContentType = "application/vnd.xls"; StringWriter stringWrite = new StringWriter(); HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); GridView2.RenderControl(htmlWrite);...

Export to Excel - Issue in Chrome and Firefox

jquery,html,google-chrome,firefox,export-to-excel
I have tables and using JS to export to Excel. The <table> tag has some descriptions and class (<table class="someClassName" border="0" cellpadding="0" cellspacing="0">). When it exports to Excel, the excel file contains table's tags and values (<table> <tr> <td>value</td><td>value</td>...</tr>), which looks like a mess! However, if I remove all the...

Writing string to Excel cell doesn't work

c#,string,server,export-to-excel,read-write
I have a server that can receive messages from clients through sockets. With button 1, I open the server so I can receive strings. Then there's the ReceiveCallback: public void ReceiveCallback(IAsyncResult AR) { try { Socket socket = (Socket)AR.AsyncState; int received = socket.EndReceive(AR); if (received == 0) { return; }...

Pandas to Excel : Keep Existing Data

python,python-2.7,pandas,export-to-excel
Referencing How to write to an existing excel file without overwriting data? I tried the below code: book = load_workbook('output.xlsx') writer = pd.ExcelWriter('output.xlsx') writer.book = book writer.sheets = dict((ws.title, ws) for ws in book.worksheets) Output.to_excel('output.xlsx', "Main", index=True, header=False, startcol = pickupcol) writer.save() This is part of a loop, but I...

How to determine last row populated for a certain column in xlsxwriter?

python,export-to-excel,xlsxwriter
I want to insert 'A3' in the ws.write method call automatically by determining that 'A3' is the last row with a value in column 'A'. The method in xlxswriter below sums the values in cell A1 thru A3 and prints the sum in row 4, column A. How can I...

Is it possible to apply multiple cell formats when writing to a cell with xlsxwriter?

python,export-to-excel,xlsxwriter
I am new to xlsxwriter so any help is appreciated. I am trying to apply multiple cell formats to a cell within xlsxwriter and after looking around I did not see any information showing that this is possible but wanted to ask here and be sure. Snippet of my code:...

Export xls file using php

php,mysql,export-to-excel
I want to export data in xls file, i have done this but problem is that all data are not tab format, all data comes with ',' seprated, I did not what is wrong with my code,i have paste my code here please check and give me right solution $column...

PowerShell execute SQL Query, Formatting output to excel. Losing some data from the output

sql-server,powershell,formatting,export-to-excel
I have a sql query I am running within Powershell, that exports the results to an excel workbook with multiple spreadsheets. I have most of my issues figured out now, however I have one rather large problem. The result should return values that fill 3 columns. The query works outside...

How to transform an .txt file to .csv with Java?

java,eclipse,converter,export-to-excel
How to transform an .txt file to .csv with Java? I did a Java project where I read a .txt file, and I need to use their data to create a .csv file, how should I split the data in the variable where the text is, and how do I...

Export to Excel from stored procedure - SQL blocked

sql,sql-server,sql-server-2012,export-to-excel,export-to-csv
I have a stored procedure that I'm trying to export to excel. insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=c:\sales.xls;;HDR=YES', 'SELECT * FROM [Sheet1$]') exec des_z_test '19FDA2C7-E494-E411-80D2-0050568C3F74', 'E1AB4FD4-4C3B-E411-80D2-0050568C3F74' However, I'm getting this error. The stored procedure runs fine on it's own. I suspect the issue is from the insert statement Msg 15281, Level...

VB.NET Export to Excel with header

vb.net,datagridview,export-to-excel
I am uploading an Excel file into a datagridview. This file has a view headers (Case, Paid, Curr, Narrative1, Narrative2, Account, Grouping). However, some of these fields could be empty for whatever reason (invalid entry, case number doesn't match anything, whatever). Depending on if I can upload this line to...

MVC: after export to excel, index action result is not getting called

asp.net-mvc-5,export-to-excel
I have one MVC application, in which export to excel functionality is given. I want to redirect Index action once export is finished. I have written below code but it not redirected to index action. what i missed here ? output = new MemoryStream(); workbook.Write(output); Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}",...

Export to Excel - LINQ - Include ForeignKey values in .ToList()?

c#,asp.net-mvc,linq,export-to-excel,epplus
I am attempting to add Excel Export functionality to my MVC5/Code-First Entity Framework application via the EPPlus library. On my Export View I have filled a MultiSelectList with each of my INV_Assets model properties. These then get passed into my ExportController to designate which fields of the model are to...

Textbox data is cut off when exporting to Excel 2010 from SSRS 2008

excel,reporting-services,formatting,ssrs-2008,export-to-excel
I have an SSRS 2008 report that displays the textbox and it's content correctly in SSRS, but when I try to export it to Excel 2010 the data is cut off as seen below: http://imgur.com/49xLlRc I made sure that the CanGrow property for this textbox is set to True: http://imgur.com/MHxlhpq,paGR3aD...

Exporting html table created by PHP into excel

php,html,table,mysqli,export-to-excel
I have a html table created by PHP using mysql and I used "table to excel" JQUERY method to export it but the problem that I ran into is printed variables from mysql into this table are not exporting to excel I mean when I export the table to excel...

Export full tree to excel

java,export-to-excel,oracle-adf
I'm trying to Export a full tree to Excel and I'm having a problem. First: My tree has as least 5 levels, but I can only print two of them. I don't know why it won't print the rest of the children. Second: If a new level is added I...

Report Builder 3.0 Exporting to Excel

export-to-excel,reportbuilder3.0
I have created a layout that works just fine. However, when I export it to Excel, the data starts in column C. Another person in our department has created a different layout. When they export their reports to Excel, the data starts in column B. I've looked at both layouts...

(Coldfusion) Prevent submit button from being exported to excel with table data

coldfusion,submit,export-to-excel
I'm working on getting an html table to export to excel using coldfusion. I've got the table to export successfully but I have run into 2 problems. First, the submit button I use to initiate the export is being sent to the excel file with the table data. Is there...

How to write something to MS Excel / Word wih Java?

java,excel,export,export-to-excel
I need to export some data from my Java app to Excel or Word file. It can be tables, bars, graphs... So, what is the best way to do this? In C# I used to do it via the standard library, but I don't know how to do this in...

DataTable to Excel without special library?

c#,.net,excel,export,export-to-excel
Is there any easy way to create a Excel file from a DataTable without using special libraries like ClosedXML? I have tried the following code : using (StreamWriter sw = new StreamWriter(pathAndFilename, false)) { for (int i = 0; i < datatable.Columns.Count; i++) { colum = datatable.Columns[i]; sw.Write(colum); if (i...

Export dynamic query results to different spreadsheets in an excel file

sql-server-2012,export-to-excel
I have a validation tool that needs to be run ~300 times for various inputs. I'm planning to use a cursor to loop through all the required inputs (as the validation query is created dynamically) I've been asked to export all this information to an excel file (separated into unique...

The Zero's '0' are getting removed automatically when i am converting my HTML template to excel sheets.

python,html,django,export-to-excel,xlrd
The whole process is that i am passing lists to the html template in Django as :- def download_workbook(request): lists = family.objects.all() # your excel html format template_name = "sample_excel.html" response = render_to_response(template_name, {'lists': lists}) # this is the output file filename = "sample.xls" response['Content-Disposition'] = 'attachment; filename='+filename response['Content-Type'] =...

Error when using xlswrite in Octave

excel,octave,export-to-excel
I am trying to write a cell array to an Excel spreadsheet in Octave using the xlswrite from the io package in Octave (3.8.0, io 2.0.2 loaded, using Windows 7 64 bit). The cell array looks like this: >> pump_backlash(1:3,:) ans = { [1,1] = Machine # [2,1] = Machine_01...

Exporting to Excel from SQL Server getting error

excel,sql-server-2008,export-to-excel
I have this script that's works fine EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess' , 1 RECONFIGURE EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1 RECONFIGURE INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;hdr=yes;Database=C:\aa\Customer.xlsx;','SELECT * FROM [Hoja1$]') select a.Email from AspNetUsers a This works fine and get a column in my existing Customer.xlsx spreadsheet but when I try to...

CellStyle dataformat for XLSX

java,apache-poi,export-to-excel,xssf,poi-hssf
I have some code like : CellStyle cs2 = wb.createCellStyle(); CellStyle cs4 = wb.createCellStyle(); cs4.setDataFormat(HSSFDataFormat.getBuiltinFormat("CELL_TYPE_NUMERIC")); cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("text")); this is for creating xls reports. How do i change this code to create XLSX reports ? will the following work ? XSSFDataFormat format = (XSSFDataFormat) wb.createDataFormat(); cs2.setDataFormat(format.getFormat("text")); Please help. Thanks...

EPPlus Excel Export - All data values going into Column A for each record?

c#,asp.net-mvc,linq,export-to-excel,epplus
I am attempting to add Excel Export functionality to my MVC5/Code-First Entity Framework application via the EPPlus library and System.Linq.Dynamic. On my Export View I have filled a MultiSelectList with each of my INV_Assets model properties. These then get passed into my ExportController to designate which fields of the model...

Export many plots from a matrix from R to excel

r,excel,loops,matrix,export-to-excel
I have a matrix names df with 2 columns. AVELOX5 AVELOX7 Jan 2009 1.00000 6.00000 Feb 2009 2.00000 4.00000 Mar 2009 5.00000 3.00000 Apr 2009 34.00000 1.00000 May 2009 7.00000 2.00000 Jun 2009 6.00000 34.00000 Jul 2009 8.00000 34.00000 Aug 2009 8.00000 53.00000 Sep 2009 9.00000 6.00000 Oct 2009 4.00000...

Pandas - Writing an excel file containing unicode - IllegalCharacterError

python,unicode,pandas,export-to-excel
I have the following code: import pandas as pd x = [u'string with some unicode: \x16'] df = pd.DataFrame(x) If I try to write this dataframe as an excel file: df.to_excel("test.xlsx") Or, if I try to write this dataframe as an excel file, with utf-8 encoding: ew = pd.ExcelWriter('test.xlsx',options={'encoding':'utf-8'}) df.to_excel(ew)...

Excel file operations using interop in multithreaded C# application fails

c#,.net,multithreading,interop,export-to-excel
I've an application that automates some file related jobs. Every job is executed inside separate threads. One kind of job is exporting an Excel file to HTML format. I use Microsoft.Office.Interop.Excel namespace for this purpose. My application was working fine under Windows Server 2008 environment but we upgraded our server...

Pass all selected MultiSelectList values to MVC Controller for EPPlus Export to Excel?

c#,json,asp.net-mvc,export-to-excel,epplus
I'm attempting to add an Export() functionality to my MVC5 Code-First application using the EPPlus library. On my View I have a MultiSelectList with all the values for my main Model properties: @Html.ListBox("PropertyList", typeof(InventoryTracker.Models.INV_Assets).GetProperties().Select(p => new SelectListItem { Text = p.Name, Value = p.Name, Selected = false }), new {...

PHPExcel download file

php,angularjs,phpexcel,export-to-excel
I wanted to download an excel file generated by using PHPExcel. I followed the code from PHPExcel Force Download Issue and to no avail. After I log the data receive, my console only shows full of these symbols �.However, when I change the $objWriter->save('php://output'); to $objWriter->save('filename.xlsx'); then it just download...