Jump to content

bzwirs

Members
  • Content Count

    39
  • Joined

  • Last visited

Posts posted by bzwirs


  1. Using Delphi 12, Woll2Woll Firepower Data Grid, Firedac Query, SQLite DB

     

    Have an app that has been used for couple of years without any significant issues until recent compile with Delphi 12.  The issue is with editing an integer field in a Firepower data grid.  For the field keyboard type I have selected the numberpad type.  Previously users have always been able to select the minus sign to input a negative number but this no longer works since the last compile for Android. 

     

    Can anybody please help with advice on how to fix this issue.

     

    Bill Zwirs

     

     


  2. I am trying to parse a json response to retrieve a nested record without any success.  Example of the json response is:

     

    {
      "status": "1",
      "info": "success",
      "page_info":   {
        "total_page": "1",
        "record_per_page": "1",
        "current_page": "1",
        "total_record": "1"
      },
      "records": [  {
        "machine_id": "25884",
        "imei": "",
        "install_date": "",
        "last_report": "",
        .......
        .......
        "coin_mech":     {
          "coin_mech_id": "12345",
          "cm_model": "",
          "serial_no": "",
          "revision": "",
          "coin_in_tube": "",
          "tubes":       [
                    {
              "tube_id": "3469107",
              "tube_no": "4",
              "coin_unit": "100",
              "coin_count": "93",
              "coin_inserted": "0",
              "coin_dispensed": "0",
              "tube_full": "0"
            },
                    {
              "tube_id": "3469105",
              "tube_no": "5",
              "coin_unit": "200",
              "coin_count": "9",
              "coin_inserted": "0",
              "coin_dispensed": "0",
              "tube_full": "0"
            }
          ]
        }
      }]
    }

     

    The info I am after is the records for "tubes" which can contain up to 5 records (2 in the above example) .  Have tried several of the coding examples that I found in stackoverflow without success although I have not found an example with a similar record structure.   

     

    Can someone please advise me on how to retrieve those records (would be great if in a dataset).

     

    Thanks in advance.

     

    Bill Zwirs


  3. Thanks....you were right.  I was able to increase the records_per_page setting in the url request which maxed at 200.  Any higher and it went to default of 30.  I then did multiple requests (of 200) for each page (as you suggested) which were combined into one dataset and all worked fine. 

     

    Thanks for your help.

     

    Bill


  4. I have used Rest Debugger to set up my components (Client, Request, Response, DatasetAdapter and TDFMemTbl) to populate the MemTable with all the records from the "records' part of the response.  When I execute the Request I get a Response Ok, part of which is shown below:

     

    {"status":"1","info":"success","page_info":{"total_page":"21","record_per_page":"50","current_page":"1","total_record":"1029"},"records":[{"machine_id":"16748","imei":"8615850........................

     

    If I right click the MemTable to view the "records" data all I get is the 50 records  (ie. "records_per_page":"50").  I simply want  to use the MemTable dataset in a report (using Fast Report) so need ALL records available which, according to the response should be 1029.  The report I have created only shows the 50 records at this stage.

     

    So my question is......how do I get all the records from the Response to show in the MemTable?

     

    Any assistance would be appreciated.

     

    Thanks

     

    Bill


  5. Delphi 11.2

     

    I use Winsoft Pdfium for FireMonkey to create a PDF that includes a graphic (png saved to a SQLite table field).  The graphic is inserted into the pdf document (as the document is being created) with the following code:

     

    Sig := tMemoryStream.Create;

    try

      MarafillerDM.EMUInvQrySIGNATURE.SaveToStream(Sig);

      var aBitMap := FMX.Graphics.TBitmap.Create;

      try

        aBitMap.LoadFromStream(Sig);

        MarafillerDM.FPdf1.AddPicture(aBitMap,18,135,230,80);

      finally

        aBitMap.Free;

      end;

    finally

      Sig.Free;

    end;

     

    Up until a couple of weeks ago this worked for both Windows and Android without any problems but now I get an 'Unsupported Pixal Format' error from the Winsoft AddPicture procedure - but only on Android devices (Samsung Tab 6 Lite).  On Windows it still works fine.  Haven't changed anything in my Delphi environment (updates etc) between it working and not working.

     

    Has anyone else experienced this.  Would appreciate any help with this issue.

     

    Bill Zwirs

     


  6. Have recompiled an app for Android with Delphi 11.3 and now get the following error when entering numbers into a dbdatagrid (Firepower) and tmsfnc edit control (in both cases have keyboard set to numberpad):

     

    Eval Error in:

    java.lang.indexoutofboundsexception

    setspan(3...3) ends beyond length 1.

     

    The error only occurs on Android tablet - not on Windows version.  Have never seen this error before under previous versions of Delphi.  Can someone please shed some light on this problem and point me in the right direction to fix it.

     

    Bill


  7. Have updated to Delphi 11.3.

    FMX App

     

    Since updating I now get an access violation when using the 'Generate Sql' button from the TFDUpdateSQL component.

     

    image.thumb.png.7379bf3b015c665f7bb552d9512d811d.png

     

    What can I do to fix this problem? This has never happened under previous versions of Delphi.

     

    Bill

     


  8. The first install I opted to save registry entries which normally means I don't have to reinstall the 3rd party components that I use and then I was getting that error.  This time I did the opposite and reinstalled the 3rd party components I use and get no error when opening that project.  So assume that it must have something to do with a corrupted 3rd party setting in registry from first install.  In hindsight, I may have achieved the same result by simply just reinstalling the 3rd party components.  Just for your interest, the 3rd party components I use in that particular project are TMS, Woll2Woll, HTML Editor and PDFium (WinSoft).

    • Like 1

  9. Have reinstalled Delphi with delete registry entries option this time and reinstalled all 3rd party components.....project now opens without error and compiles for Win32.  Unable to compile for Android yet but have found that SDK paths are not there so probably need to reinstall Android SDK.

    • Like 1

  10. I tried your suggestion re copying the dpr and dproj files to another directory.  Opened Ok, just complained about other units not being there which would be expected.  There are only 3 pas files to this project - Main, Datamodule and proxy file.  I first introduced the proxy and datamodule files and in both cases opened Ok except for complaining about the file not there.  So finally got the error when I introduced the main file.  The main file code shows in the IDE but when I select the Design tab then Delphi closes down completely.  So I figure the problem is in the .fmx file.  Is there anything in particular that I can look for in that file?  

     

    At this stage I am thinking about a complete reinstall of Delphi (third party components and all) to see if that helps before I try anything else.


  11. Thanks for your advice Dalija.

     

    I have tried to open it through File/Open as you suggested but that didn't work for me.  Over the next few days (when I get some time) I will try your other option in trying to re-create from scratch.  I'll let you know how it went.

     

    Thanks again.

     

    Bill


  12. Just updated to 11.3 (from 11.2) and now get an error when I launch one of my FMX apps in the IDE.  The error is:

     

    Danger

    Stack overflow - save your work and restart Delphi 11.

     

    and the .dpr file is displayed on screen.   I have other FMX apps that I can successfully rebuild in 11.3 without any problems.

     

    Any suggestions as to where I should look to resolve this issue.

     

    Thanks in advance.

     

    Bill


  13. For adding text with color (aDocketNum being a string variable):

     

    FPdf1.AddText(aDocketNum, 'Arial', 14, 500, 755,TAlphaColorRec.Red);

     

    For drawing a filled rectangle:

     

    FPdf1.CreatePath(15, 550, fmAlternate,TAlphaColorRec.Blue, True, TAlphaColorRec.Black, 1.0);
    FPdf1.LineTo(15, 576);
    FPdf1.LineTo(577, 576);
    FPdf1.LineTo(577, 550);
    FPdf1.ClosePath;
    FPdf1.AddPath;

     

    FPdf1 is component supplied with Winsoft PDFium.

     

    Bill

     

     

×