Free Support Forum - aspose.com

PageSetup.IsHFScaleWithDoc not working

The IsHFScaleWithDoc property does not appear to function properly. Consider the following code:

Workbook workbook = new Workbook();
new License().SetLicense(“Aspose.Cells.lic”);

workbook.Worksheets[0].PageSetup.IsHFScaleWithDoc = false;
workbook.Worksheets[workbook.Worksheets.Add()].PageSetup.IsHFScaleWithDoc = true;

workbook.Save(outputStream, FileFormatType.Default);

When outputStream (a MemoryStream) is saved as an excel document, both sheets have Page Setup > Header/Footer > “Scale with document” checked. This happens on all the FileFormatTypes I tried: Default, Excel2000, Excel2003, and Excel97to2003.

Thanks for your help,
Carl

Hi Carl,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

Well, I checked your scenario with the attached latest version of Aspose.Cells and it works fine. Please try the attached latest version of Aspose.Cells and check if it works fine. If you still face any problem, please share your complete code and generated file to reproduce the issue. We will check it soon. Following is my sample code:

Workbook workbook = new Workbook();

workbook.Worksheets[0].PageSetup.IsHFScaleWithDoc = false;

workbook.Worksheets[workbook.Worksheets.Add()].PageSetup.IsHFScaleWithDoc = true;

MemoryStream ms = new MemoryStream();

workbook.Save(ms,FileFormatType.Excel97To2003);

FileStream fstream = new System.IO.FileStream("D:\\book.xls", FileMode.OpenOrCreate);

byte[] data = ms.ToArray();

fstream.Write(data, 0, data.Length);

Thank You & Best Regards,

Indeed your attached version of Aspose seems to fix the problem. The version I am using is the latest version of Aspose available for download anywhere on your site, which confuses me. How would I go about getting the latest releases of Aspose without posting on your forums?

Since code written in 4.8.2.0 does not compile with version 4.8.2.13 because of the Chart.MajorGridLines property, I think I will find a solution that does not use the IsHFScaleWithDoc property instead.

Hi,

"Indeed your attached version of Aspose seems to fix the problem. The
version I am using is the latest version of Aspose available for
download anywhere on your site, which confuses me. How would I go about
getting the latest releases of Aspose without posting on your forums?"

The latest version (posted by Nausherwan) is actually a bug fix version posted in the forums for the users. Normally, we post the bug fixes in the forums dynamically at run time for the users need. Suppose, a user points out a bug or demand for a new feature and if he has no time to wait until the next official release/hotfix is out, we always consider providing him with an intermediate build that resolves his problem immediately. However, the next official release of the product (the installer (.msi) file is posted on Download module) will always include the functionality of the all the previous fixes (which we posted in the forums). Moreover, you may use this fix as long as you wish without any problem, it will behave like an official release.

"Since code written in 4.8.2.0 does not compile with version 4.8.2.13
because of the Chart.MajorGridLines property, I think I will find a
solution that does not use the IsHFScaleWithDoc property instead."

In the recent fixes/versions, we have made some enhancement regarding a few API, Either we make a few API obsolete (we have also marked some information with these API, so that the user would be able to know which API they should use instead now) and introduced new API with suitable name, Or we have bundled a few API together (e.g MajorGridLines) to its relative set/category to make it more organized.
Now, the MajorGridLines attribute is no more of Chart’s member, please use the following instead (accordingly):
chart.CategoryAxis.MajorGridLines…
chart.ValueAxis.MajorGridLines…


Feel free to contact us any time if you have further queries.


Thank you.