Dick,

I've copied my basic EEP for you below. I think that it is easy enough to
follow but please note that it is still unfinished so there may be things
that aren't needed or I haven't yet put in!

Simply, what it does is count the number of rows in a temp table and adjust
the number of rows in the region(s) accordingly. It also displays and/or
adjusts the DB Navigators according to the number of rows. There is no need
to use a temp table - I only did so because of another requirement. If you
need any further explanation please just ask.

To move between rows in the first table follow Razzak's explanation.

Regards,
Alastair.


*( FileName: OtherItem.EEP   ...    ...   Date of last amendment:
12/03/2005 )
*( Determines if rows exist in Other Items
     )
-- This line extends to 78
characters - - - - - - - - - - - - - - - - - - - ->

SWITCH .%1
-- -------------------------------------------------------------------------
--
-- Items display (from: Artist_Info / All):
-- -------------------------------------------------------------------------
--
  CASE 'Artist'
    SET VAR vTZV_Count = (COUNT(DiscIDNum)) FROM Track_Zero_View +
      WHERE Artist = .vMainArtist
    SET VAR vItemCount = ( (CTXT(.vTZV_Count)) & 'Items')

    DELETE ROWS FROM TmpTracksOnly
    INSERT INTO TmpTracksOnly +
      (DiscIdNum, TrackNumber, ItemTrackTitle, TrackTime, TrackArtistName) +
      SELECT DiscIdNum, TrackNumber, TrackTitle, TrackTime, TrackArtistName
+
      FROM Tracks_View +
      WHERE DiscIdNum IN (SELECT DiscIdNum FROM Track_Zero_View +
        WHERE Artist = .vMainArtist) AND  TrackNumber <> 0
    SET VAR vTOV_Count = (COUNT(DiscIdNum)) FROM TmpTracksOnly +
      WHERE DiscIdNum = .vItemDiscIDNum

    PROPERTY IDNav_TrackZeroView VISIBLE 'FALSE'
    PROPERTY IDVC_TrackZeroView  VISIBLE 'FALSE'
    IF vTZV_Count > 9 THEN
      SET VAR vTZV_Count = 9  -- Max display is 9 rows
      PROPERTY IDVC_TrackZeroView VISIBLE 'TRUE'
    ENDIF

    PROPERTY IDSR_TrackZeroView ROWCOUNT .vTZV_Count
    IF vTZV_Count > 1 THEN
      PROPERTY IDNav_TrackZeroView VISIBLE 'TRUE'
      IF vTZV_Count = 2 THEN
        PROPERTY IDNav_TrackZeroView TOP 115
        PROPERTY IDNav_TrackZeroView VISIBLEBUTTONS 'First, Last'
        PROPERTY IDNav_TrackZeroView WIDTH 200
          ELSE
        SET VAR vCalcTZV_Count = (55 + (.vTZV_Count * 30) )
        PROPERTY IDNav_TrackZeroView TOP .vCalcTZV_Count
        PROPERTY IDNav_TrackZeroView VISIBLEBUTTONS 'First, Prior, Next,
Last'
        PROPERTY IDNav_TrackZeroView WIDTH 400
      ENDIF
    ENDIF
    PROPERTY TABLE Track_Zero_View 'FIRST'
    PROPERTY IDNav_TrackZeroView SET_FOCUS 'TRUE'

    SET VAR vTOV_Count = (COUNT(DiscIdNum)) FROM TmpTracksOnly +
      WHERE DiscIdNum = .vItemDiscIDNum
    SET VAR vTracksCount = ( (CTXT(.vTOV_Count)) & 'Tracks')

    SKIP TO vArtistsName
    BREAK

-- -------------------------------------------------------------------------
--
-- Tracks display (from: Track_Zero_View):
-- -------------------------------------------------------------------------
--
  CASE 'Items'
    SET VAR vTOV_Count = (COUNT(DiscIdNum)) FROM TmpTracksOnly +
      WHERE DiscIdNum = .vItemDiscIDNum
    SET VAR vTracksCount = ( (CTXT(.vTOV_Count)) & 'Tracks')

    PROPERTY IDNav_TracksOnlyView VISIBLE 'FALSE'
    PROPERTY IDVC_TracksOnlyView  VISIBLE 'FALSE'
    IF vTOV_Count > 10 THEN
      SET VAR vTOV_Count = 10  -- Max display is 10 rows
      PROPERTY IDVC_TracksOnlyView VISIBLE 'TRUE'
    ENDIF

    PROPERTY IDSR_TracksOnlyView ROWCOUNT .vTOV_Count
    IF vTOV_Count > 1 THEN
      PROPERTY IDNav_TracksOnlyView VISIBLE 'TRUE'
      IF vTOV_Count = 2 THEN
        PROPERTY IDNav_TracksOnlyView TOP 85
        PROPERTY IDNav_TracksOnlyView VISIBLEBUTTONS 'First, Last'
        PROPERTY IDNav_TracksOnlyView WIDTH 200
          ELSE
        SET VAR vCalcTOV_Count = (25 + (.vTOV_Count * 30) )
        PROPERTY IDNav_TracksOnlyView TOP .vCalcTOV_Count
        PROPERTY IDNav_TracksOnlyView VISIBLEBUTTONS 'First, Prior, Next,
Last'
        PROPERTY IDNav_TracksOnlyView WIDTH 400
      ENDIF
    ENDIF
    BREAK

-- -------------------------------------------------------------------------
--
-- Other Items display (from: Tracks_Only_View):
-- -------------------------------------------------------------------------
--
  CASE 'Others'
    DELETE ROWS FROM TmpTrackOtherItems
    INSERT INTO TmpTrackOtherItems +
      (OtherTrackTitle, OtherArtist, OtherDiscIdNum, OtherItemTitle) +
      SELECT OtherTrackTitle, OtherArtist, OtherDiscIdNum, OtherItemTitle +
      FROM TracksOnOtherItems +
      WHERE OtherTrackTitle = .vTrackTitle AND OtherDiscIdNum <>
.vExcludeDiscID
    SET VAR vTOI_Count = (COUNT(OtherDiscIdNum)) FROM TmpTrackOtherItems
    SET VAR vOtherItemsCount = ( (CTXT(.vTOI_Count)) & 'Other Titles')

    PROPERTY TABLE TmpTrackOtherItems 'REFRESH'

    PROPERTY IDV_OnOtherItems   VISIBLE 'FALSE'
    PROPERTY IDSR_OnOtherItems  VISIBLE 'FALSE'
    PROPERTY IDNav_OnOtherItems VISIBLE 'FALSE'
    PROPERTY IDVC_OnOtherItems  VISIBLE 'FALSE'

    PROPERTY RBASE_FORM HEIGHT '380'

    IF vTOI_Count > 10 THEN
      SET VAR vTOI_Count = 10   -- Max display is 10 rows
      PROPERTY IDVC_OnOtherItems VISIBLE 'TRUE'
    ENDIF

    IF vTOI_Count > 0 THEN
      PROPERTY IDV_OnOtherItems  VISIBLE  'TRUE'
      PROPERTY IDSR_OnOtherItems VISIBLE  'TRUE'
      PROPERTY IDSR_OnOtherItems ROWCOUNT .vTOI_Count

      PROPERTY RBASE_FORM HEIGHT '745'

      IF vTOI_Count > 1 THEN
        PROPERTY IDNav_OnOtherItems VISIBLE 'TRUE'
        IF vTOI_Count = 2 THEN
          PROPERTY IDNav_OnOtherItems TOP 450
          PROPERTY IDNav_OnOtherItems VISIBLEBUTTONS 'First, Last'
          PROPERTY IDNav_OnOtherItems WIDTH 200
            ELSE
          SET VAR vCalcTOI_Count = (390 + (.vTOI_Count * 30) )
          PROPERTY IDNav_OnOtherItems TOP .vCalcTOI_Count
          PROPERTY IDNav_OnOtherItems VISIBLEBUTTONS 'First, Prior, Next,
Last'
          PROPERTY IDNav_OnOtherItems WIDTH 400
        ENDIF
      ENDIF
    ENDIF
    BREAK
ENDSW

-- -------------------------------------------------------------------------
--
-- Return to form:
-- -------------------------------------------------------------------------
--
RECALC VARIABLES
RECALC TABLES
RETURN
*( End of program )




----- Original Message ----- 
From: "Dick Fey" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[email protected]>
Sent: Saturday, March 12, 2005 2:08 PM
Subject: [RBG7-L] - Re: Firing an EEP on a multi-table form


> On 3 11 Alastair Burr wrote:
>
>
> David & Razzak,
>
>  Many thanks for the help with this. I now have the resizing working with
> the
>  property commands defined on buttons rather than using a DBNavigator
>  control.
>
>  I had been trying to set the focus and/or move to the first rows for the
>  regions in my EEP which wasn't firing and assuming that because the
>  DBNavigator was linked to the table that it _effectively_ set that table
as
>  the currently active one.
>
>  I can now press on with adding in adjusting the height of the form to
match
>  the size of the displayed regions.
>
>
> Alastair:
>
> I have watched this thread with interest, and cannot figure out how you
are
> resizing the grids for the lower tables based on the number of rows in the
> table.
> How do you do that?
>
> Dick Fey
>

Reply via email to