LazReports (un)stabillity in 1.2.2 lazarus / 16-Databases ---------------------------------------------------------------------- eara · 2014-05-04 11:01 Well, mayby is not the right place for this post, but what the heck what is a db application wihout reporting options... I almost finished my core functionallity in my application and now i started to deal with reports. Well there is the option of lazReport package, but unfortunatly in all my attempts with 1.2.2 i get all the time access violations everywhere. When i try to delete a component from report... access violation, etc.etc. I spend last 2 days trying to design a single report without sucess due to all this. Any one with better expirience on this ? ANY SUGGESTIONS PLZ? ANYONE ELSE WITH SAME ISSUES, OR NOT? AM I ALONE ON THIS PLANET WITH THIS ISSUE? ---------------------------------------------------------------------- benohb · 2014-05-04 11:26 Which version you are using...lazarus and OS ---------------------------------------------------------------------- eara · 2014-05-04 11:29 i mention it, the 1.2.2 lazarus (official release) on windows 7 32bits ---------------------------------------------------------------------- eara · 2014-05-04 12:54 well right now i ... went back to the future (finally i managed to install the trunk version), where things show more smooth (for lazReport) One thing that i face again    in lazReports is line 71 in lr_dbrel.pas where it tries to update the field definitions from my query, which cause troubles to me (query is already open, field definitions are in place and there is no obvious need for update them). I comment this line (otherwise boom for some reason). So now, i call the designer while i run my application with the query open, and try to design the damned report with live data. ---------------------------------------------------------------------- eara · 2014-05-04 16:18 break his leg again on my head ... I prepared a simple report with a single  table and seems to work, nice lets go to step 2... Now in step #2 i tried the same with a master detail report ang got the all time classic "Access violation" from the detail query. TFRPAGE.FormPage in LR_CLASS calls a RestoreBookMarks, which in turn make a call to TDataSet.GoToBookMark which .... ... ... anyway the boom occurs in TCustomBufDataset.CurrentRecordToBuffer in line Code: [Select]move(CurrentBuffer^,buffer^,FRecordSize);and it seems that CurrentBuffer is invalid for some reason... How can this happen ??? ---------------------------------------------------------------------- eara · 2014-05-04 17:14 A closer look  on LR_Class reveals (2 me) that there is a problem with local  procedure RestoreBookmarks (inside TfrPage.FormPage) In the main body of  FormPage method we have a call to DoLoop(1) which may add bookmarks, and after that we have a call to RestoreBookmarks which in turn try to "restore the bookmarks"????? and then release them Code: [Select]  procedure RestoreBookmarks;   var     n: Integer;   begin     for n:=0 to Length(BooksBkUp)-1 do     with BooksBkUp[n] do begin       Dataset.GotoBookMark(Bookmark); // <<< IS THIS BOOKMARKD VALID FOR A DETAIL DATASET ????       Dataset.FreeBookMark(Bookmark);       if DetailCount=0 then         Dataset.EnableControls;     end;     SetLength(BooksBkUp, 0);   end; The boom is initiated when (i started with my app) the .FormPage method tries to restore a detail dataset in the a previous aquired bookmark which may seem normal, but ... BUT! now this bookmark is no longer valid since the detail dataset (in a master detail relationship) is changed due to scrolling of master dataset (the scrolls and other hocus pocus, are from preparing of the report). So restoring to the stored bookmark position is not longer possible, since this bookmark is no longer valid. But, is this a case for firing an access violation? Anyway, if i simple comment this line , then i avoid the access violation, but! what side effects this will have? I don't know! Looking again    the code IT SEEMS that this line can be ommited without any side effects (i hope) Now the also all time classic "Access Violation" message i got when i pressed the "Cancel" button during a prepare is also vanished ANY SUGGESTIONS PLZ? ---------------------------------------------------------------------- jesusr · 2014-05-07 23:47 Some bugs/problems can be reproduced only under certain circumstances, this is why the best would be to create a test application that isolates the problem, something that we can try to reproduce here. Second, submit a bug report and attach the test project and data there. I will take a look. By the way, What dataset derived components are you using?. ---------------------------------------------------------------------- eara · 2014-05-08 11:46 @jesusr: you are right, i' must make an isolated example, but it will take me some time... The dataset derived components...? I use mainly TSQLQuery on MySQL 5.5, with not persistant fields (all fields are auto created, and i setup them on after connect event handler). Plz, wait for an example then... & by the way thanks for responding ---------------------------------------------------------------------- JZS · 2014-05-08 12:11 I did not use LazReports (and am not intending to). But I find FortesReport ( http://fortes4lazarus.sourceforge.net/ )is the perfect tool in reporting, may be because of my background with QuickReports I find it more convenient. And it has simple tutorial, (simple but should be good enough to explain basics). Anyways, if you did not try it before, give it a shot. ---------------------------------------------------------------------- eara · 2014-05-08 15:16 @JZS thanks i'll check it also... ---------------------------------------------------------------------- eara · 2014-05-09 11:25 @jesusr: i reported as bug, with a demo app, relative link: http://bugs.freepascal.org/view.php?id=26132