There are too many examples how to create EXCEL file, like this:
create Excel with xPages
But I really need Excel xlsx format not xls. Just defining xlsx file extension and change content type doesn't help:
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
Vlad,
Setting the content type to xls or xlsx has the same effect: it tells the browser to hand over to Excel. It still would send HTML that excel renders.
It is up to the user to save as xlsx.
If you really need a ready made xlsx you need to create an XAgent that renders the binary xlsx format. The easiest way is Apache POI library, which is available for XPages through OpenNTF.
Check the samples there. They should do what you need.
Related
I'm new to Excel Web Add-Ins and want to figure out if it's possible to make an add-in that can export a custom file.
I've looked around and all I find are Excel specific commands like Workbook.SaveAs() but I can't find anything on making custom export functions. I need to convert the file into XML but a specific XML setup and so, I could just work the data before I save it to XML. But again, can't find much of anything to suggest that this is supported.
How would I go about writing a file to disk from Excel that isn't just the Workbook?
There's no such API to support exporting custom file to disk. It seems we can have workaround to do this work, this workaround just works for excel online.
Please see this link:
How to create a file in memory for user to download, but not through server?
The closest thing there is for what you want to do is:
Office.context.document.getFileAsync(Office.FileType.Compressed, (result) => {
const file = result.value;
// do whatever ...
});
The file variable in this case contains the entire document in Office Open XML (OOXML) format as a byte array.
I'd like to allow users to view Microsoft Excel files by browser and choose data from it's sheets for further manipulation. How to do it?
I tried http://oss.sheetjs.com/ but showing data is not working for sheets with a lot of number data and merged cells, for example for this file: http://stat.gov.pl/download/gfx/portalinformacyjny/pl/defaultaktualnosci/5502/11/13/1/wyniki_finansowe_podmiotow_gospodarczych_1-6m_2015.xlsx
Have you tired http://viewerjs.org?
You will need to save your excel file as ODP. You can do this by save-as the excel as "OpenDocument Format".
What's the correct way to export an HTML table as an Excel file so that the user can click a button and download the Excel file (ideally using Angular and without using server)?
I've seen many answers like this:
Export to xls using angularjs but doing this gives an error similar to the following:
"The file format and extension dont match... The file could be corrupted..."
and I believe the file is actually in HTML or XML format, not actual Excel.
The warning does not present a good image to the user.
What's the right way to actually export a file as Excel without using the server?
Or is the server required to create the file?
If you are just using tabular data, then I would argue that the best solution would be building a CSV file. This could be natively opened by excel and converted into an XLS file if necessary. You can do so by arranging your data with a data URI. The octet-stream will force a file download rather than opening in browser. Here is an example:
CSV
It is asked to me to do a small excel to pdf conversion.
Let me describe what is exactly to be done.
in excel file there are list of companies which looks like this...
and to retrieve a company name turn into this in PDF format, like this...
I am thinking to follow a path...
1-using php and js I will get excel file with "input type=file"
2-using pdf reader php script I will retrieve the data required.
After this I am confusing...
3-I can retrieve data by searching and parsing a company name( for example getting an input: "company:A") till next keyword of "company" for all columns
or should I put all data from excel into CSV file and do the parsing part there???
4- after that, I am thinking to use, one of the tcpdf example methodologies however here comes another confusing point for me... because I don't know which type of output should get from excel or csv and load into pdf converter method.
An enlightening path would be appreciated since I am confused
Regards
Build your Data on HTML format first then if you got the correct display on html then you can now convert it to a PDF file.
I am trying to export self updating .xls file from other website to mine as csv, so that I will be able to create "Live data graphs" using Highcharts JS for different parameters from this , which also update automatically according to the file.
OR
I have another method, same self updating data is on a website in form of table which gets updated with time. So , is it possilble to pull data from there for specific parameters and generate live data graphs?
Please Help.....
How about using a Google spreadsheet?
http://dataist.wordpress.com/2012/11/23/using-google-spreadsheet-as-a-database/
If I got you right, you want to convert an .xls file to .csv ?
Then you'll want to look at this article:
http://www.c-sharpcorner.com/uploadfile/yuanwang200409/how-to-convert-xls-file-into-csv-file-in-c-sharp/
As well as consider some answers on SO:
Is there any simple way to convert .xls file to .csv file? (Excel)
C# converting .xls to .csv without Excel
Personally I like the solution to extract .xls into dataset and then generate you .csv from datatble. (see c# datatable to csv)