Hi,
The following is my code for insert source sheet to target sheet…
public void InsertSingleWorksheet(string sourceWorkbookPath, string sourceSheetName)
{
Workbook sourceWorkbook = new Workbook(sourceWorkbookPath);
var sourceSheet = sourceWorkbook.Worksheets[sourceSheetName];
var newwSheetId = workbook.Worksheets.Add();
var newSheet = workbook.Worksheets[newwSheetId];
newSheet.Name = sourceSheetName;
newSheet.Copy(sourceSheet);
}
the original look like that… you can see rows are hidden after 34, and columns are hidden after R. image.png (8.7 KB)
However, after processing CopySheet to other work book… the row become unbidden. Columns are still hidden… We believe it is the bugs in Aspose. can you please handle this?
Please make sure that you are using Aspose.Cells for .NET v20.2.3, you may print the version number at the start for confirmation, e.g Console.WriteLine(CellsHelper.GetVersion());
I used the following sample code with your template file using v20.2.3. I have also attached the output file which is ok when I opened into MS Excel 2007/2013:
e.g Sample code:
Workbook sourceWorkbook = new Workbook("e:\\test2\\CopyExample.xlsx");
var sourceSheet = sourceWorkbook.Worksheets[1];
Workbook workbook = new Workbook();
var newwSheetId = workbook.Worksheets.Add();
var newSheet = workbook.Worksheets[newwSheetId];
newSheet.Name = sourceSheet.Name;
newSheet.Copy(sourceSheet);
workbook.Save("e:\\test2\\out1.xlsx");
I have also attached the screenshot of the copied sheet taken in MS Excel: files1.zip (8.0 KB) sc_shot1.png (74.2 KB)
After an initial test, I am able to reproduce the issue as you mentioned by using your sample code with your template files. I found by copying sheet(s) to other workbook, the hidden rows are not retained, the hidden rows are disappeared in the copied sheet. It works fine if we use new (blank) destination workbook (as per my previous code/test I shared). I have logged a ticket with an id “CELLSNET-47213” for your issue. We will look into it soon.
Once we have an update on it, we will let you know.
As we just logged a ticket, so kindly spare us little time to analyze your issue in details. If the issue is not complex, you should be getting the fix before the end of next week or so. If it is a complex issue, then it might take 2/3 weeks or more time.
Once we have any new information, we will share with you.
Good to know that your issue is sorted out in the new fix/version. We are scheduled to publish our next official release of the product (e.g Aspose.Cells for .NET v20.3) on Downloads/nuget repos. in the third/fourth week of March 2020. This new release will also include your fix.
You will also be notified in the thread once the next official release is published.
The issues you have found earlier (filed as CELLSNET-47213) have been fixed in Aspose.Cells for .NET v20.3. This message was posted using Bugs notification tool by Amjad_Sahi