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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formulas not printing right

Status
Not open for further replies.

boreed

Programmer
Nov 22, 2000
4
US
I'm trying to do something that's probably very easy but I can't get it to work. I don't have a lot of CR experience which is probably my problem.
Right now my VB program prints to CR a list of items that match a certain Search Criteria. If there are no matches than a "NO RECORDS FOUND" message is assigned to a CR formula field called SEARCH.
I'm trying to store the search statement in another formula. My formulas look like this:

CrystalReport1.Formula(0) = "criteria= ' & strCriteria & "'"
If NoRec Then
CrystalReport1.Formulas(1) = "search= 'No records found'"
else
CrystalReport1.Formulas(1) = "search= '' "
End If

The problem I'm having is when there are no matches the Criteria is not printing. If does print when there are matches though.

Does anyone know why this it? Is is something I'm doing wrong? If you need more info let me know.

Bob R.


 
I had a report where I wanted a message to pring "No records found" when no records printed. The problem is, if there's no data crystal doesn't even check the formula's it just prints the text boxes fixed on the screen. In order to do it I had to create a text box that said "no records found" and then go to format, click on the formula button next to "suppress". Then I typed the following

Not(Isnull(Count({Table.fieldname}))) or
Count({table.fieldname) > 0

This basically says if this table.fieldname doesn't return, then don't suppress this text box otherwise hide it. You could use this method to print the "no records found" message and use your existing formula for the "search = " line.
 
Thanks for the response.
I did manage to get this working another way. I went into "change format" and clicked off the "print on multiple lines" option. For some reason if "print on multiple lines" is true my criteria won't print if there are no records but if it's false everything prints fine. Sounds like it might be a bug with Crystal Reports. I'm using version 4.6 so there's probably a good chance it's been corrected since then.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top