Free Support Forum - aspose.com

Rename worksheet- style is changed

Hi

I am evaluating ASPOSE.Cell and I am testing it using the trial version. What I try to accomplish is to open workbook from stream, rename the worksheets and save the workbook to http response.

However, I noticed the revised excel 's style is totally changed. Attached is my code. Keeping the original style is very important for us. Any help would be appreciated.

protected void Page_Load(object sender, EventArgs e)

{

Workbook workbook = new Workbook();

using (FileStream fstream = new FileStream("C:\\result.xls", FileMode.Open))

{

workbook.Open(fstream);

int index = 0;

foreach (Worksheet workSheet in workbook.Worksheets)

{

workSheet.Name = "test" + index;

index++;

}

}

workbook.Save("Report.xls", FileFormatType.Default, SaveType.OpenInExcel, Response);

}

Hi,

Thanks for considering Aspose.

Yes, the style should be maintained in the output file. Which version of Aspose.Cells for .NET you are using. Could you post your template file here, we will check to figure it out (if found) soon.

Thank you.

Amjad

Thank you for your reply. The version I am using is 4.4.3.1

I noticed my original spreadsheet has style like "font size: 6.5" and when it is opened and saved using Aspose, the style is changed to font size 6 by aspose (7.5 to 7, 8.5 to 8) .

Is there any way to workaround it? I do not want to loop through all the cellls and change style one by one.

I attached my original spreadsheet and the one created by aspose for your reference.

Thanks again for your help and I really like the rest of features of aspose.

Lynn

Hi Lynn,

Thanks for providing us the template excel file.

We found the issue after an initial test, we will figure it out soon.

Thank you.

Amjad

Thanks for your post. Do you know how to work around it or is there any quick fix?

Thanks

Lynn

Hi Lynn,

Please try the fix in http://www.aspose.com/community/forums/thread/130052.aspx.

If the font size is a double value in the file, we treat it as an int value.

If you want to get the double size of the font in running, please use Font.DoubleSize property.