Topic: Report by script open in Excel
Hi anybody,
can you please help me :
procedure FmReport_BtTest_OnClick (Sender: string; var Cancel: boolean);
var
frxDBDataset1, : TfrxDBDataset;
report : TDataSet;
begin
SQLQuery('SELECT xy from xy where xy');
frxDBDataset1 := TfrxDBDataset.Create(Form1);
frxDBDataset1.UserName := 'report';
frxDBDataset1.CloseDataSource := True;
frxDBDataset1.OpenDataSource := True;
frxDBDataset1.DataSet := report;
Form1.frxReport.Clear;
Form1.frxReport.DataSets.Clear;
Form1.frxReport.DataSets.Add(frxDBDataset1);
// DESIGN MODE - WORKING OK
// Form1.frxReport.LoadFromFile(ExtractFilePath(Application.ExeName)+'Report\test.fr3');
// Form1.frxReport.DesignReport;
// OPEN REPORT IN Excel NOT WORKING
Form1.frxReport.LoadFromFile(ExtractFilePath(Application.ExeName)+'Report\test.fr3');
Form1.frxReport.PrepareReport();
Form1.frxRTFExport1.FileName := ChangeFileExt(GetTempFileName,'.xlsx');
Form1.frxRTFExport1.ShowDialog := False;
Form1.frxReport.Export(Form1.frxRTFexport1);
// PREVIEW MODE - WORKING OK
// frxDBDataset1.DataSet.Close;
// Form1.frxReport.LoadFromFile(ExtractFilePath(Application.ExeName)+'Report\test.fr3');
// Form1.frxReport.ShowReport;
frxDBDataset1.Free;
end;
1.OPEN REPORT IN Excel NOT WORKING i dont know why error message is:
"Excel cant open the file xy.xlsx becouse file format or its extension is invalid"
Please where is the problem ?
In the forum a find only open in PDF..
2.And the another question:
When the SQLQuery is too long. How can i write him on more rows ?
Thx,
Krokodil