Page 1 of 1

The formatting of the document.

Posted: Thu Dec 04, 2014 1:13 pm
by qwertehok
Hi
using 5.20.33

to create a blank form in Excel using this code

Code: Select all

  xls[0].Clear;
  xls[0].AsString[10,0]:='caption';
  xls[0].Cell[0,1].BorderTopStyle:=cbsThin;
  XLS.Filename := ExtractFilePath(Application.ExeName)+'out.xlsx';
  XLS.Write;
crashes error. tell me how?

Re: The formatting of the document.

Posted: Fri Dec 05, 2014 9:12 am
by larsa
Hello

Before you can format a cell, the cell must first have a value. At least: xls[0].AsBlank[0,1] := True;

Re: The formatting of the document.

Posted: Thu Dec 11, 2014 2:09 pm
by qwertehok
thanks

say, please how to change the font of the whole document

Code: Select all

  xls[0].Range[0,0,31,55].FontName:='Roboto';
  xls.Sheets[0].Range[0,0,10,10].FontName:='Roboto';

  XLS[0].AsString[0,2] := 'test';
  XLS[0].Cell[0,2].FontName:='Ubuntu';
but 2013 office opens the document with the font Colibri

Re: The formatting of the document.

Posted: Thu Dec 11, 2014 2:27 pm
by qwertehok
and the second question

Image

red marked what I do so

Code: Select all

xls.Sheets[0].PrintSettings.ScalingFactor:=90;
orange marked what I do so

Code: Select all

XLS[0].PrintSettings.FitHeight:=1;
xls.Sheets[0].PrintSettings.FitWidth:=1;
but I can't switch to orange RadioButton
please tell me how to do it

Re: The formatting of the document.

Posted: Fri Dec 12, 2014 1:38 pm
by larsa
Hello

If you want to set the default font, use: XLS.Font.FontName := 'Arial';

I couldn't find any problems regarding the other issue, but I'm not sure I got you right.

Re: The formatting of the document.

Posted: Fri Dec 12, 2014 1:49 pm
by qwertehok

Code: Select all

XLS.Font.FontName := 'Arial';
delphi say me
[dcc32 Error] Unit1.pas(70): E2003 Undeclared identifier: 'FontName'

Re: The formatting of the document.

Posted: Fri Dec 12, 2014 1:51 pm
by qwertehok
larsa wrote: I couldn't find any problems regarding the other issue, but I'm not sure I got you right.

can I use "printscaling", but I did not get to choose another option scale