Rich Shepard wrote:
> Since I don't know how to access what I need using the GUI ReportDesigner,
> I decided to try to figure out the rfxml file itself. After looking through
> the wiki and other site pages, I still am stumbling around.
>
> Toward writing the report formats I need, I'll try to ask specific
> questions. First one involves this code from the demo's invoice.rfxml (which
> is what I'll use as a template for understanding):
>
> <variables>
> <Variable>
> <expr>self.clientBalance +
> self.Record["amount"]</expr>
> <initialValue>decimal.Decimal('0.00')</initialValue>
> <name>clientBalance</name>
> <resetAt>self.Record['clientid']</resetAt>
> </Variable>
> <Variable>
> <expr>self.Variables['timeCodeBalance'] +
> self.Record['amount']</expr>
> <initialValue>decimal.Decimal('0.00')</initialValue>
> <name>timeCodeBalance</name>
> <resetAt>"%s-%s" % (self.Record['clientid'],
> self.Record['timecodeid'])</resetAt>
> </Variable>
>
> Are 'self.clientBalance,' and 'timeCodeBalance' methods/functions in the
> application, while 'self.Record[]' is the Dict_cursor supplying the specific
> data?
The rfxml is confusing in the case that you posted, because there are
multiple ways to access report variables, and each of the examples use
different ways. Generally speaking, a report variable is just another
field you have access to while running the report. The expr specifies
the value of the variable for this record (variables get evaluated in
each iteration of the cursor). So, the two examples above show
accumulator variables: we are totaling the amounts to show in the time
code group footer and the client group footer.
The explicit way to refer to things are, e.g.:
self.Record["amount"] : refers to the amount field in the current record.
self.Variables["timeCodeBalance"] : refers to the current value of the
variable
However, there are shortcuts:
self.amount and self.timeCodeBalance will refer to the field and the
variable, respectively.
So, no: the variables are not methods/functions in the application, they
are variables that are set up in the rfxml to be accessed by report
fields in, say, the detail band.
And self.Record refers to the current dict based on what row number we
are on in the cursor.
> As I look at invoice.rfxml, I get the impression that the Variables group
> represents the details printed for each record in the database/Dict_cursor.
> Is that correct?
Variables are user defined.
--
pkm ~ http://paulmcnett.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users