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 :-

# -*- 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")
  #self.DataSetFunction = app.db.getDataSet


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


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

Have tried all sorts of variations to set self.DataSet equal to 
bizobj.getDataSet() - I'm sure it will be obvious once I am shown!
               Thanks
                      Rodgy
----- Original Message ----- 
From: "Ed Leafe" <[email protected]>
To: "Dabo Users list" <[email protected]>
Sent: Monday, December 15, 2008 9:14 AM
Subject: Re: [dabo-users] Fw: Fw: Running a Report


> On Dec 14, 2008, at 3:45 PM, Roger Lovelock wrote:
>
>> OK - I've thought about this. Please correct my logic if I am wrong!
>>
>>    - my new bizObj code is in biz - it is basically a clone of my
>> existing
>> bizObj (but without the validation code etc) but is created
>> seperately as
>> the data for the report may be selective while my main bizObj is all
>> inclusive.
>
> There's no need to create a separate bizobj for each possible query.
> I don't quite understand what you mean by 'selective' and 'all
> inclusive'; I hope you're not doing the equivalent of 'select * from
> mytable' and bringing the entire database table across the wire.
>
> If you are familiar with SQL queries, you should know that our
> datasets understand SQL. IOW, you can do:
>
> ds = bizobj.getDataSet()
> justSmith = ds.execute("select * from dataset where lastname='Smith' ")
>
> This will result in 'justSmith' being a dataset of just those records
> in the full dataset whose lastname equals 'Smith'. See 
> http://dabodev.com/wiki/DataSet
>  for more information on this.
>
>>     - I can create the instance of this bizObj only after the
>> selection
>> criteria has been entered ie in the FrmReport routine in ui. Since
>> this is a
>> dDialog object self is referring to this dialog and I can do a
>> self.refresh
>> to get my cursor.
>
> refresh() just repaints the UI. I think you want requery().
>
>>     - The getDataset routine in db can then read  the cursor from the
>> bizObj on the FrmReport dialog (maybe I should just get the dataset
>> within
>> the FrmReport object and don't worry about having a seperate routine
>> in db?)
>
> You should never have to code to the db layer. Work in the bizobj; it
> 'knows' how and when to interact with the cursor objects. So just rely
> on bizobj.getDataSet().
>
>> Thats the design stage - hopefully I have both concepts and
>> philosophy right
>> here and I can go on to the coding/implementation now.
>
>
> You're getting closer all the time.
>
>
> -- 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/1218f9e5de0f436e97f41a78bf716...@roger

Reply via email to