Link to home
Start Free TrialLog in
Avatar of Gerth
Gerth

asked on

Field on report missing during runtime

Hi

I have a very weird problem bogging me.
When I use a particular field in a report formula does it crash at runtime, but not during design.
The report shows/uses the field without problem during preview in the designer, but as soon the report is deployed to be used by my organisation will it crash when used.

To fault find the issue have i removed all the code where this ifield is used, and just tried to place the field on the report and put edges on the field, to check if the field is empty, but it completelly dissapears from the report when used outside the designer and I know that it has data in it.

The particular field is a "tic box" , it is a string(1) type.

The problem started since we added a field in our SQL server, this table is already used by the report and I have updated the table in Crystal so the field is visible to crystal.

Is there any way of "rebuild" a report to completelly verify all links and fields are working?
Or any other ideas?

I really don't want to rebuild the whole report as it's a quite complex one.

The report is called from the client side with 3 parameters but none of those is in the updated table.

Avatar of LinInDenver
LinInDenver
Flag of United States of America image

Hi Gerth,

From the database menu, have you chosen "Verify Database"? This will check the links.

Something else I would try - create a new report, but just drag the one problem field onto it to see if it gives you any kind of error.
Avatar of Mike McCracken
Mike McCracken

Can the new field or the problem field be NULL?

How is the problem field used in the report?
Is it used in a calculation?  Can it be 0?

Do you get an error meddage when the report crashes?
Check the system logs.

mlmcc
Avatar of Gerth

ASKER

Hi

LinInDenver
Yes I have tried to verify links, and they don't come up with any errors.
Have even gone throught all attached tabels to be sure.

I have yesterday started to test the field by draging the field to another report, as you suggest - no crasch on that report but no data either even that I know that in my test case so is the box ticked in the database so it would turn up as "1" i the report.

mlmcc
The field can contain a null value, but with Crystal XI you have the option to convert the NULL to a default value of 0 and I use this option.
Browsing field data only reveals "0" and "1" in Crystal designer.

I use the particular field in a calculation but not in a division , so the problem isn't a Division by zero
The field is evaluated in an IF statements as it's an on/off switch for a particular event to be true or not.

I reviece an error message but it's not from Crystal - to my knowlege is this error message from the program that calls the report and sends the parameters to the report.
The field we are talking about aren't one of those parameters.

I will continue to work with my sample report for a while, might give me some clues whats going on
Avatar of Gerth

ASKER

Update

Further testing with the test report reveals that if the field is dropped onto the report does it not show up at runtime, thought visible during preview in designer - report shows without crash and all other fields on the report is visible with their data.

Does i reattach a basic IF statement does the report crash again.

if {vy.q_vtgservice} <> '1' then
    'Field is 1'
else
    'Field is 0 or NULL'

So I think that I need to get hang of the programmer that made the program that calls on the report and see how the call to the report is written.
I can't see any other possibility now than the problem isn't the report but the call for the report.

//Gerth
Avatar of Gerth

ASKER

Update 2

As sad before - is the IF statement not present in a report formula does the report work without any tendency to crash.
I did now notice that even the label for the field is missning on the report, as the field was unrecognized by the crystal viewer (that i suppose is used on the client side).

I have a similar type of field present on the report and this field, is for the moment NULL in the database,  comes out as BLANK in the data , but has a label visible.

//Gerth
Wow Gerth - I don't have any new ideas for ya. Sounds like you are doing some good troubleshooting. when you just drop {vy.q_vtgservice}  onto the report landscape does it display 1 or 0 correctly?
Avatar of Gerth

ASKER

Hi LinInDenver

Yepp it does - as long as I just preview it in Crystal Designer.
But as soon as I  call the report from the client side - gone ;(

//Gerth
When you say client side, what kind of application is calling the report? I'm pretty much all Crystal Enterprise/InfoView, but a lot of the people on here use .NET, etc. to call reports...

Long shot - what if you convert it to a number first?

if isnumeric({vy.q_vtgservice})=FALSE
then 0
else tonumber({vy.q_vtgservice})

By the way - on a string value I don't think convert null to default will turn it into a 0 - that would happen on a numeric database field.

If you haven't already, try unchecking those boxes in your report options. For null values you can do a check similar to below.

if isnull({vy.q_vtgservice}) or {vy.q_vtgservice}=''
then '0'
else {vy.q_vtgservice}


or building on what I descibed above....

if isnull({vy.q_vtgservice}) or {vy.q_vtgservice}=''
then 0
else if isnumeric({vy.q_vtgservice})=FALSE
then 0
else tonumber({vy.q_vtgservice})
Avatar of Gerth

ASKER

HI Again LinInDenver

Actually do crystal reports convert the NULL value to a 0.
Browsing the data on the field only reveals 1 and 0:os, and when i test a similar field of the same type so is it displayed as 0 when it contains a NULL value.
I have also testes my IF statement on that field and it works lika a charm, so the problem is definitelly well defined - "just" one fild not working ;)

The program calling the report is writen in VB or VB.NET (i think, as its a bought program) - I see VB runtime errors in my server log.

I have another clue that I will test tonight, the field I have the problem with resides inside a database that is connected to our ERP system Jeeves Enterprise.
This system allows adding custom fields to the systems databases, and after that does a special script need to be run to get the field visible to the system - some kind of DB rebuild.
I have done this rebuild after adding this field to the DB - maybe has something not gone completelly right in this process, so I will rebuild the database again and see if that corrects the problem.

Thanks for your hints

//Gerth
Good luck!!! I think yours is definitely a unique problem - maybe some of the VB guys will chime in with some additional hints.
Avatar of Gerth

ASKER

Still inverstigating possible solutions.
Did last evening recreated the specific field in the database by deleting it from the table and attach it again - no luck though.

Story continues

//Gerth
ASKER CERTIFIED SOLUTION
Avatar of Gerth
Gerth

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial