This browse column centers the numbers. it does not right align them. Has anyone had success aligning right in a dcbrowse ?
DCBROWSECOL FIELD detail->price HEADER 'Price' WIDTH 120*nSpacer ALIGN XBPALIGN_RIGHT PICTURE "999,999,999.99"
The dcbrowse command is:
@ ::nRow,5 dcbrowse oDetails ALIAS "DETAIL" SIZE ::nTabwidth-30,::nTabheight-(::nRow+92) ;
PRESENTATION DC_BrowPres() ;
POINTER nDetailPointer ;
ID "ODETAILS" ;
PARENT oParent;
GOTFOCUS {|| cCodeButtonActive:="ITEM",dc_getrefresh(GetList, , , ,"REMOVECODEBUTTONS")} ;
FONT getnewfont(10) ;
COLOR bColor ;
RBDOWN BrowseMenuBlock(@oDetails,{{ "Print Sale Form" ,{|| do_forms("SALES")},{||.t. } } }) ;
NOHSCROLL ;
ITEMSELECTED {|nCol,cHeader|nCol:=oDetails:colPos+1 ,;
cHeader:=strtran(upper(oDetails:GetColumn(oDetails:colPos):headercaption),"*",""),;
IIF(lot->(dc_keycount())==0 , nil ,;
IIF(cHeader=="LOT #" .AND.subs(detail->lot,1,1)<>"z" ,(SelectLotWindow(lot->number),sleep(50),dc_Clearevents()) , ;
))}
dc_browpres() settings
aBrowPres := ;
{ { XBP_PP_COL_HA_FGCLR , GraMakeRGBColor(M->aColorNonsortableFG) }, /* Header FG Color */ ;
{ XBP_PP_COL_HA_BGCLR , GraMakeRGBColor(M->aColorNonsortableBG) }, /* Header BG Color */ ;
{ XBP_PP_COL_DA_ROWSEPARATOR , XBPCOL_SEP_DOTTED }, /* Row Sep */ ;
{ XBP_PP_COL_DA_COLSEPARATOR , XBPCOL_SEP_DOTTED }, /* Col Sep */ ;
{ XBP_PP_COL_DA_FGCLR , GraMakeRGBColor(M->aColorDataFG) }, /* Row FG Color */ ;
{ XBP_PP_COL_DA_BGCLR , GraMakeRGBColor(M->aColorDataBG) }, /* Row BG Color */ ;
{ XBP_PP_COL_HA_HEIGHT , browse_row_height_fix(22 ,10 ) }, /* Header Height */ ;
{ XBP_PP_COL_DA_ROWHEIGHT , browse_row_height_fix(22 ,16 ) }, /* Row Height */ ;
{ XBP_PP_COL_DA_CELLHEIGHT , browse_row_height_fix(22 ,16 ) }, /* Cell Height */ ;
{ XBP_PP_COL_FA_HEIGHT , browse_row_height_fix(22 ,10 ) } , /* Footer Height */ ;
{ XBP_PP_COL_DA_CELLALIGNMENT , XBPALIGN_VCENTER}, /* Alignment of text*/ ;
{ XBP_PP_HILITE_FGCLR , GraMakeRGBColor(M->aColorHiliteFG) }, /* Hilite FG color */ ;
{ XBP_PP_HILITE_BGCLR , GraMakeRGBColor(M->aColorHiliteBG) }, /* Hilite BG color */ ;
{ XBP_PP_COL_FA_FGCLR , GraMakeRGBColor(M->aColorNonsortableFG) }, /* Footer FG Color */ ;
{ XBP_PP_COL_FA_BGCLR , GraMakeRGBColor(M->aColorNonsortableBG) } /* Footer BG Color */ ;
}
DCBROWSECOL XBPALIGN_RIGHT
DCBROWSECOL XBPALIGN_RIGHT
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: DCBROWSECOL XBPALIGN_RIGHT
I also tried:
DCBROWSECOL DATA {||alltrim(trans(detail->price,"999,999,999.99"))} HEADER 'Price' WIDTH 120*nSpacer ALIGN XBPALIGN_RIGHT
but this left aligns the column right aligns the header..
DCBROWSECOL DATA {||alltrim(trans(detail->price,"999,999,999.99"))} HEADER 'Price' WIDTH 120*nSpacer ALIGN XBPALIGN_RIGHT
but this left aligns the column right aligns the header..

Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: DCBROWSECOL XBPALIGN_RIGHT
I do this, but it appears that most of the time I have this with character data or numeric data converted to character.
DCBROWSECOL DATA {|| TRANSFORM(APINVTRN->ntranamt,'99999999999.99') } ;
PARENT oV:d_oBrowse ;
HEADER 'Invoice;Amount' ;
ALIGN XBPALIGN_RIGHT+XBPALIGN_VCENTER ;
WIDTH m->G_nBrowColPixels * 10 PIXEL
Don't know if I do it directly on numeric field data. For numeric field data, I think right alignment is the normal presentation.
DCBROWSECOL DATA {|| TRANSFORM(APINVTRN->ntranamt,'99999999999.99') } ;
PARENT oV:d_oBrowse ;
HEADER 'Invoice;Amount' ;
ALIGN XBPALIGN_RIGHT+XBPALIGN_VCENTER ;
WIDTH m->G_nBrowColPixels * 10 PIXEL
Don't know if I do it directly on numeric field data. For numeric field data, I think right alignment is the normal presentation.