If I set the
ASheet.PrintSettings.FitWidth := 1;
this is not shown in the printsettings when I open the sheet in Excel. Do I have to set an options for this to work ?
Thanks in advance !
Printsettings FitWidth and FitHeight
Hello
Sorry, yes. In order to activate this, TSheet.WorkspaceOptions must have the value woFitToPage.
Example:
Lars Arvidsson
Sorry, yes. In order to activate this, TSheet.WorkspaceOptions must have the value woFitToPage.
Example:
Code: Select all
XLS.Sheet[0].PrintSettings.FitWidth := 3;
XLS.Sheet[0].WorkspaceOptions := XLS.Sheet[0].WorkspaceOptions + [woFitToPage];
Re: Printsettings FitWidth and FitHeight
I am trying to use this option in C++ Builder...
XLS->Sheets->Items[0]->PrintSettings->FitHeight = 999;
XLS->Sheets->Items[0]->PrintSettings->FitWidth = 1;
XLS->Sheets->Items[0]->WorkspaceOptions << woFitToPage;
When I look at the Excel File the fit height = 999 and width = 1, but the "Fit To:" option is not selected... It is still set to the "Adjust To:" setting... Am I doing something wrong? I have tried to set the woFitToPage option before setting the FitHeight and FitWidth, but I still get the same results.
Thank you.
XLS->Sheets->Items[0]->PrintSettings->FitHeight = 999;
XLS->Sheets->Items[0]->PrintSettings->FitWidth = 1;
XLS->Sheets->Items[0]->WorkspaceOptions << woFitToPage;
When I look at the Excel File the fit height = 999 and width = 1, but the "Fit To:" option is not selected... It is still set to the "Adjust To:" setting... Am I doing something wrong? I have tried to set the woFitToPage option before setting the FitHeight and FitWidth, but I still get the same results.
Thank you.
Re: Printsettings FitWidth and FitHeight
The correct statement for C++ Builder is below:
XLS->Sheets->Items[sheet]->WorkspaceOptions =
XLS->Sheets->Items[sheet]->WorkspaceOptions << woFitToPage;
XLS->Sheets->Items[sheet]->WorkspaceOptions =
XLS->Sheets->Items[sheet]->WorkspaceOptions << woFitToPage;