I am trying to implement to Json to Excel exporting in javascript. I am using angular js. I was to able to generate Json to CSV but i cant not retain font(bold) and macros in CSV (because its csv).
Is there any opensource in the market for Json to Excel conversion by retaining font colours for the text.
There is an interesting project on github called Excel Builder (.js)
that offers a client-side way of downloading Excel xlsx files and includes options for formatting the Excel spreadsheet.
https://github.com/stephenliberty/excel-builder.js
You may encounter both browser and Excel compatibility issues using this library, but under the right conditions, it may be quite useful.
The demos on github project with less Excel options but less worries about Excel compatibility issues can be found here: ExcellentExport.js
https://github.com/jmaister/excellentexport
The demos seem to hold some promise.
http://excelbuilderjs.com/index.html
If you are using AngularJS, there is ng-csv:
a "Simple directive that turns arrays and objects into downloadable CSV files".
Related
I need to convert a XML SpreadSheet to a native Excel file (XLSX), without using MSOffice.
In particular I need to make this conversion using Javascript.
I'm searching for in "StackOverflow" web page and also in google and other portals, but I don't find nothing about it.
The XML SpreadSheet sample file is like this:
enter image description here
On the other hand, I've discovered the "excelcnv.exe" command for conversion between formats, included in MSOffice Excel installation, but just I got to convert from XLS to XLSX, but not from XML SpreadSheet to XLSX...In fact I haven't found any documentation about this "excelcnv.exe" command so I don't know if it is possible this conversion.
Also I've found about some javascript libraries like oxml.js or XLSX but I think this libraries allow create a native excel file from scratch, not convert from input files in XML SpreadSheet format.
Maybe anybody could know how do this using javascript or some javascript library.
Any help will be very welcome :)
Thanks in advance,
You need to change the file extension. From xml to xls.
Then excelcnv will convert correctly.
excelcnv.exe -oice <INPUT> <OUPUT>
In the docx4js GitHub page it is illustrated how to open a docx file and parse it. Is it possible to use this library to parse clipboard data obtained from copying some part of ms-word docx?
PS 1I think that this library is a node application for server-side use, but I want to use it in client-side!
PS 2: I partially wrote some parser for this purpose but there are many different types of structure and styling and this task is rather complicated and error prone! Is there any (javascript) library simplifying this parsing?
Is there some JavaScript or Golang lib that allows to create xlsx files using some custom heavy formatting?
I'm working on an Electron app and want to generate some reports but
the most popular library doesn't provide cell formatting, that fork looses the ability to define page properties like margins and page orientation and that Golang lib as I see doesn't provide page properties too.
Can anybody show some good alternatives or show me I'm wrong?
(no C-like langs and Python please)
I am myself looking for something similar to format docx documents and I have just started trying out gooxml.
Currently it has following capabilities for Excel:
Read/Write/Edit
Cell formatting including conditional formatting
Cell validation (drop down combobox, rules, etc.)
Retrieve cell values as formatted by Excel (e.g. retrieve a date or number as displayed in Excel)
Formula Evaluation (100+ functions supported currently, more will be added as required)
Embedded Images
All chart types
Edit to answer comment:
As stated in the documentation, you may have to fall back to raw document manipulation should the library's API not cover a specific use case.
See CT_PageMargins.go and CT_PageSetup.go for margin and orientation...
Well it seems I've learned the lesson - after trying to use "super-hard-to-understand-and-use" jsreport-xlsx module I've remembered about one lib that didn't worked in Electron renderer and tried it to work from Electron main process.
And it works! Sometime it may be a little treaky to make it create doc exactly you want but it's much better than XLSX-style I've used before and have all features I want.
(it's second [and last I believe] time I've forget about Electron renderer is not Node.js, the true Node.js is main process)
I want convert an HTML report to PDF. I know that there are so many libraries are available for this purpose. But the HTML report contains so many graphs created using Jqplot. I want to include these graphs in the PDF also. If you are familiar with any library which also convert graphs to PDF, please give me the reference.
you can use bullzip pdf printer it creates a virtual pdf printer that can transform your HTML content to a pdf file from the browser:
http://www.bullzip.com/
you can also find a lot of useful tools right there!
I don't have experience with Jqplot, but I have successfully converted html pages which contain pie charts from Google Charts (completely javascript generated) to pdf.
I used wkhtmltopdf - it's a commandline tool but there are wrapper classes for php and some others I believe.
I'm sure you could find something applicable with a bit of googling but this looks promising: https://github.com/mikehaertl/phpwkhtmltopdf
In my new Ruby on rails application I want to find the users country code.
So I am using MaxMind GeoIp. when I downloaded the gzip file after gunzip it gives me a GeoIP.dat file and I am stuck here. Can any one help.
If their is a program to open it or some procedure to use it.
Or if any one can suggest me the other way.
As #Kyle pointed out, you can download "human-readable" CSV files instead of binary DAT files. MaxMind's "GeoLite" downloads are here.
The CSV file format is described here.
But note (from the link above):
Due to the large size of geolocation databases, we generally recommend using our binary format with one of our APIs, since they are highly optimized for speed and disk space. On the other hand, if you have a requirement to import the data into a SQL database, the CSV format is recommended.
The APIs are listed here. There is no Javascript API listed, but there are a couple of options for Ruby.
So to answer your question directly: You would not "open" the dat file directly as you would a spreadsheet document. Instead you would write your own program that uses their API to read the dat file, and perform whatever tasks or queries you design it to do. Check out their API documentation for details of how you might get started with that.
.dat is just a file extension. The contents could be anything. Text. Binary data etc...
There is no way anyone could reliably tell you how to open the file.
I would attempt to view the contents of the file from the command line:
less file_name.dat
You can open the file and read line by line in ruby like this:
IO.readlines('file_name.dat').each do |line|
# do something with the line
end
Edit: I think I found the file you're refering to. Why not go here and download a csv version? The .dat version is not in plain text.