doc.XMLVersion := '
1.0';
doc.AppendChild(doc.CreateProcessingInstruction('
mso-application', '
progid="Excel.Sheet"'));
nRoot := doc.CreateElement('
Workbook');
TDOMElement(nRoot).SetAttribute('
xmlns', '
urn:schemas-microsoft-com:office:spreadsheet');
TDOMElement(nRoot).SetAttribute('
xmlns:o', '
urn:schemas-microsoft-com:office:office');
TDOMElement(nRoot).SetAttribute('
xmlns:x', '
urn:schemas-microsoft-com:office:excel');
TDOMElement(nRoot).SetAttribute('
xmlns:ss', '
urn:schemas-microsoft-com:office:spreadsheet');
TDOMElement(nRoot).SetAttribute('
xmlns:html', '
http://www.w3.org/TR/REC-html40');
doc.AppendChild(nRoot);
nDocProperties := doc.CreateElement('
DocumentProperties');
TDOMElement(nDocProperties).SetAttribute('
xmlns', '
urn:schemas-microsoft-com:office:office');
nRoot.AppendChild(nDocProperties);
AddTextNode(nDocProperties, '
Author', '
ich');
AddTextNode(nDocProperties, '
LastAuthor', '
ich');
AddTextNode(nDocProperties, '
Created', FormatDateTime('
yyyy-mm-dd', Now) + '
T' + FormatDateTime('
hh:nn:ss', Now) + '
Z');
AddTextNode(nDocProperties, '
Version', '
15.0');
nDocSettings := doc.CreateElement('
OfficeDocumentSettings');
TDOMElement(nDocSettings).SetAttribute('
xmlns', '
urn:schemas-microsoft-com:office:office');
nRoot.AppendChild(nDocSettings);
nDocSettings.AppendChild(doc.CreateElement('
AllowPNG'));
//////////////////////////
nDocSettings := doc.CreateElement('
ExcelWorkbook');
TDOMElement(nDocSettings).SetAttribute('
xmlns', '
urn:schemas-microsoft-com:office:excel');
nRoot.AppendChild(nDocSettings);
AddTextNode(nDocSettings, '
WindowHeight', '
12435');
AddTextNode(nDocSettings, '
WindowWidth', '
2880');
AddTextNode(nDocSettings, '
WindowTopX', '
0');
AddTextNode(nDocSettings, '
WindowTopY', '
0');
AddTextNode(nDocSettings, '
ProtectStructure', '
False');
AddTextNode(nDocSettings, '
ProtectWindows', '
False');
////////////////////////////
nDocSettings := doc.CreateElement('
Styles');
nChild:= nDocSettings.AppendChild(doc.CreateElement('
Style'));
TDOMElement(nChild).SetAttribute('
ss:ID', '
Default');
TDOMElement(nChild).SetAttribute('
ss:Name', '
Normal');
nRoot.AppendChild(nDocSettings);
nChildChild:= nChild.AppendChild(doc.CreateElement('
Alignment'));
TDOMElement(nChildChild).SetAttribute('
ss:Vertical', '
Bottom');
nChildChild:= nChild.AppendChild(doc.CreateElement('
Borders'));
nChildChild:= nChild.AppendChild(doc.CreateElement('
Font'));
TDOMElement(nChildChild).SetAttribute('
ss:FontName', '
Calibri');
TDOMElement(nChildChild).SetAttribute('
ss:Family', '
Swiss');
TDOMElement(nChildChild).SetAttribute('
ss:Size', '
11');
TDOMElement(nChildChild).SetAttribute('
ss:Color', '
#000000');
nChildChild:= nChild.AppendChild(doc.CreateElement('
Interior'));
nChildChild:= nChild.AppendChild(doc.CreateElement('
NumberFormat'));
nChildChild:= nChild.AppendChild(doc.CreateElement('
Protection'));