Subreport question

Timtropolis

Registered User.
Local time
Today, 16:48
Joined
Jun 17, 2004
Messages
84
Greetings,

I am running a report that has a subreport embedded. What I am trying to do is the following. If the subreport has data, then I show the datarow associated with the main report data. If not, I want to show a text box that says "no data for this record". My problem is that I'm having a hard time trying to figure out how to accomplish this.

The subreport always has some data in it so I can't use the No Data event. I've tried doing a match on various fields with no success (I don't want to get into doing a recordset behind the scenes) and I've also attempted to use the "visible" property since when I have no data associated, the subrept does not show. I met with partial success with this last item but due to the way the print event works, I always wound up with one scenario over the other.

Anyone have any ideas ?

TIA,
Tim
 
Hi Tim,

You seem to contradict yourself here...

If the subreport has data, then I show the datarow associated with the main report data. If not, I want to show a text box that says "no data for this record".

but then

The subreport always has some data in it so I can't use the No Data event.

I am presuming you have groupings in your report, and the subreport as a whole always has data, but not for each particular group? Without knowing the structure of the report its impossible to tell you how to fix it, but have you thought about the "Can Shrink" property, or getting your query to insert the text "No data for this record" somewhere so that prints out rather than your records?
 
I was able to fix the problem using the HasData property, thank you for responding tho and lending a hand
 

Users who are viewing this thread

Back
Top Bottom