I have a problem using Asponse.Excel .NET component. The problem is that when I use PrintTitleColumns or/and PrintTitleRows and FitToPageWide, the data doesn't occupy all the space between margins, leaving a lot of space before right margin.
I use Aspose 3.1.1.5, Visual Studio .NET 2003 and MS Excel 2003.
Please set PageSetup.RightMargin to 0. 2. If still leaving space before right margin, I think that’s the routine of MS Excel. You can verify it by manually setting PrintTitleColumns or/and PrintTitleRows and FitToPageWide in MS Excel. 3. If I misunderstood your need, please post a sample file here and elaborate your problem.
With the last two lines there aren’t a good distribution between margins, but If I delete these lines (PrintTitleRows and PrintTitleColumns), this doesn’t happens.
I tested your code and found it’s all fine. Those extra right margins are allocated by MS Excel while setting print rows/columns. So it’s a MS routine, not a problem. You can verify it by setting them in MS Excel manually.
@dmarin,
The old product Aspose.Excel is abandoned and a new product Aspose.Cells has replaced it. This new product contains rich features to work with page setup by setting PrintTitleColumns and PrintTitleRows etc. Here is an example that can be used to exercise this feature:
// Instantiating a Workbook object
Workbook workbook = new Workbook();
// Obtaining the reference of the PageSetup of the worksheet
Aspose.Cells.PageSetup pageSetup = workbook.Worksheets[0].PageSetup;
// Defining column numbers A & B as title columns
pageSetup.PrintTitleColumns = "$A:$B";
// Defining row numbers 1 & 2 as title rows
pageSetup.PrintTitleRows = "$1:$2";
// Save the workbook.
workbook.Save(dataDir + "SetPrintTitle_out.xls");
For more details on setting print options refer to the following article: Setting Print Options