symbol € on xbrowse

User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

symbol € on xbrowse

Post by Silvio »

How insert this symbol on a row of xbrowse and on footer ?
I made this but not show the symbol €

Code: Select all

WITH OBJECT   oRLbx
                             WITH OBJECT   oRLbx:aCols[ 6 ]
                                :cFooter:="Totale :"
                                END
                             WITH OBJECT   oRLbx:aCols[ 7 ]
                                                  :nDataStrAlign := AL_RIGHT
                                                  :cEditPicture := '@€ 99,999.99'
                                                  :lTotal := .t.
                                                  :nTotal := 0
                                                  :nFooterType := AGGR_TOTAL
                                                  :nFootStrAlign := AL_RIGHT
                                               END
                                           END

                                   WITH OBJECT   oRLbx
                                               :nFooterLines        := 1
                                               :nStretchCol    :=-1
                                               :lFooter:= .T.

                                        END
Best Regards, Saludos

Falconi Silvio
Romano
Posts: 19
Joined: Thu Oct 01, 2009 7:15 am

Re: symbol € on xbrowse

Post by Romano »

Silvio,

try with cEditPicture:= "Alt+128 999,99"

(Alt + 128 is the symbol of euro )

Best Regards
Saluti
Giuseppe Romano
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: symbol € on xbrowse

Post by Silvio »

not run !
Best Regards, Saludos

Falconi Silvio
User avatar
mastintin
Posts: 1502
Joined: Thu May 27, 2010 2:06 pm

Re: symbol € on xbrowse

Post by mastintin »

This run for me ...

: :cEditPicture := "@ €99,999.99"

Best Regards
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: symbol € on xbrowse

Post by anserkk »

The below given code is working fine for me
Image

Code: Select all

Function Main()
    
   Local oDlg,oBrw
   Local aData:={ {"Item 1",23.00},;
                   {"Item 2",10.50},; 
                   {"Item 3", 0.60},;                    
                   {"Item 4", 0.00},;                    
                   {"Item 5", 0.00},;                    
                   {"Item 6", 0.00} }
                   
    DEFINE DIALOG oDlg TITLE "Testing xBrowse"
    
    @0,0 XBROWSE oBrw SIZE 0,0 PIXEL OF oDlg;
        COLUMNS 1,2 ;
        HEADERS "Item Name", "Amount" ;
        PICTURES ,"9999.99" ;
        ARRAY aData CELL LINES FOOTERS NOBORDER FASTEDIT
        
        
    oBrw:ItemName:cFooter:="Total"        
     
    WITH OBJECT oBrw:Amount
        :nEditType := EDIT_GET
        :cEditPicture := '@ €99,999.99'        
        :lTotal:=.T.
        :nTotal:=0.00
    END
    
    oBrw:MakeTotals() 
    oBrw:nStretchCol  := STRETCHCOL_WIDEST        
    oBrw:CreateFromCode()        
    
    ACTIVATE DIALOG oDlg CENTERED        
Return    
Regards
Anser
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: symbol € on xbrowse

Post by Silvio »

Anserk
can you help me please

Look it please

Can you try this test sample please

it create also the dbf

Code: Select all


#include "FiveWin.ch"
#include "Report.ch"
#include "xBrowse.ch"

REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO

Function Main()

   Local oDlg,oBrw,aBrowseRb
   Local aData:={ {"Item 1",23.00},;
                   {"Item 2",10.50},;
                   {"Item 3", 0.60},;
                   {"Item 4", 0.00},;
                   {"Item 5", 0.00},;
                   {"Item 6", 0.00} }




   RddSetDefault( "DBFCDX" )

    Crea_dbf()   //create and popolate dbf

    DEFINE DIALOG oDlg TITLE "Testing xBrowse"

    @0,0 XBROWSE oBrw SIZE 0,0 PIXEL OF oDlg;
         CELL LINES FOOTERS NOBORDER FASTEDIT

                        aBrowseRb   := { { { || RB->CodArt }, i18n("Codice"), 40 },;
                                         { { || RB->Articolo}, i18n("Articolo"),140 },;
                                         { { || RB->Misura}, i18n("Unità"), 50 },;
                                         { { || RB->Quantita}, i18n("Qt."), 30 },;
                                         { { || RB->Iva}, i18n("Iva"), 30 },;
                                         { { || RB->Unitario}, i18n("Unitario"), 80 },;
                                         { { || TRANSFORM( RB->Totale,'@E 999,999.99')}, i18n("Totale"), 90 } }


                       FOR i := 1 TO Len(aBrowseRb)
                             oCol := oBrw:AddCol()
                             oCol:bStrData := aBrowseRb[ i, 1 ]
                             oCol:cHeader  := aBrowseRb[ i, 2 ]
                             oCol:nWidth   := aBrowseRb[ i, 3 ]
                          NEXT






                          WITH OBJECT oBrw:aCols[ 1 ]
                                      :cFooter:="Total"
                                  END
    WITH OBJECT oBrw:aCols[ 6 ]
        :nEditType := EDIT_GET
        :cEditPicture := '@ €99,999.99'
        :lTotal:=.T.
        :nTotal:=0.00
    END

    oBrw:MakeTotals()
    oBrw:nStretchCol  := STRETCHCOL_WIDEST
    oBrw:CreateFromCode()

    ACTIVATE DIALOG oDlg CENTERED
    close all
    Return



     Function Crea_dbf()

        DbCreate('RB', {{'Documento' , 'C',   10,   0}  ,;
                         {'CodArt'       , 'C',   4,   0} ,;
                         {'Articolo'     , 'C',   30,   0} ,;
                         {'Misura'       , 'C',   8,    0} ,;
                         {'Quantita'     , 'N',   4,    0} ,;
                         {'Iva'          , 'N',   5,    2} ,;
                         {'Unitario'     , 'N',   10,    2} ,;
                         {'Totale'       , 'N',  10,    2}}, 'DBFCDX')

       close all
      use &('RB') alias RB new
      select RB
      if FILE('RICAMBI.DBF')
         delete file &('RICAMBI.cdx')
         append from &('RICAMBI')
         dbcommitall()
         close all
         delete file &('RICAMBI.dbf')
      endif
      close all
      rename &('RB.dbf') to &('RICAMBI.dbf')
      close all


      use ricambi alias RB new
              For n=1 to 30
             RB->(DbAppend())
             Replace   RB->Documento   with "0010"
             Replace   RB->CodArt      with strzero(n,4)
             Replace   RB->Articolo    with str(n)
             Replace   RB->Misura      with "SC"
             Replace   RB->Quantita    with n+1
             Replace   RB->Iva         with 20
             Replace   RB->Unitario    with n
             Replace   RB->Totale      with (n*n)
            next
      return nil

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









 
Best Regards, Saludos

Falconi Silvio
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: symbol € on xbrowse

Post by anserkk »

Silvio wrote:Anserk
can you help me please
Image

Code: Select all

#include "FiveWin.ch"
#include "Report.ch"
#include "xBrowse.ch"

REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO
//------------------//
Function Main()

    Local oDlg,oBrw,aBrowseRb

    RddSetDefault( "DBFCDX" )

    Crea_dbf()   //create and popolate dbf
    
    DEFINE DIALOG oDlg TITLE "Testing xBrowse"
    
    @0,0 XBROWSE oBrw SIZE 0,0 PIXEL OF oDlg ; //ALIAS "RB";
         CELL LINES FOOTERS NOBORDER FASTEDIT
    
    aBrowseRb   := { { { || RB->CodArt }, i18n("Codice"), 40 },;
                     { { || RB->Articolo}, i18n("Articolo"),140 },;
                     { { || RB->Misura}, i18n("Unità"), 50 },;
                     { { || RB->Quantita}, i18n("Qt."), 30 },;
                     { { || RB->Iva}, i18n("Iva"), 30 },;
                     { { || RB->Unitario}, i18n("Unitario"), 80 },;
                     { { || TRANSFORM( RB->Totale,'@E 999,999.99')}, i18n("Totale"), 90 } }
    
    
    FOR i := 1 TO Len(aBrowseRb)
        oCol := oBrw:AddCol()
        oCol:bEditValue := aBrowseRb[ i, 1 ] // Changed to bEditValue from bStrData
        oCol:cHeader  := aBrowseRb[ i, 2 ]
        oCol:nWidth   := aBrowseRb[ i, 3 ]
    NEXT
    
    WITH OBJECT oBrw:aCols[ 1 ]
       :cFooter:="Total"
    END
    
    WITH OBJECT oBrw:aCols[ 6 ]
        :nEditType := EDIT_GET
        :cEditPicture := '@ €99,999.99'
        :lTotal:=.T.
        :nTotal:=0.00
    END

    oBrw:SetRDD()   
    oBrw:MakeTotals()
    oBrw:nStretchCol  := STRETCHCOL_WIDEST
    oBrw:CreateFromCode()
    
    ACTIVATE DIALOG oDlg CENTERED
    Close All
Return


//----------------------------
Function Crea_dbf()

    DbCreate('RB', {{'Documento' , 'C',   10,   0}  ,;
                     {'CodArt'       , 'C',   4,   0} ,;
                     {'Articolo'     , 'C',   30,   0} ,;
                     {'Misura'       , 'C',   8,    0} ,;
                     {'Quantita'     , 'N',   4,    0} ,;
                     {'Iva'          , 'N',   5,    2} ,;
                     {'Unitario'     , 'N',   10,    2} ,;
                     {'Totale'       , 'N',  10,    2}}, 'DBFCDX')
    
    close all
    use &('RB') alias RB new
    select RB
    if FILE('RICAMBI.DBF')
        delete file &('RICAMBI.cdx')
        append from &('RICAMBI')
        dbcommitall()
        close all
        delete file &('RICAMBI.dbf')
    endif
    close all
    rename &('RB.dbf') to &('RICAMBI.dbf')
    close all
    
    
    use ricambi alias RB new
       For n=1 to 30
         RB->(DbAppend())
         Replace   RB->Documento   with "0010"
         Replace   RB->CodArt      with strzero(n,4)
         Replace   RB->Articolo    with str(n)
         Replace   RB->Misura      with "SC"
         Replace   RB->Quantita    with n+1
         Replace   RB->Iva         with 20
         Replace   RB->Unitario    with n
         Replace   RB->Totale      with (n*n)
        next
        Go Top
        
return nil
We are advised to use bEditValue only. Codeblocks returning any datatype ( numeric, date, or whatever ) can be assigned to bEditValue. XBrowse internally constructs bStrData codeblock from bEditValue and cEditPicture ( if assigned ).

Here is the another way (easiest) way of using xBrowse.

Code: Select all

Function Main()

    Local oDlg,oBrw

    RddSetDefault( "DBFCDX" )

    Crea_dbf()   //create and popolate dbf
    
    DEFINE DIALOG oDlg TITLE "Testing xBrowse"
    
    @0,0 XBROWSE oBrw SIZE 0,0 PIXEL OF oDlg ALIAS "RB";
        COLUMNS 'RB->CodArt','RB->Articolo','RB->Misura','RB->Quantita','RB->Iva','RB->Unitario','RB->Totale' ;
        COLSIZES 40,140,50,30,40,80,90 ;
        HEADERS i18n("Codice"),i18n("Articolo"), i18n("Unità"),i18n("Qt."),i18n("Iva"),i18n("Unitario"),i18n("Totale") ;
        PICTURES ,,,,,'@ €99,999.99','@E 999,999.99' ;
        CELL LINES FOOTERS NOBORDER FASTEDIT
    
    WITH OBJECT oBrw:aCols[ 1 ]
       :cFooter:="Total"
    END
    
    WITH OBJECT oBrw:aCols[ 6 ]
        :nEditType := EDIT_GET
        :lTotal:=.T.
        :nTotal:=0.00
    END
   
    oBrw:MakeTotals()
    oBrw:nStretchCol  := STRETCHCOL_WIDEST
    oBrw:CreateFromCode()
    
    ACTIVATE DIALOG oDlg CENTERED
    Close All
Return
Both the samples aer working fine.

Regards
Anser
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: symbol € on xbrowse

Post by Silvio »

Anser the column I want the total is the seven not the six column
and if I modify this
WITH OBJECT oBrw:aCols[ 6]
:nEditType := EDIT_GET
:cEditPicture := '@ €99,999.99'
:lTotal:=.T.
:nTotal:=0.00
END


TO

WITH OBJECT oBrw:aCols[ 7 ]
:nEditType := EDIT_GET
:cEditPicture := '@ €99,999.99'
:lTotal:=.T.
:nTotal:=0.00
END





here NOT RUN ( I see the footer but it not make the total)
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: symbol € on xbrowse

Post by Silvio »

If I Made:

@ 1, 1 XBROWSE oRLbx SIZE 0,0 PIXEL oFld:aDialogs[5] ALIAS "RB";
COLUMNS 'RB->CodArt','RB->Articolo','RB->Misura',;
'RB->Quantita','RB->Iva','RB->Unitario','RB->Totale' ;
COLSIZES 40,140,50,30,40,80,90 ;
HEADERS i18n("Codice"),i18n("Articolo"), i18n("Unità"),;
i18n("Qt."),i18n("Iva"),i18n("Unitario"),i18n("Totale") ;
PICTURES ,,,'@ 9999',,'@ €99,999.99','@ €99,999.99' ;
CELL LINES FOOTERS NOBORDER FASTEDIT

WITH OBJECT oRLbx:aCols[ 1 ]
:cFooter:="Total"
END
WITH OBJECT oRLbx:aCols[ 4 ]
:nEditType := EDIT_GET
:lTotal:=.T.
:nTotal:=000
END
WITH OBJECT oRLbx:aCols[ 6 ]
:nEditType := EDIT_GET
:lTotal:=.T.
:nTotal:=0.00
END

WITH OBJECT oRLbx:aCols[ 7 ]
:nEditType := EDIT_GET
:lTotal:=.T.
:nTotal:=0.00
END
oRLbx:MakeTotals()
oRLbx:nStretchCol := STRETCHCOL_WIDEST
oRLbx:CreateFromCode()










then make error
Application
===========
Path and name: C:\Work\Prg2\GUT\GUT.Exe (32 bits)
Size: 3,474,944 bytes
Time from start: 0 hours 0 mins 4 secs
Error occurred at: 08-03-2011, 09:27:55
Error description: Error BASE/1004 Class: 'NIL' has no exported method: ISKINDOF
Args:
[ 1] = U
[ 2] = C TDIALOG

Stack Calls
===========
Called from: => ISKINDOF(0)
Called from: .\source\classes\XBROWSE.PRG => XBROWSENEW(11627)
Called from: source\Pripara.prg => RPEDITA(439)
Called from: source\Pripara.prg => (b)RIPARAZIONI(170)
Called from: VMenu.prg => TVMENU:EVALACTION(1700)
Called from: VMenu.prg => TVMENU:LBUTTONUP(1398)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1489)
Called from: VMenu.prg => TVMENU:HANDLEEVENT(905)
Called from: .\source\classes\WINDOW.PRG => _FWH(3408)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(992)
Called from: source\main.prg => TAPPLICATION:ACTIVATE(202)
Called from: source\main.prg => MAIN(51)
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: symbol € on xbrowse

Post by Silvio »

error here ?

if oWnd:IsKindOf( "TDIALOG" )


I use tfolferex there are problems ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: symbol € on xbrowse

Post by Silvio »

sorry I found the error

"OF"
Best Regards, Saludos

Falconi Silvio
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: symbol € on xbrowse

Post by anserkk »

Hope it is working fine now.

Regards
Anser
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: symbol € on xbrowse

Post by Silvio »

yes, I insert the first mode but the second you made when I insert it on my application here not run ( make error on maketotals)
Best Regards, Saludos

Falconi Silvio
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: symbol € on xbrowse

Post by anserkk »

Silvio wrote:yes, I insert the first mode but the second you made when I insert it on my application here not run ( make error on maketotals)
Please check whether you have missed oBrw:SetRDD() in your code.

For eg.

Code: Select all

oBrw:SetRDD()
oBrw:MakeTotals()
Regards
Anser
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: symbol € on xbrowse

Post by Silvio »

look it please
go to 2# mode

Code: Select all

#include "FiveWin.ch"
#include "Report.ch"
#include "xBrowse.ch"

REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO


  // first mode OK
/*

 Function Main()

    Local oDlg,oBrw

    RddSetDefault( "DBFCDX" )

    Crea_dbf()   //create and popolate dbf

    DEFINE DIALOG oDlg TITLE "Testing xBrowse" ;
    SIZE 600,400

       @ 82.3, 4  FOLDEREX oFld PIXEL ADJUST ;
       ITEMS "&Richiedente","Guasto &segnalato","&Guasto riscontrato","Soluzione","Parti di ricambio";
       SIZE 280,80 ANIMATE SPEED 10
       oFld:nOption:=2

    @0,0 XBROWSE oBrw SIZE 0,0 PIXEL OF oFld:aDialogs[5] ALIAS "RB";
        COLUMNS 'RB->CodArt','RB->Articolo','RB->Misura','RB->Quantita','RB->Iva','RB->Unitario','RB->Totale' ;
        COLSIZES 40,140,50,30,40,80,90 ;
        HEADERS i18n("Codice"),i18n("Articolo"), i18n("Unità"),i18n("Qt."),i18n("Iva"),i18n("Unitario"),i18n("Totale") ;
        PICTURES ,,,'@ 9999',,'@ €99,999.99','@ €99,999.99' ;
        CELL LINES FOOTERS NOBORDER FASTEDIT

    WITH OBJECT oBrw:aCols[ 1 ]
       :cFooter:="Total"
    END

     WITH OBJECT oBrw:aCols[ 4 ]
        :nEditType := EDIT_GET
        :lTotal:=.T.
        :nTotal:=000
    END



    WITH OBJECT oBrw:aCols[ 6 ]
        :nEditType := EDIT_GET
        :lTotal:=.T.
        :nTotal:=0.00
    END
    WITH OBJECT oBrw:aCols[ 7 ]
        :nEditType := EDIT_GET
        :lTotal:=.T.
        :nTotal:=0.00
    END
    oBrw:MakeTotals()
    oBrw:nStretchCol  := STRETCHCOL_WIDEST
    oBrw:CreateFromCode()

    ACTIVATE DIALOG oDlg CENTERED
    Close All
Return
    */

// Second mode K.O.

//------------------//
Function Main()

    Local oDlg,oBrw,aBrowseRb

    RddSetDefault( "DBFCDX" )

    Crea_dbf()   //create and popolate dbf

    DEFINE DIALOG oDlg TITLE "Testing xBrowse"

    @0,0 XBROWSE oBrw SIZE 0,0 PIXEL OF oDlg ; //ALIAS "RB";
         CELL LINES FOOTERS NOBORDER FASTEDIT


    aBrowseRb   := { { { || RB->CodArt }, i18n("Codice"), 40 },;
                     { { || RB->Articolo}, i18n("Articolo"),140 },;
                     { { || RB->Misura}, i18n("Unità"), 50 },;
                     { { || TRANSFORM( RB->Quantita,'@99999')}, i18n("Qt."), 30 },;
                     { { || RB->Iva}, i18n("Iva"), 30 },;
                     { { || TRANSFORM( RB->Unitario,'@€ 999,999.99')}, i18n("Unitario"), 80 },;
                     { { || TRANSFORM( RB->Totale,'@€ 999,999.99')}, i18n("Totale"), 90 } }



    FOR i := 1 TO Len(aBrowseRb)
        oCol := oBrw:AddCol()
        oCol:bEditValue := aBrowseRb[ i, 1 ] // Changed to bEditValue from bStrData
        oCol:cHeader  := aBrowseRb[ i, 2 ]
        oCol:nWidth   := aBrowseRb[ i, 3 ]
    NEXT

    WITH OBJECT oBrw:aCols[ 1 ]
       :cFooter:="Total"
    END

      WITH OBJECT oBrw:aCols[ 4 ]
        :nEditType := EDIT_GET
        :lTotal:=.T.
        :nTotal:=0.00
     END

     WITH OBJECT oBrw:aCols[ 6 ]
        :nEditType := EDIT_GET
        :lTotal:=.T.
        :nTotal:=0.00
     END

     WITH OBJECT oBrw:aCols[ 7 ]
        :nEditType := EDIT_GET
        :lTotal:=.T.
        :nTotal:=0.00
    END


    oBrw:nStretchCol  := STRETCHCOL_WIDEST
    //oBrw:MakeTotals()
    oBrw:CreateFromCode()

    ACTIVATE DIALOG oDlg CENTERED ON INIT oBrw:MakeTotals()
    Close All
Return


//----------------------------
Function Crea_dbf()

    DbCreate('RB', {{'Documento' , 'C',   10,   0}  ,;
                     {'CodArt'       , 'C',   4,   0} ,;
                     {'Articolo'     , 'C',   30,   0} ,;
                     {'Misura'       , 'C',   8,    0} ,;
                     {'Quantita'     , 'N',   4,    0} ,;
                     {'Iva'          , 'N',   5,    2} ,;
                     {'Unitario'     , 'N',   10,    2} ,;
                     {'Totale'       , 'N',  10,    2}}, 'DBFCDX')

    close all
    use &('RB') alias RB new
    select RB
    if FILE('RICAMBI.DBF')
        delete file &('RICAMBI.cdx')
        append from &('RICAMBI')
        dbcommitall()
        close all
        delete file &('RICAMBI.dbf')
    endif
    close all
    rename &('RB.dbf') to &('RICAMBI.dbf')
    close all


    use ricambi alias RB new
       For n=1 to 3
         RB->(DbAppend())
         Replace   RB->Documento   with "0010"
         Replace   RB->CodArt      with strzero(n,4)
         Replace   RB->Articolo    with str(n)
         Replace   RB->Misura      with "SC"
         Replace   RB->Quantita    with n+1
         Replace   RB->Iva         with 20
         Replace   RB->Unitario    with n
         Replace   RB->Totale      with (n*n)
        next
        Go Top

return ni
Best Regards, Saludos

Falconi Silvio
Post Reply