Have modified my code as follows :-

# -*- coding: utf-8 -*-

import datetime
import os
import dabo.ui
from FrmReportBase import FrmReportBase


class FrmReport(FrmReportBase):

 def initProperties(self):
  app = self.Application
  self.ReportName = "Membership Types Report"
  self.super()
  self.ReportForm = os.path.join(app.HomeDirectory,

"reports/membershipTypesRpt.rfxml")

 def createBizobjs(self):
  app = self.Application
  conn = app.getConnectionByName("LodgeBooks")
  membershiptypesRptBizobj = app.biz.MembershiptypesBizobj(conn)
  self.addBizobj(membershiptypesRptBizobj)

 def addControls(self):
  # add any controls for selection criteria
  self.super()

 def requery(self):
  # pass any selection criteria here
  self.DataSet = self.PrimaryBizobj.getDataSet()

I get a trace error ending with :-

     self.addBizobj(membershiptypesRptBizobj)
AttributeError: 'FrmReport' object has no attribute 'addBizobj'

I suspect that this is because FrmReportBase.py inherits from dDialog rather 
than a form type and therefore a bizObj can't be added. If so, I guess I 
will need to convert FrmReportBase to a form rather than a dialog.
Am I right?
             Rodgy
----- Original Message ----- 
From: "Ed Leafe" <[email protected]>
To: "Dabo Users list" <[email protected]>
Sent: Tuesday, December 16, 2008 1:29 AM
Subject: Re: [dabo-users] Fw: Fw: Running a Report


> On Dec 15, 2008, at 12:22 AM, Roger Lovelock wrote:
>
>> Got the concepts - having trouble implementing! Specifically I am
>> having
>> trouble finding the right way to refer to the bizObj from within the
>> code in
>> my ui :-
>
> Bizobjs are referenced within forms by their DataSource property. So
> if the DataSource of the bizobj you're interested in is 'customer',
> then you would use something like:
>
> custBiz = frm.getBizobj("customer")
>
> A special case is for the main bizobj associated with a form, called
> the PrimaryBizobj. Unless you explicitly set it, the first bizobj
> added to the form becomes the PrimaryBizobj.
>
>> def requery(self):
>> # pass any selection criteria here
>> self.DataSet = self.Application.biz.membershiptypesBizobj.getDataSet()
>
> It looks like you never created the bizobj and added it to your form.
> Typically that is done in the form's createBizobjs() method, which
> fires as part of the init process. You get the reference to the
> *class* of bizobj to create by using the 'self.Application.biz.'
> reference. So typically, you would have:
>
> def createBizobjs(self):
> app = self.Application
> conn = app.getConnectionByName("customer")
> custBiz =app.biz.CustomerBizobj(conn)
> self.addBizobj(custBiz)
>
> Since a bizobj needs a connection, you get that from the app, and then
> instantiate a bizobj using that connection, and register it with the
> form by passing it to addBizobj().
>
> After that you can reference that bizobj in the form by calling
> 'self.getBizobj("customer")'. Or, in this case, since it was the only
> one I added to the form, you could use 'self.PrimaryBizobj'.
>
> Hope that helps,
>
>
> -- Ed Leafe
>
>
>
>
>
[excessive quoting removed by server]

_______________________________________________
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/c8960ce84d0742218b386f62a0653...@roger

Reply via email to