View Issue Details

IDProjectCategoryView StatusLast Update
0025896PackagesLazReportpublic2014-04-24 21:29
ReporterNacho Asensio Assigned ToJesus Reyes  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformWin32OSWindows 7 
Product Version1.2.0 
Target Version1.2.4Fixed in Version1.3 (SVN) 
Summary0025896: Report doesn't fire frRepEnterRect event if launched in Design mode
DescriptionHi!

I've just updated my Lazarus from 1.0.14 to 1.2.0 (sourceforge version).

If I launch my report with DesignReport and, from Lazreport I show the report, it does'n fire the frRepEnterRect event. If I simply change "DesignReport" and use "ShowReport" it fires this event (and works correctly).

It worked fine in previous versions, compiled with Lazarus 1.0.12, 1.0.10 and 1.0.14.

I'm working with this event in order to show some design images which varies with a database field value, but that isn't important. If I work with DesignReport it doesn't works and if I work with ShowReport it fires this event perfectly.

My code is this:

procedure TfRecetas.btListadoClick(Sender: TObject);
var iPos : Integer;
    sInforme : String;
begin
     with fInformes, fDatos do
     begin
          try
             qConsulta.Active := False;
             qConsulta.SQL.Clear;

             if MessageDlg('Mostrar informe',
                           '┬┐Deseas mostrar el informe detallado?',
                           mtConfirmation, mbYesNo, 0) = mrYes then
             begin
                  sInforme := 'Fichas de recetas.lrf';
                  qConsulta.SQL.Text := zRecetas.SQL.Text;
             end
             else
             begin
                  sInforme := 'listado.lrf';

                  iPos := Pos('order by', zRecetas.SQL.Text);

                  if iPos > 0 then
                  begin
                       qConsulta.SQL.Text :=
                            Copy(zRecetas.SQL.Text, 1, iPos - 1);
                  end
                  else
                  begin
                       qConsulta.SQL.Text := zRecetas.SQL.Text;
                  end;

                  qConsulta.SQL.Add('order by CATEGORIA, NOMBRE');
             end;

             qConsulta.Active := True;

             frDS.DataSet := fDatos.qConsulta;
             frDS.DataSet.DisableControls;

             frRep.LoadFromFile(ExtractFilePath(ParamStr(0)) +
                 'INFORMES\' + sInforme);
             frRep.ShowReport; // **********

          except
                ShowMessage('No se pudo mostrar el listado');
          end;

     end;
end;
Steps To ReproduceWrite a program with two buttons who launchs a report with a TfrPictureView. Put a DesignReport in one of them, and a ShowReport in the other. Put 'Sample' in the memo text of TfrPictureView. Change EnterRect event in FReport in order to do something and place a breakpoint.

When you push ShowReport you go to the EnterRect breakpoint. When you push DesignReport and afterwards you push the "Eye" LazReport button (in order to show the report) Lazarus doesn't fire the EnterRect event.
Additional InformationI'll send you a sample program. If I compile it with previous Lazarus it works fine, but with Lazarus 1.2.0 DesignReport has a bad work.
TagsNo tags attached.
Fixed in Revision44281
LazTarget1.2.4
WidgetsetWin32/Win64
Attached Files

Activities

Nacho Asensio

2014-03-21 10:45

reporter  

PruebaFalloLazReport.zip (508,569 bytes)

Jesus Reyes

2014-04-22 22:41

developer  

lr_desgn.diff (1,014 bytes)   
--- c:/lazarus120/components/lazreport/source/backup/lr_desgn.pas	Tue Apr 22 15:38:51 2014
+++ c:/lazarus120/components/lazreport/source/lr_desgn.pas	Tue Apr 22 15:24:45 2014
@@ -3217,8 +3217,24 @@
   CurReport:=nil;
 
   Rep:=TfrReport.Create(SaveR.Owner);
+
+  Rep.OnBeginBand:=SaveR.OnBeginBand;
+  Rep.OnBeginColumn:=SaveR.OnBeginColumn;
+  Rep.OnBeginDoc:=SaveR.OnBeginDoc;
+  Rep.OnBeginPage:=SaveR.OnBeginPage;
+  Rep.OnEndBand:=SaveR.OnEndBand;
+  Rep.OnEndDoc:=SaveR.OnEndDoc;
+  Rep.OnEndPage:=SaveR.OnEndPage;
+  Rep.OnEnterRect:=SaveR.OnEnterRect;
+  Rep.OnExportFilterSetup:=SaveR.OnExportFilterSetup;
+  Rep.OnGetValue:=SaveR.OnGetValue;
+  Rep.OnManualBuild:=SaveR.OnManualBuild;
   Rep.OnMouseOverObject:=SaveR.OnMouseOverObject;
   Rep.OnObjectClick:=SaveR.OnObjectClick;
+  Rep.OnPrintColumn:=SaveR.OnPrintColumn;
+  Rep.OnProgress:=SaveR.OnProgress;
+  Rep.OnUserFunction:=SaveR.OnUserFunction;
+
   try
     Rep.LoadFromXMLStream(TestRepStream);
     Rep.ShowReport;
lr_desgn.diff (1,014 bytes)   

Jesus Reyes

2014-04-22 22:45

developer   ~0074526

The problem was fixed in trunk in r44281, however that patch cannot be merged directly to fix the problem in fixes 1.2.

Instead, attached is a patch against 1.2 that could be applied in fixes 1.2

Nacho Asensio

2014-04-24 08:06

reporter   ~0074556

I have tried to compile with your ".diff" changes and now everything is working perfectly. Thank you very much!!!

Jesus Reyes

2014-04-24 19:38

developer   ~0074569

I changed the Priority and severity as this is a regression.

@Nacho: if it works, please close this report.

Nacho Asensio

2014-04-24 21:29

reporter   ~0074573

Applying "lr_desgn.diff" changes to "lr_desgn.pas" (in lazarus\components\lazreport\source\) in Lazarus 1.2 it works perfectly!

Issue History

Date Modified Username Field Change
2014-03-21 10:45 Nacho Asensio New Issue
2014-03-21 10:45 Nacho Asensio File Added: PruebaFalloLazReport.zip
2014-04-15 05:01 Jesus Reyes Assigned To => Jesus Reyes
2014-04-15 05:01 Jesus Reyes Status new => assigned
2014-04-22 22:41 Jesus Reyes File Added: lr_desgn.diff
2014-04-22 22:45 Jesus Reyes Fixed in Revision => 44281
2014-04-22 22:45 Jesus Reyes LazTarget => 1.2.4
2014-04-22 22:45 Jesus Reyes Note Added: 0074526
2014-04-22 22:45 Jesus Reyes Status assigned => resolved
2014-04-22 22:45 Jesus Reyes Fixed in Version => 1.3 (SVN)
2014-04-22 22:45 Jesus Reyes Resolution open => fixed
2014-04-22 22:45 Jesus Reyes Target Version => 1.2.4
2014-04-24 08:06 Nacho Asensio Note Added: 0074556
2014-04-24 19:38 Jesus Reyes Note Added: 0074569
2014-04-24 19:38 Jesus Reyes Priority normal => high
2014-04-24 19:38 Jesus Reyes Severity minor => major
2014-04-24 21:29 Nacho Asensio Note Added: 0074573
2014-04-24 21:29 Nacho Asensio Status resolved => closed