Jump to content

Serge_G

Members
  • Content Count

    84
  • Joined

  • Last visited

Everything posted by Serge_G

  1. Serge_G

    Sidney, RestDebuger and REST

    Well this is a rule I knew and accept the warning, but anybody that can go to Quality Portal can see Dimitry response no ? And I think a good new have to be shared. Don't know how to mark solved on this forum
  2. Serge_G

    Sidney, RestDebuger and REST

    Hi, Dmitry gave me a look on 10.4.2 RestDebugger, problem solved. Patrick (another MVP beta tester of 10.4.2) confirm me that this new version works as I was expecting. So, I will wait for this new version.
  3. Serge_G

    Sidney, RestDebuger and REST

    My guess it's not RestDebugger but a somewhat regression of TRestResponse, I will investigate this direction before disclaim in Quality Support
  4. Serge_G

    Sidney, RestDebuger and REST

    Hi, I found the difference the content doesn't have any rootelement (list of accessible webapi) So the question now is "how to have the same behavior Rio ?" (a property I miss ?)
  5. 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.
  6. 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.
  7. 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
  8. 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)
  9. 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
  10. 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.
  11. 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;
  12. 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
  13. 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
  14. 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.
  15. 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 !
  16. 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
  17. 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.
  18. 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
  19. 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
  20. Serge_G

    Free SQLite -> Interbase tool?

    I suggest this as a one shot solution (quick and forget) , not for a runtime application 😉
  21. Serge_G

    Free SQLite -> Interbase tool?

    Hum, I was not aware of but in my mind if there is a JDBC driver for Interbase (and there is one) it was possible to connect Dbeaver to Interbase. Thanks Firedac and TFDBatchmove ! Except for, and I am not sure of the "except" I just don't test but as I remember output table can be created with same structure input table, creating the table you don't have to write an executable program just in design time you can do the transfer data from table to table. Put 2 connections (one SQlite, other Interbase) 2 related FDTables (or FdQuerys), one FdBatchMove, one FDBatchMoveDatasetReader (for sqlite side) one FDBatchMoveDatasetWriter (for guess wat ;-)) and then you can execute fdbatchmove (contextual menu) during designtime
  22. Serge_G

    Free SQLite -> Interbase tool?

    Hi, I don't use DBeaver for that but have a look to this GUI
  23. Serge_G

    Programmatically Change Properties of a Custom style

    Panel is no more than a TRectangle (depending style file I think) I don't know why but if you try to change TPanel fill color this does not work with 'windows 10 desktop style' , works during design time with 'default' Stylecollection but not at runtime 🐛something to do with the fact that this TRectangle is at the root and not in a TLayout ? Best suggestion I can do is : use a TRectangle. I do not use anymore TPanel now, preferring Layouts and TRectangle 😉
  24. Serge_G

    Programmatically Change Properties of a Custom style

    As I understand what is in your mind, I think it's your ChangeObjectRecursive function the problem. A component (your panel) as style but style is not the "container" of the panel's childs. And therefore, you change wrong "styledata" property for a label See this : // Changing all labels of a panel randomly procedure TForm112.Button1Click(Sender: TObject); var aColor : TAlphaColor; procedure ChangePanelLabels(const Panel : TPanel; const ChangeToColor : TAlphaColor); var i : integer; begin if SameText(Panel.StyleLookup,'panel1style1') then begin for i:=0 to Panel.Children.Count - 1 do begin if Panel.Children[i].ClassNameIs('TLabel') then TLabel(Panel.Children[i]).StylesData['Text.TextSettings.FontColor']:= ChangeToColor; end; end; end; begin randomize; aColor:=Random($FFFFFF) OR $FF000000; // add alpha layer ChangePanelLabels(Panel1,aColor); end;
  25. Serge_G

    TStringGrig formatting date

    %s is yet a string so it's somewhere normal Try FormatDateTime('dd.mm.yyyy',value) or declare your fields, set your date field displayformat property to 'dd.mm.yyyy' and use displaytext in customformat
×