Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing report variable by reference to a function
Message
De
28/11/2008 17:01:38
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01364082
Message ID:
01364573
Vues:
15
>>
>>Reports are scoped to have access to any variables that the calling program or form or class had at the time the report was run. For example .. if you have a PRG with this code:
>>
>>LOCAl lnValue
>>lnValue = 10
>>REPORT FORM MyReport TO PRINTER PROMPT PREVIEW
>>
>>You could put lnValue as the expression in a field on the report it will print the number 10.
>>
>>That said ... please explain a little bit more of what you are trying to accomplish. There might be a better way to do it.
>
>What I was trying to do is what Dragan calls "intelligent" report. Here is a brief description.
>
>I have a report in my vertical market application. The report cursor is created in a form, once user enters his/her criteria for the report. The base for the report is a cursor created from a table (kind of simplified as in example of P.O. Header).
>
>Then comes one customer who wants to include in the report records from the table related to the report base table (e.g. P.O. Header -> P.O. Lines). So instead of changing the base SQL select for the report cursor (to include line items and then group) I wanted the report to "get" related data on-the-fly. So that for every line in the report there would be a call to a function that would get the record(s) from the related table. I have actually done it already in one other report and it works. But there I was retrieving just one field from the related table. Now I need to retrieve more than one field. This is where the idea of calling a function and storing some values in report variables came to mind.
>
>I really don't want to (and don't have time) to change the report SQL Select engine. So I either will have to come up with a way to create an intelligent report or tell the customer to wait when I have more time.

Hi Dmitri
It might take you more time to battle with FRX/UDFs etc , then to actually fix code for preprocessing of report cursors.
What you described does not necessarily have to be dynamically created report, it can be simply two simillar FRX layouts
that each cover one user choice (layout request)

What I usually do when I need something like this, is extract all cursors I might need to cover all desired FRX layouts
and then (based on user choice) call specific frx which provides shape of data user want to see/print.

So instead of having one hyper complex 'UDF pierced' FRX report, you get to build two 'no brainers' and just
a bit smarter data extraction process. It could be tad slower data extraction (to cover both cases), but you were planning
to do that in UDF's anyway. (and that might end up being even slower)

* * *

Not for this occasion since you are time squised,
but for some future reference;

If you want really dynamic report creation, where you can do anything you want 'on the fly'
you might want to have look at www.Report-Sculptor.com , for OOP reporting via standard FoxPro Form.

I blogged about this new technique here;
http://weblogs.foxite.com/reportsculptor/archive/2008/10/22/7142.aspx

See sample of fully blown OOP report here;
http://www.report-sculptor.com/community/gallerymenu#GroupingOnMultipleInnerBands

HTH
Sergio
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform