DB Component (continuous form) lazarus / 16-Databases ---------------------------------------------------------------------- xinyiman · 2014-01-20 15:38 Guys, time ago I saw that there is already a component that allows you to create a continuous form to manipulate data in the database. I have an array of controls db. Can anyone tell me where to find it? Once it was on the page Lazarus component but now can not find it. ---------------------------------------------------------------------- kpeters58 · 2014-01-20 18:19 I remember seeing something like that, too. Don't remember if it was on the Delphi or Lazarus side of things. DevExpress sell a nice implementation of something like that under the name of VerticalGrid (in single record mode) - have a look if you need inspiration for a DIY. If you can't find it, it could easily be done from scratch by looping through your dataset's fielddefs, inspecting their attributes and creating the respective components underneath each other (edits, checkboxes, memos etc.) on top of a scroll box (so you can accommodate wide tables). You could use the hidden/read-only flags to further spruce up the whole thing. ---------------------------------------------------------------------- xinyiman · 2014-01-21 11:10 I think I found it but I can not install it, it should be TSubForm, and you download it from here http://sourceforge.net/projects/lazarus-ccr/files/Data- Aware%20SubForm/Data-Aware%20SubForm%200.1/ I installed the dependencies, but it goes in error when compiling the package. Any idea? ---------------------------------------------------------------------- BigChimp · 2014-01-21 11:13 What does  "it goes in error" mean? Is your goldfish drowning? In other words: it is not very useful information. See the first link in my signature for more info/hints. Thanks. ---------------------------------------------------------------------- xinyiman · 2014-01-21 11:21 Sorry Before I get this error subform.pas(65,13) Fatal: Can not find unit Chart used by subform. then comment if the unit tells me /home/francesco/Documenti/Lazarus_Components/subform- 0.1/subform.pas(165,48) Error: Call by var for arg no. 2 has to match exactly: Got "TControl" expected "TComponent" lresources.pp(911,11) Hint: Found declaration: ReadComponentFromBinaryStream(TStream,var TComponent,TFindComponentCla ssEvent,TComponent="nil",TComponent="nil",TComponent="nil"); /home/francesco/Documenti/Lazarus_Components/subform- 0.1/subform.pas(286,5) Error: Identifier not found "TBarChart" /home/francesco/Documenti/Lazarus_Components/subform- 0.1/subform.pas(642) Fatal: There were 2 errors compiling module, stopping ---------------------------------------------------------------------- BigChimp · 2014-01-21 11:29 Are you missing some chart control? Otherwise, no idea, sorry. ---------------------------------------------------------------------- xinyiman · 2014-01-21 11:57 I installed TAChart but does not resolve, however, I commented on the chart and gives me other problems. It would be nice if someone tried to install the package and tell me if you get the same errors. I compiled it on Ubuntu ---------------------------------------------------------------------- howardpc · 2014-01-21 12:43 Unzip the attached files, and replace subform.pas with the altered version. Compile and install subformpackage.lpk. Replace testform.pas in the example project with the altered version. This compiles and runs on Win32, and the subform.Post routine which crashed for the original author now behaves (at least with minimal testing). It would be tedious to list the various changes I made, but you can see by comparing that they were not all that extensive. This package has given me some good ideas to work with, though the GUI could certainly be improved. ---------------------------------------------------------------------- xinyiman · 2014-01-21 12:46 Thank you very much ---------------------------------------------------------------------- xinyiman · 2014-01-22 20:38 Howardpc Hello, I tested the package with your changes. I must be in error destroy. Exactly on the line:   TemplatePanel.Free; If I comment it all works. ---------------------------------------------------------------------- xinyiman · 2014-01-22 21:23 Please explain to me how I can read the contents of a TDBEdit through the click of a TButton placed on a SubForm? I looked at the example files but can not find what I need. thank you very much ---------------------------------------------------------------------- xinyiman · 2014-01-23 16:05 Solved in this mode: Code: [Select]var    i: integer;    app: string;    appC: TComponent; begin      for i:=0 to (Sender as TButton).Parent.ComponentCount - 1 do      begin           if (Sender as TButton).Parent.Components[i].Name='DBEdit1' then              begin                   appC:=(Sender as TButton).Parent.Components[i];                   ShowMessage(TDBEdit(appC).Text);              end;      end; ---------------------------------------------------------------------- tito_livio · 2022-04-13 21:26 Hello, I have fixed the TsubForm component for the current Lazarus version. I have tested it on Windows 32 with little test project. I attach the release.