var
varexcel:variant;
varexcel:=createoleobject('excel.application');
varexcel.workbooks[1].worksheets[1].name:='住房情况一览表';
varexcel.workbooks[1].worksheets[1].pagesetup.Orientation:=xlLandscape;
varexcel.workbooks[1].worksheets[1].pagesetup.PaperSize:=xlPaperA4;
n:=i+3;
varexcel.workbooks[1].worksheets[1].range['a2:I'+inttostr
].borders.linestyle:=xlcontinuous;
//写入报表头
varexcel.workbooks[1].worksheets[1].range['A1:I1'].MergeCells:=True;
varexcel.workbooks[1].worksheets[1].range['A1:I1'].WrapText:=True;
varexcel.workbooks[1].worksheets[1].range['A1:I1'].HorizontalAlignment:=xlCenter;
varexcel.workbooks[1].worksheets[1].range['A1:I1'].VerticalAlignment:=xlCenter;
varexcel.workbooks[1].worksheets[1].range['A1:I1'].rowheight:=40;
varexcel.workbooks[1].worksheets[1].range['a1:i1']:=nd.Text+'年'+zj.text+'领导干部住房建筑面积'+xz.Text+mj.Text+'平方米情况一览表';
varexcel.workbooks[1].worksheets[1].range['A1:I1'].Font.fontstyle:='bold';
varexcel.workbooks[1].worksheets[1].range['A1:I1'].Font.size:='16';
//写入列表题
varexcel.workbooks[1].worksheets[1].cells[2,1].value:='姓名';
varexcel.workbooks[1].worksheets[1].cells[2,2].value:='职务';
varexcel.workbooks[1].worksheets[1].cells[2,3].value:='租赁、分配房屋'+#10+'平方米';
varexcel.workbooks[1].worksheets[1].cells[2,4].value:='房改购房'+#10+'平方米';
varexcel.workbooks[1].worksheets[1].cells[2,5].value:='自购商品房'+#10+'平方米';
varexcel.workbooks[1].worksheets[1].cells[2,6].value:='私有住房'+#10+'平方米';
varexcel.workbooks[1].worksheets[1].cells[2,7].value:='其它'+#10+'平方米';
varexcel.workbooks[1].worksheets[1].cells[2,8].value:='合计'+#10+'平方米';
varexcel.workbooks[1].worksheets[1].cells[2,9].value:='备注';