<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.5512" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Tengo un procedimiento realizado para exportar a
excel usando ComObj</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Quiero hacer lo mismo para exportarlo a hojas de
calculo de libreoffice y no he encontrado como hacerlo.</FONT></DIV>
<DIV><FONT face=Arial size=2>Alguien de la lista ya ha hecho esto o me podría
orientar algún link de donde obtener información al respecto?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>El procedimiento para exportar a excel es el que
sigue: (ese mismo lo quiero hacer para libreoffice cal)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV><BR>procedure Tflest.crearxls(sname: string);<BR>const<BR> xlCenter =
-4108;<BR>var<BR> Excel, WorkBook, WorkSheet, Range: Variant;<BR> k:
integer;<BR> scap: string;<BR>begin<BR> scap:='Capítulo';<BR>
Excel:=CreateOleObject('Excel.Application');<BR>
Excel.visible:=false;<BR> Excel.IgnoreRemoteRequests:=true;<BR> if
fileexists(sname) then<BR> WorkBook :=
Excel.Workbooks.Open(WideString(sname))<BR> else<BR> WorkBook
:= Excel.Workbooks.Add(-4167);<BR> WorkSheet :=
WorkBook.WorkSheets[1];<BR> WorkSheet.Cells.Clear;<BR>
WorkSheet.Name := WideString(sentidad);<BR> WorkSheet.Cells[1, 1] :=
'Entidad:';<BR> WorkSheet.Cells[1, 2] := WideString(sentidad);<BR>
WorkSheet.Cells[2, 1] := 'Fecha:';<BR> WorkSheet.Cells[2, 2] :=
WideString(txtfecha.Text);<BR> WorkSheet.Cells[3, 1] :=
'Cuenta';<BR> WorkSheet.Cells[3, 2] := 'SubCta';<BR>
WorkSheet.Cells[3, 3] := WideString(scap);<BR> WorkSheet.Cells[3, 4] :=
'SubCap';<BR> WorkSheet.Cells[3, 5] := 'Elemento';<BR>
WorkSheet.Cells[3, 6] := 'Empresa';<BR> WorkSheet.Cells[3, 7] :=
'Anterior';<BR> WorkSheet.Cells[3, 8] := 'Debe';<BR>
WorkSheet.Cells[3, 9] := 'Haber';<BR> WorkSheet.Cells[3, 10] :=
'Saldo';<BR> Range := WorkSheet.Range['A1:J3'];<BR> Range.Font.Bold
:= true;<BR> Range.HorizontalAlignment:=xlCenter;<BR> Range :=
WorkSheet.Range['A1:B2'];<BR> Range.Borders.Color := clRed;<BR>
Range := WorkSheet.Range['A3:J3'];<BR> Range.Borders.Color :=
clRed;<BR> k:=4;<BR> while not dm.rssc6.EOF do
begin<BR> WorkSheet.Cells.Item[k, 1].Value :=
dm.rssc6.FieldByName('cuenta').AsInteger;<BR>
WorkSheet.Cells.Item[k, 2].Value :=
WideString(dm.rssc6.FieldByName('subcta').AsString);<BR>
WorkSheet.Cells.Item[k, 3].Value :=
WideString(dm.rssc6.FieldByName('capitulo').AsString);<BR>
WorkSheet.Cells.Item[k, 4].Value :=
WideString(dm.rssc6.FieldByName('subcap').AsString);<BR>
WorkSheet.Cells.Item[k, 5].Value :=
WideString(dm.rssc6.FieldByName('elemento').AsString);<BR>
WorkSheet.Cells.Item[k, 6].Value :=
WideString(dm.rssc6.FieldByName('empresa').AsString);<BR>
WorkSheet.Cells.Item[k, 7].Value :=
dm.rssc6.FieldByName('antdebe').AsFloat;<BR>
WorkSheet.Cells.Item[k, 8].Value :=
dm.rssc6.FieldByName('debe').AsFloat;<BR>
WorkSheet.Cells.Item[k, 9].Value :=
dm.rssc6.FieldByName('haber').AsFloat;<BR>
WorkSheet.Cells.Item[k, 10].Value :=
dm.rssc6.FieldByName('saldo').AsFloat;<BR>
inc(k);<BR> dm.rssc6.Next;<BR> end;<BR> if
fileexists(sname) then<BR> WorkBook.Save<BR>
else<BR> WorkBook.SaveAs(WideString(sname));<BR>
Excel.IgnoreRemoteRequests:=false;<BR>
Excel.Workbooks(1).Close(false);<BR> Excel.Quit;<BR>end;</DIV>
<DIV> </DIV>
<DIV>Saludos</DIV>
<DIV>========<BR>| ISMAEL |<BR>========</DIV>
<DIV>WebSite: sisconge.byethost15.com</FONT></DIV></BODY></HTML>