On Thu, Sep 9, 2010 at 13:13, Paul McNett <[email protected]> wrote:
> Yes. Tell me specifically what variables you are wanting to set and I'll tell 
> you the
> best way.
>
> Report expressions can access the application object like:
>
> <expr>self.Application.<myfunc>()</expr>
>
> If you instantiate the report writer at runtime and assign an attribute, like:
>
> def test(arg1):
>   return "Hi, %s" % arg1
>
> rw = dabo.dReportWriter()
> rw.myMeth = test
>
> You can then refer to that in an expression like:
>
> <expr>"Value of dynamic function: '%s'" % 
> self.myMeth(self.RecordNumber)</expr>
>
> If you want subtotals of line items, you should definitely use Report 
> Variables,
> which is what they are designed for.

Specifically what I am looking for is a way to easily set certain
values for items based on preferences.  So, let's take your invoice
for example.  Say that my program allows you to define you logo,
company name, address, and contact info as preferences stored in
either the preference manager or the database.  I want to be able to
use them in the report.

I see that in this case it would be easiest to define the preferences
in the preference manager and use the app object reference in the
string expressions to pull those in that way.

The other example where this might be useful is with the order itself.
 The case where you have a single row (order) parent joined with
children in a de-normalized set can largely go away if you define the
single row parent (order) as attributes in a dictionary referenced by
the application object.  It saves you from having to de-normalize the
sets and an is largely quicker.

The problem I foresee in this approach is not being able to properly
preview the report... What do you think about adding in a
TestVariables section to allow you to define static values for
variables?

Also, how would you programatically run a report and is this a report
list/run dialog already built into dabo?

Regards,

Nate
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to