Recent

Author Topic: FPReport designer, am I using it wrong? update:crash fixed, but no data is shown  (Read 1264 times)

mobilevil

  • Jr. Member
  • **
  • Posts: 74
    • http://www.kachun.com
I am trying to start using it,
so I have an empty project, I put an IBConnection, SQLTransaction, SQLQuery, DataSource, DBNavigator and DBGrid. Linked them up,

in FormCreate()
  IBConnection1.Open;
  SQLQuery1.Open; 

execute, the data is showing. good.

So I went on and put a FPReport, FPReportDesigner, and a FPReportDatasetData1.

SQLQuery1 goes to FPReportDatasetData1's DataSet
FPReport1 goes to FPReportDesigner1,
FPReportDatasetData1 goes to FPReport1->ReportData->item 0


in Button1Click,
fpreportdesigner1.Execute;

execute, db data grid still shows the data. good.
click the button, boom.

access violation in frmfpreportdesignermain.pp at line 1623 update: fixed but no data is shown

function TFPReportDesignerForm.GetModified: boolean;

Var
  i : Integer;

begin
  Result:=Assigned(FReport);
  If not Result then exit;
  Result:=FModified;
  if Result then exit;
  Result:=True;
  I:=0;
  While Result and (I<DesignerCount) do
    begin
    Result:=PageDesigner(I).Objects.Modified;
    Inc(I);
    end;
end;   
« Last Edit: June 14, 2025, 06:12:12 pm by mobilevil »

mobilevil

  • Jr. Member
  • **
  • Posts: 74
    • http://www.kachun.com
Re: FPReport designer, am I using it wrong?
« Reply #1 on: June 14, 2025, 04:01:38 am »
ar Ok I see a bug report and the crash is now fixed
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41695

but I don't see the database data fields on the right side of the designer. I see FPReportDatasetData1, and that's it.

dseligo

  • Hero Member
  • *****
  • Posts: 1532
Re: FPReport designer, am I using it wrong?
« Reply #2 on: June 14, 2025, 02:43:41 pm »
but I don't see the database data fields on the right side of the designer. I see FPReportDatasetData1, and that's it.

Did you try this: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41695#note_2543603272

mobilevil

  • Jr. Member
  • **
  • Posts: 74
    • http://www.kachun.com
Re: FPReport designer, am I using it wrong?
« Reply #3 on: June 14, 2025, 06:12:57 pm »
yes I found the bug report also, the crash is now fixed. but I still don't see dataset fields in the report designer.

but I don't see the database data fields on the right side of the designer. I see FPReportDatasetData1, and that's it.

Did you try this: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41695#note_2543603272

dseligo

  • Hero Member
  • *****
  • Posts: 1532
Re: FPReport designer, am I using it wrong?
« Reply #4 on: June 15, 2025, 03:09:01 am »
yes I found the bug report also, the crash is now fixed. but I still don't see dataset fields in the report designer.

I meant this specifically (it helped me when I didn't see page area, maybe it's connected with dataset fields also):

Quote from: paweld
If you are running designer from within Lazarus, first close Lazarus, then delete the lazarus.ini file located in the Lazarus directory.

On the other hand, if you have this effect from within the application then delete the ini file with the executable file name (with the application closed, of course).

Specifically, it is about the value of the FOI_Width option in the TApplication.FPReportDesignerForm section - if it is larger than the width of the designer window, the page editor will not be visible.

mobilevil

  • Jr. Member
  • **
  • Posts: 74
    • http://www.kachun.com
I have also seen the page missing issue and have deleted the ini file.
but I still don't see dataset fields listed under FPReportDatasetData1.
There are items under variables and functions pages though
I havge tested with SQLDB, and TDBF.

Could you please share a basic example with me?

let me pm you my email address,

dseligo

  • Hero Member
  • *****
  • Posts: 1532
I attached example FPreport which shows data from SQlite table (ZEOSdbo components).
You need access to SQlite library (dll if on Windows) and Arial fonts in 'fonts' directory.

mobilevil

  • Jr. Member
  • **
  • Posts: 74
    • http://www.kachun.com
Thanks for your help! Now I have something solid to work on.

Your example works(report designer gives me the list of dataset fields)  if I "run" the report first instead of going to the report designer directly. It's the dataset setup of the for loop that helps I believe.

But if I save the report and restart the application, "run report"gives me 5 errors of band" has no data assigned.
Looking at the code, all the bands should have the dataset set up already.

seems FPReport is still buggy. not enough users, I suppose....


Actually my job is not to make reports, it's just my interest to come back to Lazarus to check the progress from time to time.

I will try to set up a debug build and try to fix the bugs when I have time. Preparing for a business trip now.

Thanks again for your help. I will come back to it soon.
« Last Edit: June 17, 2025, 05:35:45 am by mobilevil »

dseligo

  • Hero Member
  • *****
  • Posts: 1532
Thanks for your help! Now I have something solid to work on.

Your example works(report designer gives me the list of dataset fields)  if I "run" the report first instead of going to the report designer directly. It's the dataset setup of the for loop that helps I believe.

Yes, there is no 'Data' property in properties of data band, so I added it programmatically. For me it's not a problem since I create all objects on the fly, I don't use visual components with FPreport (I only design report visually).

Quote
But if I save the report and restart the application, "run report"gives me 5 errors of band" has no data assigned.
Looking at the code, all the bands should have the dataset set up already.

I noticed this too when preparing your example. Sometimes FPreport adds new page with copy of components (FPreport's designer, to be precise).

Quote
seems FPReport is still buggy. not enough users, I suppose....

If you have some time, when you encounter a bug, prepare example and open bug report. The bug I reported was fixed very fast after reporting. It will help others in the future.

Quote
Actually my job is not to make reports, it's just my interest to come back to Lazarus to check the progress from time to time.

For desktop apps I use LazReport (I use it for years, so I'm pretty accustomed to it).

 

TinyPortal © 2005-2018