Recent

Author Topic: DB Component (continuous form)  (Read 7001 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2092
    • Lazarus and Free Pascal italian community
DB Component (continuous form)
« on: January 20, 2014, 04:38:04 pm »
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.
« Last Edit: January 20, 2014, 04:53:05 pm by xinyiman »
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

kpeters58

  • Sr. Member
  • ****
  • Posts: 267
Re: DB Component (continuous form)
« Reply #1 on: January 20, 2014, 07:19:46 pm »
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.
« Last Edit: January 20, 2014, 07:24:17 pm by kpeters58 »
Lazarus 2.0.4/FPC 3.0.4/Win 64

xinyiman

  • Hero Member
  • *****
  • Posts: 2092
    • Lazarus and Free Pascal italian community
Re: DB Component (continuous form)
« Reply #2 on: January 21, 2014, 12:10:09 pm »
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?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: DB Component (continuous form)
« Reply #3 on: January 21, 2014, 12:13:58 pm »
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.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

xinyiman

  • Hero Member
  • *****
  • Posts: 2092
    • Lazarus and Free Pascal italian community
Re: DB Component (continuous form)
« Reply #4 on: January 21, 2014, 12:21:28 pm »
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,TFindComponentClassEvent,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

Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: DB Component (continuous form)
« Reply #5 on: January 21, 2014, 12:29:45 pm »
Are you missing some chart control? Otherwise, no idea, sorry.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

xinyiman

  • Hero Member
  • *****
  • Posts: 2092
    • Lazarus and Free Pascal italian community
Re: DB Component (continuous form)
« Reply #6 on: January 21, 2014, 12:57:14 pm »
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
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

howardpc

  • Hero Member
  • *****
  • Posts: 3523
Re: DB Component (continuous form)
« Reply #7 on: January 21, 2014, 01:43:40 pm »
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

  • Hero Member
  • *****
  • Posts: 2092
    • Lazarus and Free Pascal italian community
Re: DB Component (continuous form)
« Reply #8 on: January 21, 2014, 01:46:47 pm »
Thank you very much
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2092
    • Lazarus and Free Pascal italian community
Re: DB Component (continuous form)
« Reply #9 on: January 22, 2014, 09:38:48 pm »
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.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2092
    • Lazarus and Free Pascal italian community
Re: DB Component (continuous form)
« Reply #10 on: January 22, 2014, 10:23:10 pm »
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
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2092
    • Lazarus and Free Pascal italian community
Re: DB Component (continuous form)
« Reply #11 on: January 23, 2014, 05:05:19 pm »
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;
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

 

TinyPortal © 2005-2018