Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WHERE CLAUSE does not work in in SUBReport 1

Status
Not open for further replies.

vlad2

Programmer
Jan 9, 2002
56
0
0
US
I have an 'Estimate.rpt' as main report, and also i have a subreport 'Note.rpt'

I want to exlude deleted notes from the report. I put in subreport whereclase:
------------------------------------------------------------
WHERE Note.DeletedBy is NULL or Note.DeletedBy = ''
------------------------------------------------------------
it works on my PC (i have installed develop. version of cr) But it does not work on client machine.

What's wrong?
Thanks in advance.

 
try this instead in the record selection formula of the subreport: (I assume you want to test if Note.DeletedBy just has blank spaces and isn't null)

isnull({Note.DeletedBy}) or
length(trim({Note.DeletedBy})) = 0

Jim Broadbent
 
Or simplify the heck for blank:

trim({Note.DeletedBy}) = ""

<grinnin at Ngolem>

If you're using the same data source, then I'm somewhat perplexed.

Also, I'd think that your logic is reversed:
WHERE Note.DeletedBy is NULL or Note.DeletedBy = ''

Shouldn't there be a value if it's deleted?
WHERE not(Note.DeletedBy is NULL or Note.DeletedBy = '')

<shrug> Just a wild guess...

Anyway, differences across computers result from various causes, such as different versions of Crystal, different data source, different settings for Crystal (providing they have their own version), Crystal's mood ;), etc.

Try running just the SQL from each machine to assure that you're looking at the same data, that's the simplest one to test for.

-k kai@informeddatadecisions.com
 
Thanks for help.
I added another check in 'FormatSection' to supress the section if: length(trim({Note.DeletedBy}))> 0

But i guess here is another problem:
I use the subreport in 4 ohter reports.And i set 'Reimport when opening' to true.I thought that main reports will use the NEW subreport in run time, but it did not work.Then i reimported the subreport mannualy to every main report ,using the reimport subreport feature, and it works just fine.

the ? is: Why 'Reimport when opening' did not work.

thanks.
 
This is another issue...but I am not familar with a &quot;ReImport&quot; feature. Subreports are launched from a main report as they are encountered....What is re-import supposed to do?? refresh the subreport?? seems redundant to me. Jim Broadbent
 
&quot;Reimport&quot; is supposed to do just what vlad2 wants to do - update one or more main reports when an external .rpt file that has been imported as a subreport is altered or updated.
My experience with this feature has not been good, especially with &quot;Reimport when opening&quot; which should automate the process. Either the report did not re-import the changes when expected, or the subreport was re-imported but lost its links to the main report and displayed no data.
I gave up on &quot;Reimport&quot;. When I need to do something like this, I delete the subreport and re-import it manually, resetting its links as I do. If the subreport is used only in one main report, don't maintain a separate .rpt file at all.
 
I see ...this is not an on-the-fly-kinda thing. No I prefer starting from scratch...saves time in the long run Jim Broadbent
 
Yes, the main problem with this feature is that it won't preserve the links you have created unless they are the default links that CR likes to add to new subreports. Since I always prefer to create my own link parameters, I never use this feature. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top