Jump to content
Registration disabled at the moment Read more... ×

Leaderboard


Popular Content

Showing content with the highest reputation on 07/29/25 in Posts

  1. FWIW I reported the bad inlining due to the way these methods are implemented in TInterlocked and proposed the improvements in https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-3862
  2. devlopnew

    Project: Daoui Reports What Is It?

    Project: Daoui Reports 🧩 What Is It? Daoui Reports is a dynamic report generator developed using Delphi FireMonkey (FMX), designed to create visually rich, data-driven reports for both Windows and Android platforms. It is a lightweight, open-source alternative to commercial reporting tools like QuickReport or FastReport, offering a simple yet powerful way to design and generate printable or exportable reports directly from SQLite databases. ✅ Key Features Visual Design: Drag-and-drop components (Text, Labels, Images) onto a report template, just like in QuickReport. 🔁 Dynamic Data Binding Connects to a TFDQuery and repeats the Detail section for each record in the dataset. 📄 Automatic Page Breaking Splits content across multiple pages when it exceeds the page height, using IntersectsWith logic. 📸 Screenshot-Based Rendering Uses MakeScreenshot to capture the visual state of each Detail block and render it as an image in the final report. 🖨️ Preview & Print Offers a preview window with zoom and page navigation. Supports direct printing on Android via PrintBitmap 📎 PDF Export (Android) Exports the final report to PDF using Android’s JPdfDocument API. 📱 Cross-Platform Built with FireMonkey for full compatibility with Windows and Android . 💡 No External Dependencies Relies only on native Delphi components and FireDAC—no third-party libraries required. 🏗️ How It Works Design Mode You place visual components (like TText, TLabel) inside a TLayout called Detail. This acts as the template for each data row. Data Binding A TFDQuery is linked to your SQLite database. When the report runs, it loops through each record. Dynamic Height Calculation For each field (especially multi-line text), the system calculates the required height using TTextLayout to ensure text wraps correctly. Page Generation Each record is rendered into the Detail layout. A MakeScreenshot captures its visual state. The image is placed in a TRectangle within ZoneDetail. When the content reaches the bottom of the page (checked via BoundsRect.IntersectsWith), a new page is created. Preview & Output All generated pages are displayed in PreviewF.LayoutZOM as TImage components. From there, users can: Zoom in/out Navigate pages Print Export to PDF (on Android) 📁 Core Units UnitMain.pas Main form with SQL input, data grid, and report settings (show/hide sections). DesignU.pas The engine of the report. Contains DESINGFACT , the core function that generates the report dynamically. PreviewU.pas Handles preview, printing, and PDF export . Manages the display of all report pages. 🎯 Why Use Daoui Reports? Simple & Fast: No complex setup—just design and run. Open & Transparent: Full access to source code for customization. Mobile-Ready: Works seamlessly on Android devices. SQLite-Friendly: Ideal for local database apps. Lightweight: No bloated dependencies or installer packages. 🚀 Ideal For Inventory reports Sales summaries Fish species catalogs (as in the demo) Any application needing simple, printable reports without licensing costs. 💬 In Summary Daoui Reports is a practical, no-frills reporting solution for Delphi developers who want full control over report design and output—without relying on expensive or complex third-party tools. It proves that with smart use of MakeScreenshot, FireMonkey, and FireDAC, you can build a robust reporting system entirely in Delphi. 🔗 GitHub: https://github.com/devlop0/daoui-reports
  3. Anders Melander

    if Obj <> nil then Obj.Free

    Delphi 1 ; procedure TObject.Free ObjectFree: MOV BX,SP LES DI,SS:[BX+4] MOV AX,ES OR AX,DI JE @@1 MOV AL,1 PUSH AX PUSH ES PUSH DI LES DI,ES:[DI] CALL ES:[DI].vtDestroy @@1: RETF 4 Delphi 2 procedure TObject.Free; asm TEST EAX,EAX JE @@exit MOV ECX,[EAX] MOV DL,1 CALL dword ptr [ECX].vtDestroy @@exit: end;
  4. DelphiUdIT

    if Obj <> nil then Obj.Free

    Uhmm, I don't remember how FREE procedure is operational in the old versions of Delphi. If the FREE TObject procedure doesn't test the NIL before destroy it ... So for new Delphi version is OK, but for older you should see.
  5. PeaShooter_OMO

    Need help investigating an app crash

    @Der schöne Günther Do you call the Connected function anywhere? Indy can be used from multiple threads but how you use it will drive that decision. I created a TCP framework using Indy and my Client component has a ListenerThread. So the ListenerThread obviously will be polling for incoming data. Sending will be from other threads, obviously the threads that calls the SendXXX commands. The issue was that inside the sending threads (inside the SendXXX commands) I used to ask via Connected if the connection was still there and that caused anomalies. The problem is that Connected actually reads from the socket and thus you will have multiple threads reading from the socket. Not a good thing to do. So in my framework's functionality one thread read/receives all data and hands it off to an event where whoever implements the event can sync or do whatever it pleases with the data but on the sending side I make sure I don't read the socket. If in your case a thread follows the traditional way of Sending-Reading-Sending-Reading-[repeat] all in itself then make sure you lock that so that only one thread does that at a time but also take note of Connected's consequence.
  6. @@AT I still think you don't understand the function of Interlocked and how it works. Even in your example, you use loops to verify that the function "succeeds." This is legal if the variables are modified by other threads and you enter that "loop" indefinitely until the variables assume an identical value to exit. But since you also mention collisions, I think you actually believe that Interlocks are executed or not based on collisions. That's not the case. It's not a mutex or a semaphore, and it's not a critical section. Interlocked simply protects a memory area from "concurrent" modifications. And note that in reality, most direct memory operations are already intrinsically protected. For example, INTEL guarantees the atomicity of some operations such as direct reading or writing, which involves a register and "byte," word, dword, etc. memory if the memory is aligned. XCHG instructions are also atomic (unlike complex instructions like CMPXCHG) as long as they operate on aligned memory. LOCK can be used on multiple memory-operating instructions to ensure LOCK even in unintended cases (e.g., unaligned memory). Ref: "Intel® 64 and IA-32 Architectures Optimization Reference Manual: Volume 1, April 2024"; Ref: "Intel® 64 and IA-32 Architectures Software Developer’s Manual, March 2025" Caution: Interlocked functions generate a significant delay in instruction execution (i.e., the instruction executes in more clock cycles than normal).
  7. You should be very careful when doing this, because not all code logic protected with locks can be replaced with atomic operations.
  8. chenech

    E-Payment processing software for Delphi

    I use a PayTef company terminal, connected to Wi-Fi, from the application I generate a JSON file with the amount, the invoice number, etc., I send it to them through a PayTef API, once the client has paid or cancelled, I receive an acceptance or rejection code, so I can control payments from my application and for remote payments also through PayTef, a link is generated that is sent to the client by email and I can know if they have paid or not or if the payment has expired the shipment. Paytef | Solución de pago para empresas The protocol is very simple, but I don't know if they work outside of Spain
×