Page 1 of 1

xBrowse group row

PostPosted: Fri May 30, 2014 7:54 am
by mtajkov
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š

Re: xBrowse group row

PostPosted: Sat May 31, 2014 2:25 pm
by nageswaragunupudi
If you want to browse like in the second picture please try

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

both.

Re: xBrowse group row

PostPosted: Sat May 31, 2014 3:07 pm
by mtajkov
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š

Re: xBrowse group row

PostPosted: Sun Jun 08, 2014 12:19 pm
by nageswaragunupudi
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

Re: xBrowse group row

PostPosted: Thu Dec 07, 2017 4:24 pm
by damianodec
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

Re: xBrowse group row

PostPosted: Thu Dec 07, 2017 4:57 pm
by nageswaragunupudi
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.

Re: xBrowse group row

PostPosted: Mon Dec 11, 2017 9:40 am
by damianodec
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?

Re: xBrowse group row

PostPosted: Mon Dec 11, 2017 9:55 am
by nageswaragunupudi
Please make sure "customer.dbf" is in the same folder.

Re: xBrowse group row

PostPosted: Mon Dec 11, 2017 12:19 pm
by damianodec
Please make sure "customer.dbf" is in the same folder.

yes, it is!

Re: xBrowse group row

PostPosted: Mon Dec 11, 2017 2:43 pm
by nageswaragunupudi
Tested again and it is working here.
Command prompt
Code: Select all  Expand view

cd\fwh\samples
buildh xbrwtree
or
buildx xbrwtree
 

Working

Re: xBrowse group row

PostPosted: Tue Dec 12, 2017 8:40 am
by damianodec
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

Re: xBrowse group row

PostPosted: Tue Dec 12, 2017 8:42 am
by nageswaragunupudi
That is the reason.
If you do a fresh install of FWH you get a full customer.dbf

Re: xBrowse group row

PostPosted: Tue Dec 12, 2017 12:32 pm
by damianodec
hi Mr Rao
yes That was the reason!

thank you.