This is a migrated thread and some comments may be shown as answers.

User Function Problem

10 Answers 293 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
johnv
Top achievements
Rank 2
johnv asked on 13 Oct 2008, 07:10 PM
Hello,

I am using version 2.8.8.925 of the Telerik Reporting tools. I have a custom user function that I am using in two textboxes. the code is simple enough but I think I may be doing something wrong.

Class Function
public static string DecodeHtml(string html)  
        {  
            string decodedText = HttpContext.Current.Server.HtmlDecode(html);  
            return decodedText;  
        } 
Control 1
=DecodeHtml(Fields.Description) 


Control 2
=DecodeHtml(Fields.ResolutionComment) 

 The report looks fine except that the first field works and the second field produces the following error.
Describe the Problem:   
    
    
  Many aircraft's Work Unit Code (WUC) manuals have WUC's for wiring scattered throughout the manual. Also, there are few are or wire bundle specific WUC's. This all contributes to inaccurate data being entered into the maintenance data reporting system. Having WUC's scattered throughout the manual b aircraft system instead of   
by aircraft location and/or wire bundle leads to inaccurate data submission and wasted time looking for the "best" WUC to use for a particular repair. Better use of WUC's will provide more detailed data submission which will enable better data extraction and better tracking of wiring problems. Wiring should be treated as a separate system and not as parts of several other aircraft systems. WUC's for wiring should be combined into a separate section in the WUC manual. WUC's for aircraft areas and/or wire bundles should be added. N.O.C. WUC's should be removed from the manuals. Also, more wire specific malfunction codes should be added. The E-2C aircraft community is currently working this issue. Recommend checking with them for ideas of what can be done.   
    
    
  Resolution:   
    
  #ERROR# The expression contains undefined function call DecodeHtml().   
   
 

Not sure why this is the case, but I am also getting the same issue if I replace my function with the StripHtmlTags() function.

Any help would be fantastic! Thanks.

Very Respectully,

John

10 Answers, 1 is accepted

Sort by
0
johnv
Top achievements
Rank 2
answered on 13 Oct 2008, 08:47 PM
It seems that if the field returns a null from the database query, then the function isn't constructed properly and error's out. This is also true for the default functions included with the reporting product. The simple answer is to use a case statement in your query so that when a field is null then it returns a non null value, else return the value as seen below:

'ActionResults' = CASE   
                        WHEN acs.ActionResults IS NULL THEN ''   
                        ELSE acs.ActionResults   
                      END, 


In the end it is a satisfactory work around. I hope this helps anyone who is running into this error.

Very Respectfully,

John Valentine
0
Tree
Top achievements
Rank 1
answered on 28 Oct 2008, 12:22 AM
Thanks Valentine!  I was pulling my hair out trying to figure out what was wrong.


Telerik,

You really need to fix this or, at the very least, document this quirk very clearly!
0
Steve
Telerik team
answered on 28 Oct 2008, 08:06 AM
Hi guys,

This has been addressed already and would be part of the Q3 release expected early next month. Another possible solution for the time being that does not require changes in your db query is using IsNull in your user function i.e.:

=StripHtmlTags(IsNull(Fields.MyField, null))

Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Tree
Top achievements
Rank 1
answered on 28 Oct 2008, 01:37 PM
Telerik,

Yes, that is what I ended up figuring out (I used IsNull() to convert nulls to empty strings before passing to all User Functions.

I have a complaint:

Why oh why doesn't Telerik let users know about these known issues so that we don't waste time on them?  In this particular case it was especially frustrating because I had originally tried to write my expression in the Expression Editor but it wasn't working.  My expression checked for nulls in various Fields (using IIf()) and, if found, replaced them with System.String.Empty.

Well, that didn't work (I didn't know that I couldn't reference .NET types) so I sent in a ticket.  The support person told me to implement the function with a User Function.  OK.  Thanks.  But surely the support person should have warned me about this quirk/bug in Telerik Reported _especially_ since I had included my expression which clearly showed I was testing for null Fields in the ticket! 
0
Steve
Telerik team
answered on 28 Oct 2008, 02:51 PM
Hi Eriksson,

The issue was first reported by Mr.John Valentine 2 weeks ago and it was not a known issue back then.
You were not advised in your support ticket due to the following reasons:
  • you already used IsNull checks
  • the exception in your case was due to incorrect method signature and not DBNull value.
We do have plans to "open" our bug repository to the outside world at some point, when we decide on the format and way to do that.
Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
johnv
Top achievements
Rank 2
answered on 28 Oct 2008, 03:22 PM
Thanks for the Kudos. I am glad that I was able to lend helping hand. Speaking of leding a helping hand, this is the part where I shamelessly ask for some Telerik Points... LOL...

Cheers!

John Valentine

0
Steve
Telerik team
answered on 28 Oct 2008, 03:34 PM
Hi John,

I've just updated your account with shameful number of Telerik points :) Do let us know if you find other issues with your Reporting experience.

All the best,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
johnv
Top achievements
Rank 2
answered on 28 Oct 2008, 03:54 PM
Thank you for your generosity. I will certainly continue to post regarding questions/problems I encounter, with my own workarounds as I find them. I do like the collaboration aspect of this/our community.

Cheers!

John Valentine
0
Tree
Top achievements
Rank 1
answered on 28 Oct 2008, 03:54 PM
Yes, please open the bug list up to customers!  Adding it to the list of resources that are searched in the "Support Center" would, as far as I am concerned, be a great way to let customer know.  You might also consider a subsription service where customers get an email whenever a new bug is added (or resolved) in a Telerik component that they are 'subscribed' to.
0
johnv
Top achievements
Rank 2
answered on 28 Oct 2008, 04:16 PM
Hi Eriksson,

I am not sure I have time to pour through emails regarding every bug in these controls. It could have a negative impact on the user base and some of these bugs may have proprietary information that Telerik doesn't want released.  I think that it may behoove our community to have a simple sticky post in each forum where people can go to see threads similar to this one (the moderators can move/copy them in). The email will take care of itself, and we get a place where we can quickly reference issues that people have resolved in some way.

That's all I want. A place where I can see challenges faced by the community and how the community was able to overcome them.

Just my 2 cents.

-- John


Tags
General Discussions
Asked by
johnv
Top achievements
Rank 2
Answers by
johnv
Top achievements
Rank 2
Tree
Top achievements
Rank 1
Steve
Telerik team
Share this question
or