Save procedure
Prototype: |
procedure Save; |
|
Description: |
Saves newly created file to disk. |
|
Syntax: |
xls.Save; |
|
Part |
Description |
|
xls |
Variable declared as an instance of the TExcelWrapper class |
|
Return value: |
none |
|
See also:
OpenFile, FileName, CloseAndSave, OpenInExcel, Complex example
Example:
Var
xls :TExcelWrapper;
Begin
{data preparation}
//data querying etc...
{document preparation}
xls:=TExcelWrapper.Create;
try
xls.CreateFile(ProjectDir+'ExcelTasks\MyExcelTask');
{managing worksheets}
{managing formats}
{setting cell values}
{etc....}
try
xls.CloseAndSave(true); // save and open file in Excel
{or
xls.ShowExcelPreview('OpenInExcel=0;SaveToExcelFile=0'); // show thumbnail preview
or
xls.CloseAndSave(false); // save file in Excel
xls.OpenInExcel(FileName); // open file in Excel
}
except
ShowError('Error on saving file.');
end;
finally
xls.Free;
end;
End.
© 2024 IFER-Monitoring and Mapping Solutions