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

HasValue causing errors with 3rd party viewers in CR2008

Status
Not open for further replies.

pandpp

Programmer
Sep 17, 2003
110
0
0
AU
Hello all.

I have a number of reports I am developing, which all work brilliantly in CR2008. I am only using an Eval copy at this site, but feel certain that's not the issue.

The DB is Sybase, but don't think that's relevant here either.

Using CR2008 & having the option of using Optional Parameters available, I have used optional parameters.

The problem comes when I try to open the report on the PROD machine, using a viewer.
I started with SAP's CR2008 Viewer, only to find out I couldn't refresh the report, so, moved on to Ken Hamady's viewer list.

From here I grabbed down Crystal Corral. All good, until I open a report that has a HasValue() function call in it to check on the optional param.

Must be a bug I thought naively, so moved on to grab Easy View 2 down. This also works, until I throw a report at it with HasValue() in it.

The optional parameter is NOT listed as a param at all on the param screen when the report is opened, in either viewer.

I put together a simple Formula:
Code:
If NOT HasValue({?My Parameter})Then
    "Empty"
Else
    {?My Parameter}

Crystal Corral throws an error of:
A number, currency, boolean, date, time, date-time, or string is expected here.
Error in File ....
Error in formula <OptionalTest>.
'If NOT HasValue({?My Parameter}) Then
'

A number, currency, boolean, date, time, date-time, or string is expected here.

Easy View 2 is a little less helpful with:
A number, currency, boolean, date, time, date-time, or string is expected here.

If I leave the HasValue() function call out & use something like Length() to check the optional param, CR2008 complains that "Parameter has no value".

Code:
If Length({?My Parameter}) = 0 Then
    "Empty"
Else
    {?My Parameter}

Here's the kicker though, I see the value "Empty" displayed in both viewers, along with the optional param being shown on the param screen.

I'm a little stumped, since it appears I can either have the reports work in a viewer OR work in the IDE. Being fussy AND greedy, I want the reports to work in both!!!

Has anyone else come across this?

Any suggestions welcomed.

Thanks,

Peter.
 
!!!!Resolved!!!!

:)

Easy View 3 now supports Optional Parameters in CR 2008.

Peter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top