Jump to content

Serge_G

Members
  • Content Count

    311
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Serge_G


  1. 1 hour ago, Lars Fosdal said:

    First rule of fight club - you never talk about fight club.  Same thing for beta versions. 

    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. 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. Hi,

    I found the difference the content doesn't have any rootelement

    Quote

    ["addresses","combinations","countries","customers","deliveries","groups","image_types","images","order_details","order_invoices","orders","product_feature_values","product_features","product_option_values","product_options","products","stock_availables","stocks"]

    (list of accessible webapi)

    So the question now is "how to have the same behavior Rio ?" (a property I miss ?)


  4. Hi

    I had the idea to migrate an application using TRestxxxxx from 10.3 to version 10.4 and bad news! 😖

    With 10.3 Restdebugger proposed to copy: a THTTPBasicAutenthicator, a TRESTClient, a TRESTRequest, a TRESTResponse, a TRESTResponseDatasetAdapter and an FDmemTable.
    With 10.4 I only end up with the first 4 in itself, it wouldn't matter if I could later add the other two except that ... my results are not there, I should get several rows, I  get only one :classic_wacko:


    So, my migration does not work.

    What note of release would I have missed ? How to do my migration in this case !

    Rio

    Capture.PNG

     

    Sidney

    Capture_1.PNG


  5. 5 hours ago, fcknbstrd said:

    Even if it seems illogical to me, because all is of the same data type. 

    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 :classic_angry: 

    The only track I saw was the 'somewhat' converter but never went so far.


  6. 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

    Quote

    AAA    AAA-1    2
    AAA-1    AAB    4
    AAA-1    AAC    6

    P.S.  Note as I present my script (create table, populate, table etc.) , so it'is easy for anybody to test


  7. 21 hours ago, Henry Olive said:

    UPDATE  INVDETAIL ID
    SET  ID.UPRICELOCAL=(ID.UPRICE-(ID.UPRICE * ID.DISCPERC /100)) * I.CURRRATE
    WHERE EXISTS (SELECT 1 FROM INVOICE I where I.RNO = ID.RNO) 

    Hi, try to replace your SQL by this one (I don't use Interbase but Firebird)

    Quote

    UPDATE  INVDETAIL ID
    SET  ID.UPRICELOCAL=(ID.UPRICE-(ID.UPRICE * ID.DISCPERC /100)) *(SELECT CURRATE FROM INVOICE WHERE RNO=ID.RNO)

    IMHO you will need a whatever rounding function for your result.

    And, well :classic_huh:, I am not a fan of calculated columns in a table (except COMPUTED BY ones) 


  8. Quote

    Disconnect has to be used instead of Close for SQLite. 

    I was surprised I can use also this Disconnect with Firebird the same way

    Quote

    It is just to navigate the current view (nn records we have decided to use for pagination) 

    And the cursor size and position are proportional to those nn records, not the entire set

    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 :classic_wink:

    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

     


  9. 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; 

     


  10. 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 :classic_sleep:) .

    Quote

    Now I'll implement this when using the TListView scrolls... looks like OnScrollViewChange will do. Except it doesn't tell in which direction you scroll.

    I think it's a more a gesture management sort of than a ScrollViewChange 


  11. 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. 


  12. 22 minutes ago, Vandrovnik said:

    Firebird for Android - it works (embedded), but there is no 64bit version for Android at this moment. When you publish your app in Google Play, you need 64bit version too...

    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 !


  13. Well, :classic_dry: , 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. On 6/5/2020 at 12:19 PM, sjordi said:

    Ok I tried DBeaver but unfortunately it doesn't know Interbase.

    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.

    Quote

    I'll write an app myself I guess. Shouldn't be that complicated.

    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  


  16. 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 😉

    • Like 1
×