Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Force report to preview/print when NO DATA
Message
De
03/07/2004 22:40:14
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00908850
Message ID:
00920516
Vues:
15
Once again, THANKS Lisa!!!

You certainly are one very thorough person.

I've put this aside to implement as soon as I have VFP9 in production, and I will surely play with it with the beta.

cheers

>Sorry I missed the requirement to omit the appearance of the report when it's empty when I wrote before...
>
>You *could* do it with a separate report, sure, but you could also do it as below (revised from the example I posted earlier). I'm going to include a couple of different possibilities here and some comments.
>
>I'll just show you how to eliminate the group band objects, same would work for summary of course...
>
>>L<
>
>
>CREATE CURSOR x (onefield l)
>
>* We can't CREATE report simplenodata from x
>* It has to have a group,
>* so you already have it.
>* It should have remove line if blank turned on, etc
>
>SELECT x
>
>REPORT FORM (simplenodata) OBJECT ;
> (NEWOBJECT("reportListenerEvenIfNoData")) ;
> PREVIEW
>
>DEFINE CLASS reportListenerEvenIfNoData ;
>   AS ReportListener
>
>  drivingAlias = ""
>  tempAlias = ""
>  isInGroupBand = .F.
>  isEmptyReport = .F.
>
>  PROCEDURE LoadReport()
>     IF THIS.CommandClauses.Preview
>        THIS.ListenerType = 1
>     ELSE
>        * you decide what you want for
>        * various clauses...
>        * you could also do this by
>        * creating the object reference before
>        * the REPORT FORM command of course
>     ENDIF
>     THIS.drivingAlias = ALIAS()
>     IF RECCOUNT() = 0
>        WAIT WINDOW ;
>        "Report proxy cursor..."  NOWAIT
>        THIS.tempAlias = "A" + SYS(2015)
>        SELECT * FROM (THIS.drivingAlias) ;
>          INTO CURSOR (THIS.tempAlias) READWRITE
>        SELECT (THIS.tempAlias)
>        APPEND BLANK
>        THIS.isEmptyReport = .T.
>     ELSE
>        THIS.isEmptyReport = .F.
>     ENDIF
>  ENDPROC
>
>  PROCEDURE UnloadReport()
>     IF NOT ALIAS() == THIS.drivingAlias
>        SELECT (THIS.drivingAlias)
>        USE IN (THIS.tempAlias)
>     ENDIF
>  ENDPROC
>
>  PROCEDURE BeforeBand(nBandObjCode, nFRXRecNo)
>    #define FRX_OBJCOD_GROUPHEADER              3
>    #define FRX_OBJCOD_GROUPFOOTER              5
>    THIS.IsInGroupBand = THIS.IsEmptyReport AND ;
>       INLIST(nBandObjCode,;
>              FRX_OBJCOD_GROUPHEADER,;
>              FRX_OBJCOD_GROUPFOOTER)
>    DODEFAULT(nBandObjCode,nFrxRecNo)
>  ENDPROC
>
>  PROCEDURE AfterBand(nBandObjCode, nFRXRecNo)
>     THIS.isInGroupBand = .F.
>     DODEFAULT(nBandObjCode,nFrxRecNo)
>  ENDPROC
>
>  PROCEDURE EvaluateContents(nFRXRecno,oProps)
>     IF THIS.isInGroupBand
>        oProps.Text = ""
>        oProps.Reload = .T.
>     ENDIF
>  ENDPROC
>
>  * do something similar to the above for shapes
>  * with AdjustObjectSize() if you use shapes
>  * in the group bands... have not tested,
>  * but it should should work
>
>  PROCEDURE Render(;
>           nFRXRecno, nLeft, nTop, nWidth, ;
>           nHeight, nObjectContinuationType, ;
>           cContentsToBeRendered, ;
>           GDIPlusImage)
>      * You probably don't need to do this
>      * if you're also doing the
>      * EvaluateContents stuff,
>      * but you *can* do it this way --
>      * and it's a heck of a lot easier than a
>      * set of Print Whens.
>      * It will cover *all* object types
>      * (shapes, images, etc).
>      * However it will not close up space,
>      * you would need
>      * to do that with EvaluateContents
>      * and AdjustObjectSize,
>      * which occur earlier.
>     IF THIS.isInGroupBand
>        NODEFAULT
>     ELSE
>        DODEFAULT(nFRXRecno, ;
>          nLeft, nTop, nWidth, nHeight, ;
>          nObjectContinuationType, ;
>          cContentsToBeRendered, ;
>          GDIPlusImage )
>     ENDIF
>  ENDPROC
>
>ENDDEFINE
>
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform