Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a field in the header of the report
Message
 
 
À
27/02/2015 13:03:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01615930
Message ID:
01615937
Vues:
62
>>Hi everybody,
>>
>>My colleague just sent me this question (I'll quote below) and I am not sure how to do this for the header of the report. I do see a way to use report variable and a footer, but not into the header. Any ideas?
>>
>>---------------------------------------------
>>What the client wants is a field that prints Yes or No based on the presence of at least one of two specific DCIs in a sale. The original expression was just iif(item = ‘xxx’ or item = ‘xxx’, “Yes, “No”). That is fine when it is in the detail band, but they want it to only appear once so they put it in the page header. In that case it only looks at the first record in the csrTrans.
>>
>>It seems like it should be simple to count how many records there are with a certain value in the column. Am I missing something simple here?
>>----------------------------------------------------------------------------
>>
>>So, how would I count the specific items and put the info in the header?
>>
>
>First thought is to compute what you need before running the report, and set a relation to the driving table.
>
>Tamar

I can not do this as all cursors are created with a separate program which I can not change. However, I think I concocted the following idea:

Add a new report variable with this expression:
NVL(_VFP.DoCmd([select COUNT(*) as cnt from csrTest where item = 'Item1' into array laArr]), laArr[1]))
In my quick test in the command window it worked. I hope it will work in VFP report as well.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform