"Outsourcing any properties or database functions to an external component (TReportStore) would keep the most important component, TfrReport, and the designer lean and clean." That's absolutely true, but then this component must also be structured accordingly and not be linked to other components.
Furthermore, no changes were made to TfrReport. I made sure that changes were only made to the designer component. This make the changes very compact.
Since I haven't received any feedback from Jesus, I've spent almost a day trying to figure out how to add the DBDesigner as a standalone component. In my opinion, it's almost impossible—especially with a reasonable amount of effort. You'd have to unravel so much and make changes to many components. See the uses alone:
Search "LR_Desgn" (12 hits in 12 files out of 67 searched)
R:\Lazarus\components\lazreport\source\lazreport.pas (1 hit)
Line 11: LR_About, LR_BarC, LR_BndEd, LR_Class, LR_Const, LR_DBSet, LR_Desgn,
R:\Lazarus\components\lazreport\source\lr_btyp.pas (1 hit)
Line 49: uses LR_Desgn, LR_DBDesgn;
R:\Lazarus\components\lazreport\source\lr_desgn.pas (1 hit)
Line 10: unit LR_Desgn, LR_DBDesgn;
R:\Lazarus\components\lazreport\source\lr_desgn_Error.pas (1 hit)
Line 11: unit LR_Desgn, LR_DBDesgn;
R:\Lazarus\components\lazreport\source\lr_design_ins_filed.pas (1 hit)
Line 60: uses LR_Utils, LR_Class, LR_DBRel, LR_Desgn, LR_DBDesgn, LR_Const;
R:\Lazarus\components\lazreport\source\lr_edit.pas (1 hit)
Line 78: uses LR_Desgn, LR_DBDesgn, LR_Fmted, LR_Var, LR_Flds, LR_Const, lr_expres, strutils;
R:\Lazarus\components\lazreport\source\lr_gedit.pas (1 hit)
Line 56: uses LR_Class, LR_Desgn, LR_DBDesgn;
R:\Lazarus\components\lazreport\source\lr_hilit.pas (1 hit)
Line 60: uses LR_Desgn, LR_DBDesgn, LR_Class;
R:\Lazarus\components\lazreport\source\lr_newrp.pas (1 hit)
Line 48: uses LR_Class, LR_Desgn, LR_DBDesgn;
R:\Lazarus\components\lazreport\source\lr_register.pas (1 hit)
Line 11: LR_Desgn,
R:\Lazarus\components\lazreport\source\lr_view.pas (1 hit)
Line 746: // see lr_desgn.pas:TfrDesignerForm.SaveState;
R:\Lazarus\components\lazreport\source\_lr_desgn.pas (1 hit)
Line 11: unit LR_Desgn;
These dependencies alone make a separate component pretty obsolete. I've tidied up the Designer component a bit and defined the text used there as a
. resourcestring
so that different languages can be used. I will make the reworked component available on the page
.
https://lazarus.intern.ws/lazreport_designer_database.htmlin the next few days. For me, the topic of custom components is closed.
It's not that much work to add the two files to the source folder. I have four changes that I make to the components with every version change. I've documented this for myself, and it takes a maximum of six to seven minutes to accomplish. Now it's just two minutes longer.
And maybe someone will come up with the idea of including the component in this form as a standard component. Everything speaks for it. The component doesn't have that much more code.
lr_desgn.lfm: about 0 bytes
lr_desgn.pas: about 12 KB
If anyone has more experience with components and finds a way to create their own component, that would be great.
If anyone knows how to submit it, they're welcome to do so. I haven't done anything like this before and don't have any more time.
Note: I haven't covered subreports (yet).