FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper TBrowse & report objects in FiveWin.
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
TBrowse & report objects in FiveWin.
Posted: Sat May 24, 2008 08:10 AM

I'm new to FiveWin. :oops: I have a generic routine for browsing files in Clipper. I called it DbBrowse(nRow1, nCol1, nRow2, nCol2, aoColumns, ...). Basically I send the coordinates and the Columns (array) and that's it. How can I implement these using FiveWin ?

How can I implement a report with preview ? I need the simplest example of both (TBrowse & a report) using FiveWin. Thank you.

Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
TBrowse & report objects in FiveWin.
Posted: Sat May 24, 2008 01:21 PM

HunterEc:

There are many samples in C:\FW\Samples folder, I'm sure you
will find what you need.

Regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TBrowse & report objects in FiveWin.
Posted: Sat May 24, 2008 01:41 PM
This is a simple way to create a browse:
   @ 1, 1 LISTBOX oLbx ;
        FIELDS Clients->Name, AllTrim( Clients->Address ),;
                   Clients->Phone, Str( Clients->Age, 3 ) ;
        HEADERS    "Name", "Address", "Phone", "Age" ;
        FIELDSIZES 222, 213, 58, 24 ;
        SIZE 284, 137 OF oWnd


A simple way to create a Report with preview:
#include "FiveWin.ch"
#include "report.ch"

function Main()

     local oReport

     USE TEST INDEX TEST NEW

     REPORT oReport TITLE  "*** My First Report ***" PREVIEW

     COLUMN TITLE "St"         DATA Test->State
     COLUMN TITLE "First Name" DATA Test->First
     COLUMN TITLE "   Salary"  DATA Test->Salary

     END REPORT

     oReport:CellView()

     ACTIVATE REPORT oReport

     CLOSE TEST

RETURN NIL
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
TBrowse & report objects in FiveWin.
Posted: Sat May 24, 2008 09:19 PM

Antonio:

Thank you for your help and GREAT support. On the browse subject, is there a way to receive the columns as PARAMETERS and then do the browse. This way I can port my generic TBrowse routine? On the example that you posted, fields are hard coded. Thanks in advance.

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TBrowse & report objects in FiveWin.
Posted: Sat May 24, 2008 09:54 PM
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg, oBrw

    USE TEST

    DEFINE DIALOG oDlg;
           SIZE 800, 600

    @ 0, 0 LISTBOX oBrw FIELDS

    oBrw:bLine = &( "{ || { TEST -> last, TEST -> first } }" )

    ACTIVATE DIALOG oDlg;
             ON INIT oDlg:SetControl( oBrw );
             CENTER

    CLOSE

    RETURN NIL


EMG
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Embedding the listbox in a window.
Posted: Sat May 24, 2008 10:25 PM

Enrico: thank you very much for your example. Now, how can I make this LISTBOX pop up when the user press, for example, F2 to activate a lookup window (which will be the listbox). Thank you.

Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Using DBFCDX
Posted: Sat May 24, 2008 10:31 PM

Enrico: if I use the Test file VIA DBFCDX in your example and REQUEST & link the library, the LISTBOX does not come up on screen. Any thoughts on this? Thank you.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TBrowse & report objects in FiveWin.
Posted: Sun May 25, 2008 07:34 AM

Gustavo,

You have all the required tools to build your application in 32 bits with Harbour/xHarbour and FWH.

We strongly recommend you to migrate your application to 32 bits. It will solve many troubles

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Embedding the listbox in a window.
Posted: Sun May 25, 2008 08:05 AM
HunterEC wrote:Enrico: thank you very much for your example. Now, how can I make this LISTBOX pop up when the user press, for example, F2 to activate a lookup window (which will be the listbox). Thank you.


SETKEY( VK_F2, { || YourLookUpFunction() } )


or better

oDlg:bKeyDown = { || If( GetKeyState( VK_F2 ), YourLookUpFunction(), ) }


EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Using DBFCDX
Posted: Sun May 25, 2008 08:07 AM
HunterEC wrote:Enrico: if I use the Test file VIA DBFCDX in your example and REQUEST & link the library, the LISTBOX does not come up on screen. Any thoughts on this? Thank you.


#include "Fivewin.ch"


REQUEST DBFCDX


FUNCTION MAIN()

    LOCAL oDlg, oBrw

    RDDSETDEFAULT( "DBFCDX" )

    USE TEST

    DEFINE DIALOG oDlg;
           SIZE 800, 600

    @ 0, 0 LISTBOX oBrw FIELDS

    oBrw:bLine = &( "{ || { TEST -> last, TEST -> first } }" )

    ACTIVATE DIALOG oDlg;
             ON INIT oDlg:SetControl( oBrw );
             CENTER

    CLOSE

    RETURN NIL


EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Using DBFCDX
Posted: Sun May 25, 2008 08:08 AM

Anyway, I agree with Antonio: 32 bit is the way to go. 16 bit is a dead platform.

EMG

Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Thanks...
Posted: Mon May 26, 2008 03:59 AM

Enrico:
Thank you for your help & suggestion to move up to 32 bits. :)

Continue the discussion