Copy worksheets lost header and footer - closedxml

My web application use ClosedXML to work with Excel files.
I'm trying to copy worksheet using an Excel template with header and footer, but in the result they don't appear. Only the data and cells appear. I use this method to copy my sheet.
IXLWorksheet sheet_new = sheet_old.CopyTo("Sheet_new");
Can you help me out?

This has already been fixed on commit 76008. Pick that one from Source Code or wait for the next release.

Related

SSIS Copy files task does not copy custom date column

Well, I am facing one weird issue with Copy Files task i SSIS.
I have folder A in which I have sub folders and I am using Copy files task to copy all the Excel files in sub-folders to the folder A. I noticed that with some of the excel files where I have custom date column which is restricted by list to select dates from as I don't want user to input wrong date/format.
When I run the package the excel file is copied but that date column is not getting populated.
I am not getting the reason why its happening.
Can some one help? What approach I should follow to resolve it?
So, what I did is in place of Copy file from the drop down of the component I selected move file and ran it once. And then again I ran with Copy command and it some how worked. I am not happy this though. I have put in a solution at the end of SSIS package where after the files are loaded to SQL table I am deleting them from the source folder using looping component.
For now it seem to be working. but exact reason for not copying the particular custom date field is still a question.

ClosedXML missing formulas and format for new rows after saving

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.

Add headers to multiple text files SSIS

I have a process that I want to create in SSIS. What I have so far is below.
So the scenario is that a number of different file types are downloaded to a specific location - which has been created as a variable "RootFolder"
Within that RootFolder, is a folder called "Archive"
The first part of the process is to create a folder within the variable of ArchiveFolder, which is basically todays date.
Then in a For Loop Container, it copies all the files in the RootFolder to the Archive Folder. So we have a history of the files received.
The next step that I want to carry out in SSIS is to add a header line at the top of each of those text files. So all the files that still exist in the Root Folder get a header added to the top of the file. Is there something direct in SSIS to do this, or would I need a .bat file to do it and have an Execute Process Task, to call that bat file. Either way I have no idea how to achieve this bit. Your help will be appreciated.

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!!