xBrowse group row

xBrowse group row

Postby mtajkov » Fri May 30, 2014 7:54 am

I have dbf:

Image

I would like to browse receive the following:

Image

I tried to use oBrw:invoice:lMergeVert := .t. ... but how to group the column total as a rule column invoice?

Regards,
Miloš
mtajkov
 
Posts: 83
Joined: Sun Mar 08, 2009 4:33 pm

Re: xBrowse group row

Postby nageswaragunupudi » Sat May 31, 2014 2:25 pm

If you want to browse like in the second picture please try

oBrw:Invoice:lMergeVert := .t.
oBrw:Total:lMergeVert := .t.

both.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 5424
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse group row

Postby mtajkov » Sat May 31, 2014 3:07 pm

If I try

oBrw:Invoice:lMergeVert := .t.
oBrw:Total:lMergeVert := .t.

total column is not grouped correctly, I do not want this result:

Image

Regards,
Miloš
mtajkov
 
Posts: 83
Joined: Sun Mar 08, 2009 4:33 pm

Re: xBrowse group row

Postby nageswaragunupudi » Sun Jun 08, 2014 12:19 pm

Please try the logic in this sample program:
Code: Select all  Expand view
#include "FiveWin.Ch"
#include "xbrowse.ch"

//----------------------------------------------------------------------------//

REQUEST DBFCDX

//----------------------------------------------------------------------------//

function Main()

   local oDlg, oFont, oBrw

   CreateTestDBF()
   USE TEST
   SET ORDER TO TAG INVOICE
   GO TOP

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 500,250 PIXEL FONT oFont

   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg DATASOURCE "TEST" ;
      COLUMNS "INVOICE", "INVOICE", "DATEPAY", "PAYMENT" ;
      HEADERS "INVOICE", "TOTAL",   "DATEPAY", "PAYMENT" ;
      CELL LINES NOBORDER

   WITH OBJECT oBrw
      :nStretchCol            := 1
      :Invoice:lMergeVert     := .t.
      WITH OBJECT :Total
         :lMergeVert          := .t.
         :bStrData            := { || TRANSFORM( TEST->TOTAL, NumPict( 10, 2 ) ) }
         :nDataStrAlign       := AL_RIGHT
         :nHeadStrAlign       := AL_RIGHT
         :cSortOrder          := ""
      END

      //
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return (0)

//----------------------------------------------------------------------------//


static function CreateTestDBF()

   field INVOICE

   if ! File( "TEST.DBF" )

      DbCreate( "TEST", { ;
         { "INVOICE",   'C',  3, 0 }, ;
         { "TOTAL",     'N', 10, 2 }, ;
         { "DATEPAY",   'D',  8, 0 }, ;
         { "PAYMENT",   'N', 10, 2 }  }, "DBFCDX", .t., "TEST" )

      FW_ArrayToDBF( { ;
         { "101", 1000, {^ 2014/05/01 },  500 }, ;
         { "101", 1000, {^ 2014/05/05 },  500 }, ;
         { "101", 1000, {^ 2014/05/05 },  100 }, ;
         { "102", 1000, {^ 2014/05/10 },  300 }, ;
         { "102", 1000, {^ 2014/05/15 },  600 }, ;
         { "103", 2000, {^ 2014/05/15 }, 1000 }  } )

      INDEX ON INVOICE TAG INVOICE

      CLOSE DATA
   endif

return nil

//----------------------------------------------------------------------------//

init procedure PrgInit

    SET DATE GERMAN
    SET CENTURY ON

    SET DELETED ON
    SET EXCLUSIVE OFF

    RDDSETDEFAULT( "DBFCDX" )

    XbrNumFormat( 'E', .t. )

return

//----------------------------------------------------------------------------//
 




Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 5424
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse group row

Postby damianodec » Thu Dec 07, 2017 4:24 pm

hi Mr. Rao
about this xBrowse,
I would like one row for each INVOICE and put near to INVOICE NUMBER "+" or "-" bmp to expande or collapse (under the INVOICE NUMBER or
to the right is indifferent) that INVOICE with value details

is it possible?

thank you
ciao
Damiano
User avatar
damianodec
 
Posts: 221
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: xBrowse group row

Postby nageswaragunupudi » Thu Dec 07, 2017 4:57 pm

That is achieved by Tree browse. Most of the time, we adopt tree browse for similar cases.

In this case, the user wanted this way, so I provided this solution for him.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 5424
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse group row

Postby damianodec » Mon Dec 11, 2017 9:40 am

hi Mr. Rao
I'm trying wbrwtree sample but get rhis error:
Application
===========
Path and name: C:\fwh1709\samples\xbrwtree.exe (32 bits)
Size: 3,488,768 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20161218)
FiveWin version: FWHX 17.09
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 0 secs
Error occurred at: 12/11/17, 10:40:17
Error description: Error BASE/1004 Class: 'NIL' has no exported method: CARGO
Args:
[ 1] = U

Stack Calls
===========
Called from: => CARGO( 0 )
Called from: xbrwtree.prg => MAIN( 19 )

any help?
ciao
Damiano
User avatar
damianodec
 
Posts: 221
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: xBrowse group row

Postby nageswaragunupudi » Mon Dec 11, 2017 9:55 am

Please make sure "customer.dbf" is in the same folder.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 5424
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse group row

Postby damianodec » Mon Dec 11, 2017 12:19 pm

Please make sure "customer.dbf" is in the same folder.

yes, it is!
ciao
Damiano
User avatar
damianodec
 
Posts: 221
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: xBrowse group row

Postby nageswaragunupudi » Mon Dec 11, 2017 2:43 pm

Tested again and it is working here.
Command prompt
Code: Select all  Expand view

cd\fwh\samples
buildh xbrwtree
or
buildx xbrwtree
 

Working
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 5424
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse group row

Postby damianodec » Tue Dec 12, 2017 8:40 am

hi Mr Rao
my Customer.dbf is empty.
if I try to open it by DBF editor i get INVALID DBF file
if I try to open it by excel (file dBase) it has just COLUMN HEADER

thank you
ciao
Damiano
User avatar
damianodec
 
Posts: 221
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: xBrowse group row

Postby nageswaragunupudi » Tue Dec 12, 2017 8:42 am

That is the reason.
If you do a fresh install of FWH you get a full customer.dbf
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 5424
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse group row

Postby damianodec » Tue Dec 12, 2017 12:32 pm

hi Mr Rao
yes That was the reason!

thank you.
ciao
Damiano
User avatar
damianodec
 
Posts: 221
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 8 guests