DataTables export to CSV but maintain styling / force formatting - excel

Using datatables and the tabletools plugin which works.
I am however looking for a way to also export the styling of the table if this is possible?
I am creating an 'online' version of a commonly used excel sheet used in my company. Users keep on messing up the formulae / deleting rows etc and although I can create something much simpler and maintainable in the browser, its needs to be the same styling as before once exported.
Just wondering if this is possible?
I could also use the copy to clipboard feature of tabletools if that helps the case.

CSV is a dumb format. It only knows about data and is not meant to store formatting information.
If you want to preserve the formatting, you need to export your file as XLS or XLSX (or PDF if you don't want people to edit the file).

Related

Exporting MEMO Fields From DBISAM

I have several DBISAM Database tables, I can read them and edit them. But when I export the Data to an excel spreadsheet it doesn't export the MEMO fields located in the table. Does anyone know of a way to export the MEMO fields so i do not have to open them individually and copy and paste them to an Excel spreadsheet?
I have googled my problem and have found no solution. There was one solution, to purchase an export tool from a company overseas but the website seemed sketchy to me and I am trying to find a free way to do this.
Elevated software says they cant export MEMO fields because they don't read right when importing to other programs.
I'm hoping someone has found another way...I have Tens of thousands records that I need to export so this would save me a lot of time if there were a way.
After talking with "elevate software" they indicated that this column was incorrectly setup as a memo to store images should have been setup as a BLOB type instead to properly work with images and scans. I copied the needed columns into a new temp table and altered the memo type to BLOB in the new table so as not to disrupt the old table. I then exported this table to mssql via the mssql import export wizard and the images came across correctly. I used an ssis job to then extract those to individual files and can view and work with the images as needed. It may be an extra step to goto mssql and then excel, but might work.

How do I return conditional formatting properties without adding additional rules in Excel VBA?

If a cell has conditional formatting that uses an Icon Set (my current situation is using the Traffic Light Icon Set), is there a way to identify in VBA what particular icon is showing in that cell?
The motivation behind it is that it will correspond to a red/amber/green value which I'm exporting in a SQL statement, so I need to find it in VBA.
I can add new rules and select icon sets just fine:
Set Newiconset = Range("H3").FormatConditions.AddIconSetCondition
It's returning the properties of an existing set of rules that has me hung up.
Thanks for your help - I scoured StackOverflow for a solution and couldn't find it. If someone's solved this, let me know and I'll gladly remove my question.
Bad news: what I'm looking to do technically isn't possible.
Here's why:
Excel data is stored in XML files in a main Zip file (you can experiment with this by renaming an xlsx file to zip and opening it). Inside the data is stored in XML files, and when you finally find your workbook, you can see that the data is stored as the actual conditions themselves, with the range values and such. Excel then takes those and computes the result on the fly every time you look at that file. States are not saved when saving the file unfortunately. It's worth noting though that the current state of formulas is stored - I'm assuming this is how accessing values from external workbooks is handled.
This explains why you can set and read the rules just fine, but since there's nothing officially to read a value from you can't "get" the data.

Convert richtext strings to excel

I have a form that has TinyMCE for richtext formatting. All of our data is available to export as an HTML report, PDF Report, and Excel Spreadsheet (report).
The fields, that we allow richtext in, show up as the formatted values in both the HTML and PDF reports, but in Excel we show them as strings. For instance:
<b>this part is bold</b><br />line 2 here.
I need a way to make that show up as bold/line-break in excel rather then just showing that string, or at least a way to strip the HTML tags out of there and just show plain text (though I would really like to at least keep the line breaks). Is there some type of macro I can include in the excel download or some C++ program that can convert it or something?
Thanks for your time!
I've done something similar with PHPExcel
The trick is to take your formatted data and find a pattern. In your case, it would probably be table rows/table cells. Iterate through that structure setting the excel cell values as you go. For complex formatting you could fairly simply regex replace what is necessary to get formatted as you desire. The theory may sound a little complicated, but once you get down to it, it's only an hour or two's worth of work.
Certainly there are equivalent programs based on other server technologies. But this one has worked brilliantly for me over the years, and I trust it to work on sites for very big clients with crazy inbound traffic numbers...and it's never failed. It's the only reliable way I've found to write perfect, properly formatted Excel without requiring the user to jump through hoops to get a specific browser.

Convert Excel documents to wiki markup [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last month.
Improve this question
Is it possible to convert Excel spreadsheets into MediaWiki markup? I stumpled upon strange recommendations exporting to HTML and convert it into markup. Is there a solution, maybe exporting to XML first or directly converting it?
I know of three options:
Install a WYSIWYG editor extension like FCKeditor (see also Official). Advantage: fairly easy Paste As Word (and therefore also as Excel) button. Disadvantage: installation can be tricky.
Use a macro in Excel. Advantage: a one-click creation of markup. Disadvantage: client-side solution (so need it for all users).
My preference is the FCKeditor option because once it is installed it works pretty well.
You can do this in a graphical interface, with proper software.
Install LibreOffice and add the "wiki publisher" extension, often contained in a package named libreoffice-wiki-publisher.
Open your spreadsheet with LibreOffice Calc, copy your table.
Open a new Writer document, paste with Edit > Paste special (RTF style).
Find "Export" in the menu, select "MediaWiki (txt)" in the format dropdown and confirm.
(Optional.) In your preferred text editor, remove any excess table HTML markup with a couple of simple text replacements and replace the first line {| with {| class="wikitable" to have pretty backgrounds and borders.
LibreOffice is free/open source software and is better than Excel at handling Excel's own spreadsheets, as you see. There used to be an Office plugin too but I've not heard of anyone using it recently.
You may need table styles, available in LibreOffice 5+; but in the meanwhile you can just apply CSS classes to your MediaWiki table.
Alternatively, just copy and paste your table in a page powered by VisualEditor, which is quite good for tables. If your wiki doens't have it, you could still use the MediaWiki.org sandbox: paste your rich text, click the pencil button at the top and then "wikitext/source editing", cut the wikitext and paste into your wiki.
My port of Shan Carter's Mr. Data Converter now supports the Wiki table format. You can copy & paste directly from Excel or from a CSV file.
http://thdoan.github.io/mr-data-converter/
Here is a simple python script that I threw together for my needs. This doesn't handle cell formatting or anything of that nature, but if you just need to get a large table into the MediaWiki format, it'll do the trick. It depends on xlrd.
Usage of this script is as simple as
python xl2wiki.py input.xls
If you want to save the output to another file, just do
python xl2wiki.py input.xls output.txt
MediaWiki supports HTML syntax for tables. The wikitext doesn't look nice and is harder to edit, but if you are just going to copy&paste anyway, it works. And there should be plenty of tools for converting from Excel (or CSV, ODS) to HTML.
Damn, I should find the time to add native CSV supprot to MediaWiki.
I use this macro available on the main Wikipedia site.
It convert the Excel tables to wiki formating. The output is pretty close to the original excel file. it does transfer font formating and cell colors. There is limitation on the borders but they come from mediaWiki system.
You can find the Code at :
https://de.wikipedia.org/wiki/Wikipedia:Technik/Text/Basic/EXCEL-2003_Tabellenumwandlung_VBA
It's 2021 now.
You can copy basic Excel spreadsheets directly into MediaWiki's Visual Editor.
The only thing that's missing in the copy/paste method is cell formatting.

save a cfdocument as an excel file

is there a workaround to use the cfdocument tag to save a page/file as an excel sheet instead of a PDF file?
I already have a process set up to make pdf files and email them out and would like to give my customers the option of getting an excel file instead. It would be nice if I could reuse the code I already have instead of having to rewrite it in POI or something like that.
The type of data witihn a PDF is not usually the same type of data that makes sense for Excel. That being said, there are multiple other ways to create Excel spreadhseets.
In ColdFusion 9, it's native. Just use the cfspreadsheet. In CF8... well, it looks like you have POI. So use that. ;) Ben Nadel also has a nice wrapper for POI so you can consider that too.
The thing is - you will not be able to go from CFDOCUMENT to a spreadsheet since it is really a different type of data.
In ColdFusion 9 use the cfspreadsheet tag and/or spreadsheet functions. That creates a real Excel file.
In ColdFusion 8 and below the easiest way is to use the html table > Excel hack/trick. Put your data in a standard html table, save them in a file with a .xls extension and email them to your users. When the user opens the file Excel will convert the html table to an Excel spreadsheet. You could also send the content to the browser by adding at the top of the page. With this method make sure that you are only sending an html table for best results.

Resources