PrintTitleRows and PrintTitleColumns with PDF

Hi,

I set PageSetup.PrintTitleRows and PageSetup.PrintTitleColumns:

worksheet.PageSetup.PrintTitleRows = "$A:$B";
worksheet.PageSetup.PrintTitleColumns = "$10:$11";

When I save XLSX format, it's work.

Whem I save PDF format, occurs error.

Hi,

Thanks for your sample project.

I was able to replicate this exception using your code with the latest version:
Aspose.Cells
for .NET v7.2.0.7



We have logged this issue in our database. Development team will look into this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSNET-40673.

Please see the code and exception below for your reference. I have also attached the source file.

C#


string filePath = @“F:\relResultadoImp.xlsx”;



Workbook wb = new Workbook(filePath);


Worksheet worksheet = wb.Worksheets[0];


worksheet.PageSetup.TopMargin = 1;

worksheet.PageSetup.BottomMargin = 1;

worksheet.PageSetup.LeftMargin = 1;

worksheet.PageSetup.RightMargin = 1;


worksheet.PageSetup.HeaderMargin = 0;

worksheet.PageSetup.FooterMargin = 0;


worksheet.PageSetup.ClearHeaderFooter();

worksheet.PageSetup.PrintTitleRows = “$A:$B”;

worksheet.PageSetup.PrintTitleColumns = “$10:$11”;


worksheet.PageSetup.Orientation = PageOrientationType.Landscape;

worksheet.PageSetup.Order = PrintOrderType.OverThenDown;

wb.Save(filePath + “.out.pdf”);


Exception:
Aspose.Cells.CellsException was unhandled
Message="Input string was not in a correct format."
Source="Aspose.Cells"
StackTrace:
at Aspose.Cells.Workbook.Save(String fileName, SaveOptions saveOptions)
at Aspose.Cells.Workbook.Save(String fileName)

Hi,

After looking into your issue further, we found that you need to change your code as the following:

C#


worksheet.PageSetup.PrintTitleRows ="$10:$11";

worksheet.PageSetup.PrintTitleColumns = “$A:$B”

it's working.

thank you.

Hi,

Thanks for your feedback.

It’s good to know that your issue is resolved now.

Let us know if you have any more questions relating to GridWeb, we will like to help you further.