Jump to content

Serge_G

Members
  • Content Count

    55
  • Joined

  • Last visited

Community Reputation

19 Good

Recent Profile Visitors

369 profile views
  1. Serge_G

    LiveBindings for TComponent

    Yes agree, but when I wrote my radiogroupbox every time I wanted to link the item value (text value) it was written to radiogroupbox.text The only track I saw was the 'somewhat' converter but never went so far.
  2. Serge_G

    LiveBindings for TComponent

    Hi, I just made a simple attempt that I reported in this (sorry french) tutorial https://serge-girard.developpez.com/tutoriels/Delphi/Livebindings/Composant_A/ hope, this help. But I got stuck writing another more complex one for a radiogroupbox, my guess : I need to define a somewhat converter. Alas, my various professional obligations make me constantly postpone the realization of the latter.
  3. Serge_G

    Recursive S.Proc

    Hi, Something like CREATE TABLE BOM ( ITEMNO VARCHAR(5), CHILDITEMNO VARCHAR(5), QTY INTEGER ); COMMIT; INSERT INTO BOM VALUES('AAA','AAA-1',2); INSERT INTO BOM VALUES('AAA-1','AAB',2); INSERT INTO BOM VALUES('AAA-1','AAC',3); SET TERM ^ ; CREATE OR ALTER PROCEDURE GETBOM ( ITEM varchar(5), QT integer ) RETURNS ( BOMITEM varchar(5), BOMCHILD varchar(5), BOMQTY integer ) AS DECLARE VARIABLE Q INTEGER; BEGIN FOR SELECT ITEMNO,CHILDITEMNO,QTY*:QT FROM BOM WHERE ITEMNO=:ITEM INTO :BOMITEM,:BOMCHILD,:BOMQTY DO begin SUSPEND; Q=:BOMQTY; IF (NOT BOMCHILD IS NULL) THEN BEGIN FOR SELECT BOMITEM,BOMCHILD,BOMQTY FROM GETBOM(:BOMCHILD,:Q) INTO :BOMITEM,:BOMCHILD,:BOMQTY DO SUSPEND; END END END^ SET TERM ; ^ SELECT BOMITEM, BOMCHILD, BOMQTY FROM GETBOM ('AAA', 1); Giving P.S. Note as I present my script (create table, populate, table etc.) , so it'is easy for anybody to test
  4. Serge_G

    Sql Update

    Hi, try to replace your SQL by this one (I don't use Interbase but Firebird) IMHO you will need a whatever rounding function for your result. And, well , I am not a fan of calculated columns in a table (except COMPUTED BY ones)
  5. Serge_G

    DB Pagination and TListView question

    I was surprised I can use also this Disconnect with Firebird the same way I just calculate the Recsmax to be function of ListViewSize and ItemsHeight (in the onResize of the form so I detect rotation) FetchOptions.Recsmax:=Round(ListView1.Height/ListView1.ItemAppearance.ItemHeight); And no more cursors see my first attempts here https://www.developpez.net/forums/d2099624/environnements-developpement/delphi/composants-fmx/tlistview-pagine-j-ai-besoin-quelques-suggestions/#post11666050 Not updated because I prefered to make a test on Firebird AND SQlite (on windows) . Added the navigation to a page number (problem ok virtual keyboard solved). Last but not least : implementing the search is the last goal I fixed but not code yet
  6. Serge_G

    From Interbase To Firebird

    Hi, In the old days a simple backup (transportable format) from Interbase, and restore in Firebird works, but I don't know if this solution works now.
  7. Serge_G

    Assigning Null value to Parameter

    Try this dm.fdc.ExecSQL( 'UPDATE tbCalendar SET EventDate = :pEd, Event = :pEv, EventTime = :pEt, Venue = :pVe, EventType = :pEvt, [Order] = :pOr, Competition = NULL ' + ' WHERE ID = :pID', [ dDate, edEvent.Text, edTime.Text, cbVenue.Text, cbType.Text, StrToInt(cbOrder.Text), iMatchID ]); And for setting a Field to null dm.fdqvCalendar.FieldByName('Competition').Clear;
  8. Serge_G

    DB Pagination and TListView question

    Hi, @Emailx45 Test have to be done on a SQlite Database, surprisingly the sequence FDQuery1.Close; FDQuery1.FetchOptions.RecsSkip := FDQuery1.FetchOptions.RecsSkip - lMyMaxRecordsByPage; FDQuery1.Open(); Does not work, but if you use FDQuery1.Disconnect it is ok. Note I prefer your EOF management to mine 😉, done quickly. @sjordi Now you put this in my mind I am thinking on how pages number can be displayed like what can be seen on the web (the <1 2 3 .. x > thing) and how search can be implemented (certainly a firedac macro ) . I think it's a more a gesture management sort of than a ScrollViewChange
  9. Serge_G

    DB Pagination and TListView question

    Ok, so with a SQLite the same code does not work But changing fdQuery1.Open to FdQuery1.Disconnect Do the trick. I was not aware of this "disconnect" function
  10. Serge_G

    DB Pagination and TListView question

    Hi, I never tried this approach but curious I am 😉 I think you simply forget to refresh the link. I wrote a little program to check (Firebird database for instance, further I will write one with SQLite to be sure) here is my thougts uses System.Math; procedure TForm3.btnFirstClick(Sender: TObject); begin FDQuery1.Open(); LinkListControlToField1.Active:=true; end; procedure TForm3.btnPriorPageClick(Sender: TObject); begin fdQUery1.Close; fdQuery1.FetchOptions.RecsSkip:=MaxIntValue([FDQuery1.FetchOptions.RecsSkip-FDQuery1.FetchOptions.RecsMax,-1]); fdquery1.Open; LinkListControlToField1.Active:=False; LinkListControlToField1.Active:=true; end; procedure TForm3.btnNextPageClick(Sender: TObject); var skiprec : Integer; begin if fdQuery1.EOF OR (fdQuery1.RecordCount<FDQuery1.FetchOptions.RecsMax) then exit; skipRec:=FDQuery1.FetchOptions.RecsSkip+FDQuery1.FetchOptions.RecsMax; fdQUery1.Close; fdQuery1.FetchOptions.RecsSkip:=skipRec; fdquery1.Open; LinkListControlToField1.Active:=False; LinkListControlToField1.Active:=true; end; Even if I am a little disappointed by my EOF management (in my sample RecordCountCodeMode need to to be cmVisible) this little test works.
  11. Serge_G

    InterBase or Firebird?

    How did you manage that ? Using AnyDac component yes it works, but I don't achieve that with Firedac, FDPhysFBDriverLink is not available for Androïd. Using FDPhysIBDriverLink and changing library I always run in a "connection rejected by host" error (32 bits client/server app) Using a 7.2 later beta ZEOSDBO I managed to get access to Firebird, but with the newer versions I can't even access to library !
  12. Serge_G

    [TListbox] Need suggestion? still laggy

    Hi, Try a ScrollBox. Have a look to Paul Toth and Andriano Santos solutions but also Jaques Nascimento tips
  13. Well, , I only test Fluent Livebindings with a TGrid, not TStringGrid, but demo included in the package is with a stringgrid, so I don't see anything except a missing unit in your form. My tests are somewhere a little not objectives in the way I put on the same form a grid linked (TBindGridLink) with the visual livebindings editor and another with Fluent (raising the fact this last is not a WYWSSEWYG method) unit so all the units were added.
  14. Yes FluentLiveBindings should work, and so easy to write BindingsList1.BindGrid(Grid1).ToBindSource(BindSourceDB1); But no CustomFormat can be used (perhaps I don't know how, or further development ?) My code for runtime linking var ABindGrid : TBindGridLink; begin ABindGrid:=TBindGridLink.Create(self); ABindGrid.ControlComponent := Grid1; ABindGrid.SourceComponent := BindSourceDB1; // synch with ABindGrid.PosControlExpressions.AddExpression do begin ControlExpression := 'Selected'; SourceExpression := 'Math_Max(0,DBUtils_ActiveRecord(Self))'; end; with ABindGrid.PosSourceExpressions.AddExpression do begin ControlExpression := 'Math_Max(1,Selected+1)'; SourceExpression := 'DBUtils_ValidRecNo(Self)'; end; // columns with ABindGrid.ColumnExpressions.AddExpression do begin ColumnName := 'Column1'; ColumnIndex := 0; SourceMemberName := 'SS_NUMBER'; // field format '0 000 000 00' (a crazy one ;-) just for test) with FormatCellExpressions.AddExpression do begin ControlExpression := 'Data'; SourceExpression := 'DisplayText'; // I kept Display text, but 10.4.1 don't need end; end; with ABindGrid.ColumnExpressions.AddExpression do begin ColumnName := 'Column2'; ColumnIndex := 1; SourceMemberName := 'FIRST_NAME'; With FormatCellExpressions.AddExpression do begin ControlExpression := 'Data'; SourceExpression := 'Value+'#39' '#39'+Dataset.LAST_NAME.text'; end; end; Regret, I am unable to use a "with TBindGridLink.Create(Self) do ...." form
  15. Serge_G

    Grid Sort indicator

    Hi, It seems too late but you can look at my (sorry french) paper about customizing Grid https://serge-girard.developpez.com/tutoriels/Delphi/Livebindings/Grilles/ Ok it's not about headers it's one of the Todo in my notebook I had no time to investigate (I go on listviews instead of grids) but still in my mind I think about a new column style
×