The formatting of the document.

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
qwertehok
Posts: 13
Joined: Tue Jan 28, 2014 12:45 pm

The formatting of the document.

Post 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?
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: The formatting of the document.

Post by larsa »

Hello

Before you can format a cell, the cell must first have a value. At least: xls[0].AsBlank[0,1] := True;
Lars Arvidsson, Axolot Data
qwertehok
Posts: 13
Joined: Tue Jan 28, 2014 12:45 pm

Re: The formatting of the document.

Post 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
qwertehok
Posts: 13
Joined: Tue Jan 28, 2014 12:45 pm

Re: The formatting of the document.

Post 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
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: The formatting of the document.

Post 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.
Lars Arvidsson, Axolot Data
qwertehok
Posts: 13
Joined: Tue Jan 28, 2014 12:45 pm

Re: The formatting of the document.

Post by qwertehok »

Code: Select all

XLS.Font.FontName := 'Arial';
delphi say me
[dcc32 Error] Unit1.pas(70): E2003 Undeclared identifier: 'FontName'
qwertehok
Posts: 13
Joined: Tue Jan 28, 2014 12:45 pm

Re: The formatting of the document.

Post 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
Post Reply