Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Personalization for report company header
Message
 
 
À
16/05/2001 21:54:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00508174
Message ID:
00508184
Vues:
23
>Hi,
> Did anyone did the personalization for the report header?
> I wish to allow user to personalize their report header that is which i don't need everytime to recode the company header when i customize application to different customer.
> Did anyone have sample ?
> thanks
>
>kengwen

Do you use application object in your application? If yes, just add a property to hold the company name and use it in your reports.

For instance, we have a main public application object called oJC. In my reports I can do:
iif(vartype(oJC)="O",GetDescription(oJC.CustomerID,"Customer","CustomerID","CustomerName"),"Test Customer")
Where GetDescription is a common UDF I designed for returning field value from a table.

Here is the GetDescription function just in case:
*!***********************************************************************
function GetDescription
*  Description.......: Function returns description
*  Calling Samples...: GetDescription(town,"TOWNS","code",'FullName')
*  Parameter List....: tcCode, tcTable, tcIndex, tcFldName, tReturnValue, tcRetType
*  Created by........: Nadya Nosonovsky 11/3/99
*  Modifyed by.......: Nadya Nosonovsky 12/20/2000 01:42:50 PM
***************************************************************************
lparameters tcCode, tcTable, tcIndex, tcFldName, tReturnValue, tcRetType && Last two parameters are optional
local lDescript, llUsed, lnParmCount, lcExpression, lcRetType
lnParmCount=pcount()
llUsed=.t.
if m.lnParmCount=5 && Exists optional parameter
     lDescript=m.tReturnValue
endif
if !used(m.tcTable)
   llUsed=.f.
   =OpenTble(m.tcTable, m.tcTable, 'shared noupdate') 
endif   
lcExpression=m.tcTable+'.'+strtran(m.tcFldName,'+','+'+m.tcTable+'.') && For multiple fields
if !empty(m.tcRetType) and vartype(m.tcRetType)='C'
    lcRetType=m.tcRetType
else
    lcRetType=type(m.lcExpression)
endif        
do case
    case inlist(m.lcRetType,"C","M") && Character or Memo
     lDescript=""
   case inlist(m.lcRetType,"N","I","B") && Numeric, Integer, Double
     lDescript=0
    case inlist(m.lcRetType,"D","T") && Date, DateTime
     lDescript={}
case lcRetType='L' && Logical
     lDescript=.f.
otherwise
     =messagebox('Invalid Field Name passed!',48,'GetDescription Function Failed')     
     return ''
endcase

if !empty(m.tcCode) and !isnull(m.tcCode) and seek(m.tcCode,m.tcTable,m.tcIndex)
     lDescript=evaluate(m.lcExpression)
else
   if !empty(m.tReturnValue)
       lDescript=m.tReturnValue
   endif
endif
if !m.llUsed
   use in select(m.tcTable)
endif   
return m.lDescript
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform