No values in xbrowse footers, Why?

No values in xbrowse footers, Why?

Postby Armando » Thu Dec 26, 2019 7:09 pm

Mr. Rao:

Perhaps you can help me. with the above code the xbrowse footers are 0.00 values

Code: Select all  Expand view  RUN

            REDEFINE XBROWSE oBrx ID 202 OF oDlg;
                DATASOURCE oRsCxc ;
                COLUMNS "CXC_TIP","CXC_SER","CXC_NUM","CXC_FDE","CXC_FDV","CXC_REF","","";
                HEADERS "Tipo","Serie","Folio","Fecha","Vence","Referencia","Cargos","Abonos";
                COLSIZES 30,30,50,75,75,110,110,110;
                PICTURES NIL,NIL,"@Z 9999999","dd/mmm/yyyy","dd/mmm/yyyy",NIL,"@Z 999,999,999,999.99","@Z 999,999,999,999.99";
                JUSTIFY {AL_LEFT,AL_LEFT,AL_RIGHT,AL_RIGHT,AL_RIGHT,AL_LEFT,AL_RIGHT,AL_RIGHT};
                FOOTERS AUTOSORT

                    WITH OBJECT :aCols[07]
                    :nFootStrAlign  := AL_RIGHT
                        :bStrData       := { || IF(oRsCxc:RecordCount() > 0 .AND. oRsCxc:Fields("CXC_COA"):Value == 1,;
                                                                    TRANSFORM(oRsCxc:Fields("CXC_IMP"):Value,"@Z 999,999,999,999.99"),SPACE(01))}
                        :nHeadStrAlign  := AL_RIGHT

                        :nFooterType    := AGGR_SUM
                        :cFooterPicture := "@Z 999,999,999,999.99"
                    END

                    WITH OBJECT :aCols[08]
                    :nFootStrAlign  := AL_RIGHT
                        :bStrData       := { || IF(oRsCxc:RecordCount() > 0 .AND. oRsCxc:Fields("CXC_COA"):Value == 2,;
                                                                    TRANSFORM(oRsCxc:Fields("CXC_IMP"):Value,"@Z 999,999,999,999.99"),SPACE(01))}
                        :nHeadStrAlign  := AL_RIGHT
                        :nFooterType    := AGGR_SUM
                        :cFooterPicture := "@Z 999,999,999,999.99"
                    END
                    :MakeTotals()
 


Best 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
User avatar
Armando
 
Posts: 3229
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: No values in xbrowse footers, Why?

Postby nageswaragunupudi » Thu Dec 26, 2019 7:52 pm

Please do not use bStrData. Deprecated many years back.
When you use bStrData (character value), xbrowse does not know the value to be totalled.

Please try this code (I hope your FWH version is not very old)
Code: Select all  Expand view  RUN
REDEFINE XBROWSE oBrx ID 202 OF oDlg;
    DATASOURCE oRsCxc ;
    COLUMNS "CXC_TIP","CXC_SER","CXC_NUM","CXC_FDE","CXC_FDV","CXC_REF", ;
            "IF( CXC_COA == 1, CXC_IMP, 0.00 )","IF( CXC_COA == 2, CXC_IMP, 0.00 )";
    HEADERS "Tipo","Serie","Folio","Fecha","Vence","Referencia","Cargos","Abonos";
    FOOTERS AUTOSORT

    WITH OBJECT :aCols[07]
        :nFooterType    := AGGR_SUM
    END

    WITH OBJECT :aCols[08]
        :nFooterType    := AGGR_SUM
    END
    :MakeTotals()
 


Request you to please always indicate the version of FWH you are using.
Regards

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

Re: No values in xbrowse footers, Why?

Postby Armando » Thu Dec 26, 2019 11:00 pm

Mr. Rao:

I use FWH 1905, and your advise does not work, the xBrowse row show blanks cols.

an other clue?

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
User avatar
Armando
 
Posts: 3229
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: No values in xbrowse footers, Why?

Postby nageswaragunupudi » Fri Dec 27, 2019 3:43 am

I use FWH 1905, and your advise does not work, the xBrowse row show blanks cols.

Sorry, there is a small bug in xbrowse. Please try this sample.
Code: Select all  Expand view  RUN
#include "fivewin.ch"

function Main()

   local oCn, oRs, oDlg, oFont, oBrw

   oCn   := FW_MSSQLDB()
   oRs   := FW_OpenRecordSet( oCn, "CXC" )

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 900,400 PIXEL OF oDlg FONT oFont ;
      TITLE FWVERSION + " : USING EXPESSIONS IN COLUMNS CLAUSE"

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg DATASOURCE oRs ;
      COLUMNS "CXC_TIP","CXC_SER","CXC_NUM", "CXC_FDE","CXC_FDV","CXC_REF", ;
               "IF( CXC_COA - 1 == 0, CXC_IMP, 0.00 )", ;
               "IF( CXC_COA - 2 == 0, CXC_IMP, 0.00 )" ;
      HEADERS "Tipo","Serie","Folio","Fecha","Vence","Referencia","Cargos","Abonos";
      PICTURES NIL,NIL,"@Z 9999999","dd/mmm/yyyy","dd/mmm/yyyy",NIL,"@Z 999,999,999,999.99","@Z 999,999,999,999.99" ;
      CELL LINES FOOTERS NOBORDER AUTOSORT

   WITH OBJECT oBrw
      :nStretchCol         := 6
      :Cargos:nFooterType  := AGGR_SUM
      :Abonos:nFooterType  := AGGR_SUM
      :MakeTotals()
      //
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

   oRs:Close()
   oCn:Close()

return nil
 


Image
Regards

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

Re: No values in xbrowse footers, Why?

Postby Armando » Fri Dec 27, 2019 2:49 pm

Mr. Rao:

Don't worry, Now everything is fine.

Thank you very much.

Best regards and, happy new year
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
User avatar
Armando
 
Posts: 3229
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México


Return to FiveWin for Harbour/xHarbour

Who is online

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