Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Force report to preview/print when NO DATA
Message
From
03/07/2004 19:52:55
 
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00908850
Message ID:
00920503
Views:
23
Hi Bill,

Thanks for that.

My skill with the report designer is limited and zero with its data environment.

Hearing of the capabilities of the V9 feature I've been keeping things that way until I get to learn IT (properly) < s >.

In the case that prompted the question I also had the problem that summary lines made an empty cursor look bad, so I had to not only detect no records and make a blank one but also call a different report that looked more proper with a single empty record.

But I *will* file this away as another option.

cheers

>Heya Jim -
>if indeed it is a private datasession -
>then you can absolutely fire off things in the data environment of
>the report itself .
>
>there are methods that you can write code in -
>my favorite so far has been the BeforeOpenTables method.
>this one is a bit weird and convoluted - cause I have just gen'ed the cursor/table moments before to fill the report .
>BUT ? its the first method that fires in a report .
>so ?
>
>if i can pass in the name of a table or a cursor -
>and then show there is no data in it .
>
>then all is good based on your scenario [auditing is a PITA, btw] -
>but -
>remember -
>if there is no data - you still need to fill a different cursor with the same name with things that THEN become meaningful in A VISUAL WAY to the report viewer type person/human.
>
>Start with the where clause -> 1=2 [this will make an empty cursor]
>
>and include the READWRITE clause
>and the NOFILTER clause .
>this will make a cursor that is completely detached from the rest of your tables and will also render it 'record insertable' [which is important in a moment] BUT it matches the report table struct exactly with the same table/cursor NAME [which allows you to not pull hairs out of various body parts] .
>
>SO -
>if in the BeforeOpenTables event your primary cursor/table [which you gen'd prior to the running of the report] is EMPTY = ie = RECCOUNT() < 1
>
>then
>you can make yet another cursor/table in the BeforeOpenTables Event in the DE of the report form that will
>1. make yet another cursor/table of the same NAME
>2. make 'it' READWRITE with NOFILTER
>3. have ONE record in it that contains visual 'thingies' the reader understands.. to wit.
>
>*dis is meta
>insert blank
>for i = 1 to fieldcount()
>  do case
>    case type(fieldnum(i)) == 'C'
>     lcVal = 'No Data'
>
>    case type(fieldnum(i) == 'T'
>     lcval = {/:} && show a datetime as BLANK and not null
>
>    case ... other data types you want to SHOW VISUALLY TO THE USER.
>
>   endcase
>   replace fieldnum(i) with lcVal
> endfor
>
>
>there are assumptions though that this is a one pass report - ie - you don't have report variables - if you do have report variables - its a horse with different appendages ..
>
>lemme know your thoughts ?
>oh - and -
>
>it doesn't have to be coded in the DE in the Before..... event -
>you can do it prior based on RECCOUNT() of the table/cursor .
>hth - mondo regards [Bill]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform