What is an alternative to hasvalue command. Sorry I cannot publish all of the text because of this annoying forum restrictions on some words which I cannot identify under my original question.
*PLEASE SEE MY EDITED COMMENTS* I MANAGE TO TYPE THE MESSAGE USING EDITING!
Can someone please tell me what to use alternative to "hasvalue" under Crystal Reports.
Many thanks
Regards
Jehanzeb
Edited by: Jehanzeb Navid on Aug 20, 2008 11:03 AM
Dear all,
I tried different ways to get my report working on Infoview.
It seems our Server (Crystal Reports Server XI R2) does not read parameters which holds parameter values using "Has value" command (please note: this is my assumption).
Why am I saying this?
Well, I have uploaded many reports developed under Crystal Reports 2008 onto our server and they all are working perfectly.
However, this particular report is not working.
In this report I have used, dynamic parameters and "has value" command under Record Selection formula.
After trying everything (checking server, reinstalling CR, restarting server, taking folders out from info view and put it back in and loads more) I edited the report which is working on the server and re-created the whole report onto it.
After re-creating it I uploaded this report onto the server but IT DID NOT WORK!!!
now I am out of options and require urgent help from you all.
Anyone who could let me know what value should I use (or it is being used under version XI of Crystal Reports).
I am thinking to recreating the whole report under version XI and then see if that works.
Please help!
Many thanks
Kind Regards
Jehanzeb
Request clarification before answering.
I have upgraded my server to Crystal Reports Server 2008 and for obvious reasons I don't have to change the hasvalue command anymore.
In theory it hasn't been solved but practically the issue has been solved by introducing new server.
Regards
Jehanzeb
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i think you can use the if condition instead of hasvalue
if {myfield} = "" then false
else truegood luck
Amr
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Amr for your quick reply.
Could you please help me with the code as I am not sure how to apply that on my selection formula
here is the code
{order_header.date_entered}>={?Start Date} and
{order_header.date_entered}<={?End Date} and
(not Hasvalue({?Account Number}) OR {order_header.account_no} = {?Account Number}) and
(not HasValue({?Product Group}) OR {order_lines.stock_code}[1 to 5] = {?Product Group}) and
(not HasValue({?Sales Area}) OR {slslsp.slr_slsperson} = {?Sales Area});
The problem is coming under (not(hasvalue.......)
Thanks
Regards
Jehanzeb
I'm afraid this doesn't work.
In a sense that when I use this, my report does not bring any results whatsoever.
here is how I used it on only one single parameter to test it
{order_header.date_entered}>={?Start Date} and
{order_header.date_entered}<={?End Date} and
If ({?Account Number})="" then
true
else
false
Regards
Jehanzeb
Edited by: Jehanzeb Navid on Aug 20, 2008 11:41 AM
Ok it is working with some tweaks however now it doesn't bring all the records if I leave it blank. It should bring all the records if I leave account number blank.
Also now the percentage is not working when the value of total jobs = 0.
I used formula
If {#Total Jobs} = 0 Then
0
Else
{#Still_In_Lab}%{#Total Jobs};
totext({#Still_In_Lab}%{#Total Jobs},2)+"%"
I have been using that however when the value is null it doesn't produce anything.
The "" is for strings and my report contains values with digits and also I have a conditional suppression for account numbers and customer names.
I have used Isnull and when I run it, on conditional suppression it says value cannot be null.
I cannot believe that XIR2 doesn't recognize these commands.
I am trying different combinations to make it work.
Lets see what I come up with (has to be before 2:30 as I have to show it to the directors who are anxiously waiting for it).
Regards
Jehanzeb
J,
Hey old friend.
You'll need to know if the field is truly or if it has an empty string. The following formula would test for both:
IF ISNULL({Table.Field}) OR {Table.Field} = "" THEN FALSE ELSE TRUE
Or conversely:
IF NOT ISNULL({Table.Field}) OR {Table.Field} <<>> "" THEN TRUE ELSE FALSE
Jason
Hey!! Morning Jason,
How you doing?
Yes! I am back with the stupid problem again. Everything went well with the report until I uploaded it onto our Enterprise CRXIR2 Server.
Apparently, the parameters which are used in Crystal Report 2008 are not compatible with parameters used in CRXIR2 Server. Hence, I cannot use some CR2008 terminology in conjunction with CRXIR2 Server..
For example "Hasvalue" in CR08 cannot be used in conjunction with CRXIR2 Server.
So I need an alternative to it.
I cannot use "IsNull" functionality because, IsNull checks if the database field is null, and if it is, it throws an error.
Just like on mine I used it on my parameter fields and each time each field is empty it throws an error "Cannot be null".
I need a code which checks if parameter has a value, it can be string, number or anything else.
If I use "" that only checks the string and not numbers.
So in other words, it should be "IF Parameter has value then false else true."
Regards
Jehanzeb
Amr,
I can use IF statement conjunction with Isnull statment providing it does not throw an error upon checking the parameter fields.
Whenever I leave any parameter field blank it throws an error (upon runtime)
Parameter cannot be null
Can you help me finding out how to stop CR to throw error message when a parameter field is null?
If you can then I will use it.
I am not denying the fact that I cannot use it. I can use it and I will however, this will not help me if it is keep going to throw error messages upon every empty parameter field.
I think everyone is confused between "Parameter field" and "database field".
Is null works with database field and not with Parameter field. Parameter is evaluated differently.
Regards
Jehanzeb
yes you are right,
Crystal Report 2008 Provice Optional Parameters so the parameter can be null
but previous versions doesnt provide the optional parameters so you can not leave the parameter null.
you will have no solution for that,
but you still can make a workround.
please check this post.
good luck
Amr
Amr,
I am very close to what I could use as an alternative (Thanks to You).
Could you please help me with Dynamic Parameters which uses Range values.
It is not working with it.
When Dynamic parameter appears, it appears in Drop down menu list (2 drop down menus comes up as it is set to range value).
I cannot set "na" on it nor I can use "...". The "..." comes up when the parameter is loaded. I thought I might use that to avoid it however I cannot.
Any ideas how to set it?
Regards
Jehanzeb
J,
I go to sleep and the conversation leaves without me.
1) you can add "N/A" or "ALL" or anything else to a dynamic prompt using a SQL command as your LOV.
a- Add a command to a Data Foundation like this:
SELECT
FieldName = 'N/A'
SELECT
FieldName
FROM TableName
This will append 'N/A' to the top of your dynamic list.
2) To use it as a selection criteria, use a formula similar to this:
IF {?ParameterName} = '* ALL *'
THEN {TableName.FieldName} like '*'
ELSE {TableName.FieldName} = {?ParameterName}
Hope that helps,
Jason
Jason,
I am sure nothing leaves behind from your watchful eyes. This post was quite down the list however you found it and replied it this morning.
It almost looks like you hunting for my "silly" posts all the time )).
I have tried your method, I remembered you love using SQL under CR as by looking at our old posts. However for some reason when I try to run CR (at runtime) it hangs for 20 mins and then crashes.
When I add the SQL it works fine however at the run time it just doesn't do anything.
I am currently installing CR Server onto our new Server 2003 and going to install CR2008 on it (as suggested by some people that installing Crystal 2008 onto the same server as CRXIR2 solves the problem).
I am going to try that, if that doesn't work then we have a problem because MD is soo anxious to make this report live. He is keep on coming to my office every morning saying "I came to see you this morning"....He is almost like a alarm clock.
Anyhow I am going to test the server and will let you know if that works.
Regards
Jehanzeb
Right I installed Crystal Reports 2008 onto our new server machine and kept our XIR2 server. It didn't work.
I just had a chat with our directors and he wants to test the report. I am not sure what else I can do to make it work.
I've told him that sales area isn't working at the moment. however it really needs to work before I can make this report live.
I am trying another formula lets see if that works.
Regards
Jehanzeb
No Jason, I simply went into the Database explorer and added a command. The SQL command I used is working in conjunction with Informix Database because when it doesn't work it shows an error message.
I didn't use Business view manager.
I'll try doing on it and see if that works.
Many thanks
Kind Regards
Jehanzeb
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.