| View previous topic :: View next topic |
| Author |
Message |
camperos Guest
|
Posted: Mon Mar 12, 2007 5:42 pm Post subject: Quickreport export to XLS |
|
|
Hi
I using D7 and QR 4.06
How I can automatically export one report to a XLS file without user interaction ?
I fond the "Incompatible types TComponent and String" error.
Using the QR help for the HTML export filter I write the following code:
------------------------------------
Var
ExcelFile: string;
XLSfilter: TQRExcelFilter;
begin
QRExcel:=TQRExcel.Create(Self);
QRExcel.ShowProgress:=False;
QRExcel.Prepare;
ExcelFile:='test.xls';
XLSfilter:=TQRExcelFilter.Create(ExcelFile); <== error ! Incompatible types TComponent and String
QRExcel.ExportToFilter(XLSfilter);
.....
Thanks
C. |
|
| Back to top |
|
 |
camperos Guest
|
Posted: Tue Mar 13, 2007 1:55 pm Post subject: Re: Quickreport export to XLS |
|
|
Hi to all
I find the following solution:
(very simple !)
procedure TForm.....
Var
ExcelFile: string;
XLSfilter: TQRExcelFilter;
begin
QRExcel:=TQRExcel.Create(Self);
QRExcel.ShowProgress:=False;
QRExcel.Prepare;
ExcelFile:=ExtractFilePath(Application.ExeName)+ FormatDateTime('yyyymmdd', date) +'.xls';
QRExcel.ExportToFilter(TQRXLSFilter.Create(ExcelFile));
finally
QRExcel.Free;
QRExcel:=nil;
end;
end;
Cheer .... :-)
C. |
|
| Back to top |
|
 |
|