🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.vdbase.data.sql
Article #1091

Re: VDB7 - DMD Question

#1091
From: Ken Chan
Date: Wed, 29 Apr 1998 00:00
87 lines
3219 bytes
Patricia Dilmore wrote:
> Maybe the problem lies with the report designer rather than the dmd.

Whenever you're using a DMD with groups, make sure that the report's 
autoSort property is false. Otherwise, you may very well get just one 
detail row per group.

As mentioned in the TFM, a rowset's canGetRow fires before the master-
detail link, so you can't rely on the masterRowset link to check the 
detail rows for that parent row. You must apply the constraint yourself:

** END HEADER -- do not remove this line
//
// Generated on 04/29/98
//
class claimprocsDataModule of DATAMODULE

   this.CLAIMS1 = new QUERY()
   this.CLAIMS1.parent = this
   with (this.CLAIMS1)
      left = 3
      top = 14
      sql = 'select * from "CLAIMS.dbf"'
      active = true
   endwith


   with (this.CLAIMS1.rowset)
      canGetRow = class::CLAIMS1_CANGETROW

   endwith

   this.PROCS1 = new QUERY()
   this.PROCS1.parent = this
   with (this.PROCS1)
      left = 11
      top = 14
      sql = 'select * from "PROCS.dbf"'
      active = true
   endwith


   with (this.PROCS1.rowset)

      filter = "TOS = 'X'"
      indexName = "CLAIMNO"
      masterRowset = parent.parent.claims1.rowset
      masterFields = "CLAIMNO"
   endwith



   this.rowset = this.claims1.rowset

   function claims1_canGetRow
      local lRet, procs
      try
        procs = this.parent.parent.procs1.rowset
        if procs.setRange( this.fields[ "CLAIMNO" ].value )
          lRet = not procs.endOfSet
        else
          lRet = false
        endif
      catch ( Exception e )
        lRet = true
      endtry
      return lRet

endclass


You need the TRY block because the canGetRow will fire when you first 
assign it, and at that point, there is no PROC rowset at that point. The 
CATCH should just return true to get that out of the way; otherwise, it 
will keep trying until it finds a row.

The test uses setRange(), which is the same mechanism that the 
masterRowset will use, so it's slightly redundant, but there's not much 
you can do about it (you might try coding a test to see if the parent row 
has changed key values, but it may not be worth the trouble). It checks 
if there are any matches for the index, and if there are, whether there 
are any matches for the filter you have.

-- 
//Ken@Inprise
<Please follow-up to newsgroup; do not reply to email>
Technical Details
Message-ID: <MPG.fb155b42908ef2798990a@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <353D1963.4C0D@Bellsouth.net> <6hivn8$mc49@forums.borland.com> <353D5D1A.3682@Bellsouth.net> <6hl6j9$okg7@forums.borland.com> <353E7483.513D@Bellsouth.net> <6hnq54$r4g9@forums.borland.com> <353FDCA1.6480@Bellsouth.net> <6hqfn8$lk5@forums.borland.com> <35416057.4FCA@Bellsouth.net> <6i01de$55210@forums.borland.com> <3544073C.742B@Bellsouth.net> <6i2qso$8jr11@forums.borland.com> <35458149.4F0D@Bellsouth.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff5a1,438323d64b0ab196
X-Google-Attributes: gidff5a1,public
From: supportinfo@borland.com (Ken Chan)
Subject: Re: VDB7 - DMD Question
Date: 1998/04/29
Message-ID: <MPG.fb155b42908ef2798990a@forums.borland.com>
X-Deja-AN: 348939455
References: <353D1963.4C0D@Bellsouth.net> <6hivn8$mc49@forums.borland.com> <353D5D1A.3682@Bellsouth.net> <6hl6j9$okg7@forums.borland.com> <353E7483.513D@Bellsouth.net> <6hnq54$r4g9@forums.borland.com> <353FDCA1.6480@Bellsouth.net> <6hqfn8$lk5@forums.borland.com> <35416057.4FCA@Bellsouth.net> <6i01de$55210@forums.borland.com> <3544073C.742B@Bellsouth.net> <6i2qso$8jr11@forums.borland.com> <35458149.4F0D@Bellsouth.net>
Organization: Borland
Newsgroups: borland.public.vdbase.data.sql