ClosedXML missing formulas and format for new rows after saving - closedxml

I have an issue that is quite hard to understand, I'm going to try to explain that:
I have a template xlsx file;
There are some plans on this workbook and a table for each one;
Some columns have formulas and specific formats (colors, time, currency and so one);
If I open directly this template file and insert a new row in any table, things are going well (formulas and formats are being copied for this new row);
However, if I use Closedxml to open it and saving then, even not manipulating anything, when I open the file using Excel and add a new row to some table this new row is coming with no formulas and formats.
I have no idea what's going on and how to fix it but it's invalidating a requirement because I need to open the template, fill some tables and send to the user for download.
ClosedXML version: 0.87.0.0
Example and template file on: https://github.com/ClosedXML/ClosedXML/issues/513

The issue has been fixed on the github issue 513:
https://github.com/ClosedXML/ClosedXML/issues/513
Only need to wait the release of this fix.

Related

Creating a CSV file with the Report Generation Toolkit in Labview

I want to create .csv files with the Report Generation Toolkit in Labview.
They must actually be .csv files which can be opened with Notepad or something similar.
Creating a .csv is not that hard, it's just a matter of adding the extension to the file name that's going to be created.
If I create a .csv file this way it opens nicely in excel just the way it should, but if I open it in Notepad it shows all kind of characters and it doesn't even come close to the data I wrote to the file.
I create the files with the Labview code below:
Link to image (can't post image yet because I've got to few points)
I know .csv files can be created with the Write to Spreadsheet VI but I would like to use the Report Generation Toolkit because it's pretty easy to add columns and rows to the file and that is something I really need.
you can use the Robust CSV package on the lavag.org forum to read and write 2D arrays to CSV files.
http://lavag.org/files/file/239-robust-csv/
Calling a file "csv" does not make it a CSV file. I never used the toolkit to generate an Excel file, but I'm assuming it creates an XLS or XLSX file, regardless of what extension you give it, which is why you're seeing gibberish (probably XLS, since it's been around for a while and I believe XLSX is XML, not binary).
I'm not sure what your problem is with the write spreadsheet VI. It has an append input, so I assume you can use that to at least add rows directly to a file, although I can't say I ever tried it. I would prefer handling all the data in memory explicitly, where you can easily use the array functions to add rows or columns to the array and then overwrite the entire file.

pasting an excel grid into an HTML form and pasting it back into an excel document

A friend of mine asked me about this 2 weeks ago and I am still trying to think about the best way to solve the problem.
Apparently the users ended up with a system where they get an excel file where they
have to manually fill up a column (I am expecting a lot of data).
the user would have to the grid into an html form
Have the pasted excel rows create rows in the DB
Is there is a clean way to handle this problem? Should he write any client side to format the pasted text or should he handle it on the front end? I also worry about any mistakes made by the user pasting the wrong number of cells.
If you can't get rid of the Excel step, you could write a program that reads that Excel file and store the values in the DB.
I did some Excel processing with Apache POI in Java.

updating excel file data using vba from mysql

Is it possible to have an excel sheet that gets updated from a mysql server using a specific query when ever it gets opened using VBA?
I am new to VBA and is it possible to monitor the data changes on the excel sheet while updating the sheet??
Thanks
If you use the Data > Get External Data toolbar to set up the MySQL data pull, you can then set the workbook to refresh upon opening - Here's a link that shows the very basics.
As for tracking / moitoring changes, you'd have to be more detailed about how you'd like that to happen... As a general rule, it's not very easy to do.
Hope this helps!!

Easy method of exporting an html table to excel file in ASP.NET?

Have a report generated from the DB, want to add an export button so they can get the same report in a excel readable sheet of some type. The key here is ease of implementation so a CSV is fine over XLS if it's easier.
Excel is actually somewhat good at reading HTML. Espcially if your HTML contains just a single table. If you want to tell the browser to open the file up in excel, you can use
Response.ContentType = "application/vnd.ms-excel"
This tells the browser to open the document in Excel, instead of just rendering it by itself. There are a few problems though. I don't think it will work if somebody wants to open it with OO.org calc instead. Also, when trying to save it, it will never convert the file to a real excel file, unless the user explicity changes the file type. If it's just an intranet app for your organization, this may not be a problem. The plus side is, is that you can use colours, borders, and even formulas, which can't be done when using straight CSV.
You can use HtmlTextWriter:
System.IO.StringWriter stringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
grid.RenderControl(htmlWriter);
where grid is a DataGrid object. You can use other types of controls as well.

Updating an imported .csv in Hyperion v8.3

I have a csv imported into my Hyperion v8.3 bqy file. I have some custom columns and a pivot already created. I just want to refresh the data. In the past, I would hit Process Current and it would direct me to my computer and I could select the csv file to update from. Now it will not do that. It doesn't go to my computer at all.
Any ideas?
Eric,
I'm not a power user but I accomplish the same thing by ensuring that there is a file with the same name in the same location from which the original csv was imported and "Processing All". This allows me to update the data and import it into my bqy and automatically update any reporting based on the csv.
Don't know if this will help or not.
Dennis
dennis.van.camp#vanderlande.com
When you import a file as a Section into Hyperion, it maintains a link to the existing file for the exact path and file name. When that link is broken and that section gets a Process or Refresh command, is the only time it will prompt you for a new file. Otherwise, it will refresh the data from the existing.
So, if you want to force it to prompt you for a new file, you have to move or rename the old file.
But, you're looking for the Pivot and Computed columns to refresh. Two things on that ...
Computed Columns: You don't have to re-import the file, if the rest of your data is current. Each column can be refreshed individually by right-click, Modify, then clicking Ok. You don't have to change any of the code; just hit okay instead of Cancel.
Pivot: In the menu, you have to set your pivot options appropriately to update when you Process (when the underlying data is Processed, really), or Manually (when you Process that section).