No values in xbrowse footers, Why?

Post Reply
User avatar
Armando
Posts: 2479
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Contact:

No values in xbrowse footers, Why?

Post 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
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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: No values in xbrowse footers, Why?

Post 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Armando
Posts: 2479
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Contact:

Re: No values in xbrowse footers, Why?

Post by Armando »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: No values in xbrowse footers, Why?

Post 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
Regards

G. N. Rao.
Hyderabad, India
User avatar
Armando
Posts: 2479
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Contact:

Re: No values in xbrowse footers, Why?

Post by Armando »

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
Post Reply