Page 1 of 1

No values in xbrowse footers, Why?

Posted: Thu Dec 26, 2019 7:09 pm
by Armando
Mr. Rao:

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

Code: Select all

            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

Re: No values in xbrowse footers, Why?

Posted: Thu Dec 26, 2019 7:52 pm
by nageswaragunupudi
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

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.

Re: No values in xbrowse footers, Why?

Posted: Thu Dec 26, 2019 11:00 pm
by Armando
Mr. Rao:

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

an other clue?

Regards

Re: No values in xbrowse footers, Why?

Posted: Fri Dec 27, 2019 3:43 am
by nageswaragunupudi
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

#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

Re: No values in xbrowse footers, Why?

Posted: Fri Dec 27, 2019 2:49 pm
by Armando
Mr. Rao:

Don't worry, Now everything is fine.

Thank you very much.

Best regards and, happy new year