Posts

Showing posts from June, 2018

How to get local IP Address in Delphi

Many time we need to check for local system IP address where our application is running.  And here I have explained several ways to get local IP Address in Delphi.  I have used Delphi Tokyo for the examples so some examples may not execute in old Delphi versions. So lets check the codes... 1. Using Winsock Delphi unit Winsock Unit is a wrapper to Windows Sockets API. This API is generally used to implement client server applications. uses     Winsock; ....... function GetLocalIP: string; type   TaPInAddr = array [0..10] of PInAddr;   PaPInAddr = ^TaPInAddr; var   phe: PHostEnt;   pptr: PaPInAddr;   Buffer: array [0..63] of Ansichar;   i: Integer;   GInitData: TWSADATA; begin   WSAStartup($101, GInitData);   Result := '';   GetHostName(Buffer, SizeOf(Buffer));   phe := GetHostByName(Buffer);   if phe = nil then     Exit;   pptr := PaPInAddr(phe^.h_addr_list);   i := 0;   while pptr^[i] <> nil do   begin     Result := StrPas(inet_ntoa(pptr^[i

Create or design own Preview Form using Fortes report

Image
In my last blog I have explained how to design Label reports by using Fortes Report and its components. In this blog I will show you how to design our own preview form using TRLPreview component that we can use to show saved report files in .rpf format. And for more detail about Fortes Report please visit  Fortes Report and Components . So now lets design Preview form with Fortes Report components. 1. First create a project and add a form to the project lets say Unit1 (Form1). 2. Add TRLPreview component to the form and set Align=alClient. And set following properties RLPreview1: TRLPreview   Left = 0   Top = 22   Width = 866   Height = 488   HorzScrollBar.Tracking = True   VertScrollBar.Tracking = True   Align = alClient   TabOrder = 0 3. Add TToolbar component and set following properties. Here I have not used any Timagelist to show images in buttons but we can use. ToolBar1: TToolBar   Left = 0   Top = 0   Width = 866   Height = 22