sorry here is my code again. for some reason i deleted the part where I created the report. Still have the same problem
procedure TFmPrintOut.PrepareAndShow(Report: TfrxReport; Exp: TfrxPDFExport);
var
AUrl : string;
begin
Report.PrintOptions.ShowDialog := False;
Report.ShowProgress := False;
Report.EngineOptions.SilentMode := True;
Report.EngineOptions.EnableThreadSafe := True;
Report.EngineOptions.DestroyForms := False;
Report.EngineOptions.UseGlobalDataSetList := False;
Exp.Background := True;
Exp.ShowProgress := true;
Exp.ShowDialog := false;
Exp.FileName := UniServerModule.NewCacheFileUrl(False, 'pdf', '', '', AUrl, True);
Exp.DefaultPath := '';
Report.PreviewOptions.AllowEdit := False;
Report.PrepareReport;
Report.Export(Exp);
UniURLFrame1.URL := AUrl;
end;
procedure TFmPrintOut.UniFormBeforeShow(Sender: TObject);
var
FRp : TfrxReport;
FXp : TfrxPDFExport;
begin
try
FRp := TfrxReport.Create(nil);
FXp := TfrxPDFExport.Create(nil);
try
DmReports.QuPlcByPupil.filtered := false;
DmReports.QuPlcByPupil.filter := '[PUPIL CODE] = '+quotedstr(DmPlcPupils.QuPupilListPupilCode.AsString);
DmReports.QuPlcByPupil.filtered := true;
FRp.LoadFromFile(UniServerModule.FilesFolderPath+'\reports\PupilPlcAll.fr3');
PrepareAndShow(FRp, FXp);
finally
FRp.Free;
FXp.Free;
end;
finally
end;
end;