FR 2.5.1 report preview
We have several application using Fast Reports. Recently we downloaded the 2.5.1 update and installed it. After recompiling our programs the reports work correctly in some but not in others. We are using Delpi 7 with ADO and have had the same results in Delphi 5. All of the reports have dialog forms with ADO queries. All of the reports were designed in and work correctly in FR 2.4.7.
The problem is the same on described earlier in this forum. When a user selects a report from the menu the report preview does not appear.
The code is almost identical in both the programs that work and those that do not:
procedure TFrmFReports.BbPreviewClick(Sender: TObject);
Var ReportName : String;
begin
ReportName := '..\Freports\' + DM1.QryFReportsFileName.Value;
if FileExists(ReportName) then
begin
with FrmWInvMain.frReport1 do
begin
LoadFromFile(ReportName);
PrepareReport;
ShowPreparedReport;
end;
end
else
ShowMessage(ReportName + ' Not Found');
ChDir(ExtractFilePath(Application.ExeName));
end;
We don't get any error messages. If we open the report designer, load the report and select preview the report will run correctly. If you then select a report in the program and click preview the report that was opened in the designer will preview regardless of which report was selected.
Any ideas/suggestions welcome.
The problem is the same on described earlier in this forum. When a user selects a report from the menu the report preview does not appear.
The code is almost identical in both the programs that work and those that do not:
procedure TFrmFReports.BbPreviewClick(Sender: TObject);
Var ReportName : String;
begin
ReportName := '..\Freports\' + DM1.QryFReportsFileName.Value;
if FileExists(ReportName) then
begin
with FrmWInvMain.frReport1 do
begin
LoadFromFile(ReportName);
PrepareReport;
ShowPreparedReport;
end;
end
else
ShowMessage(ReportName + ' Not Found');
ChDir(ExtractFilePath(Application.ExeName));
end;
We don't get any error messages. If we open the report designer, load the report and select preview the report will run correctly. If you then select a report in the program and click preview the report that was opened in the designer will preview regardless of which report was selected.
Any ideas/suggestions welcome.
Comments
regards
gord
ok thats one possibility out of the way
it could be
ReportName := '..\Freports\' + DM1.QryFReportsFileName.Value;
is the .. your sub to read easier in this message. if not it should coded to full pathname.
if that doesn't do it was ado recompiled after install of new frversion.
regards gord
procedure TFrmXmain.ShowReport(ReportName: String);
Var ExFileName : String;
begin
ExFileName := ExpandUNCFileName(ReportName);
and everything now seems to work correctly.
Thanks.