We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

The Style changed after merge or add copy sheet to workbook

Hi

When I use below code to generate a new workbook, the style of some column looks much more wide. Original in one A4 paper, but in the new workbook, the print preview will show need 2 papers.

Any advise for me, thanks a lot.


foreach (Workbook tmpWorkbook in workbookList)
{
if (tmpWorkbook != null && tmpWorkbook.Worksheets != null && tmpWorkbook.Worksheets.Count > 0)
{
// workbook.Merge(tmpWorkbook.Worksheets[0]);
workbook.Worksheets.Add(tmpWorkbook.Worksheets[0].Name);
workbook.Worksheets[tmpWorkbook.Worksheets[0].Name].Copy(tmpWorkbook.Worksheets[0]);
}
}


BTW: the merge function also has the same problem, workbook.Merge(tmpWorkbook.Worksheets[0])

Hi,


Could you give us your template files to show the issues. We will check it soon.

Also, You may try our latest version:
http://www.aspose.com/community/files/51/.net-components/aspose.cells-for-.net/entry335485.aspx

if it makes any difference.


By the way, you may manually set your PageSetup and printing options for your need after you copy the worksheets or merge the books. See the topics for your reference"
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/setting-page-options.html
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/setting-print-options.html

Thank you.

Hi,


The attachment file “TestMerge.xls” can be print on one paper, but after merge, the same sheet in same PageSetup will cost 4 papers.

Below is my code, I am also check the latest version, it also has same problem.


string masterworkbookPath = @“D:\testfile\testingMaster\Master.xls”;
string outputWorkbookPath = @“D:\testfile\testingMaster\outputTestingMerge.xls”;
string parentPath = @“D:\testfile\testingMaster”;
List mergedList = new List();
mergedList.Add(“TestMerge.xls”);
// mergedList.Add(“TestMerge2.xls”);

Workbook mainWorkBook = new Workbook(masterworkbookPath);


foreach (string path in mergedList)
{
string physicalPath = Path.Combine(parentPath, path);
Workbook tmpWorkbook = new Workbook(physicalPath);
if (tmpWorkbook != null)
{
mainWorkBook.Worksheets.Add(“TestSheet”);
mainWorkBook.Worksheets[“TestSheet”].Copy(tmpWorkbook.Worksheets[0]);
// mainWorkBook.Merge(tmpWorkbook.Worksheets[0]);
}
}
if (mainWorkBook.Worksheets.Count > 1)
{
mainWorkBook.Worksheets.RemoveAt(0);
}
mainWorkBook.Save(outputWorkbookPath);

Hi,


After an initial test, I am able to find the issue as you have mentioned in the copied sheet. I have logged a ticket for the issue with an id: CELLSNET-40012. We will look into the issue soon.

Thank you.

Hi,

We have fixed this issue. Please download: Aspose.Cells for .NET v7.0.2.1

Hi,

When I try the new version of Aspose.Cells, it is already can print on one paper. But when I am compare the before merged sheet with the after merged sheet, the width of each row has some tiny difference. Although it is very tiny, but for us, it is unacceptable.
BTW: Maybe the height of each column has the same problem.

Please advise and thanks a lot.

Hi,

Thanks for your feedback/comment.

Please highlight your problems in a screenshot with red circles. We will look into them and fix them asap.

Hi,

This is the screenshot, the width of the column “D” from 9.57 change to 8.38. Although the pixel value of width didn’t change, but would you make all of them same.

Hi,


Thanks for providing us the screen shots. I have seen this subtle difference. I have reopened your ticket :CELLSNET-40012 now, we will look into it soon.

Thank you.

Hi,

After further investigation, We checked the template file. We think you should be using Chinese setting
so, kindly add copying the worksheet in your machine, then save the file, post it here. we will check it later.

Thank you.

Hi

Attachment file is the merged file.

Thanks a lot.

Hi,

Please create such file in MS Excel not by Aspose.Cells.

If the default font of MS excel in chinese setting is "宋体" 11 , we could not creat your expected file in MS Excel.

Thank you very much!


We use a English ms excel replace the original Chinese ms excel file then the problem resolved.

The issues you have found earlier (filed as CELLSNET-40012) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.