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

User defined functions not working

11 Answers 523 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 19 Jul 2010, 04:06 PM
Hi

Since upgrading to Q2 2010 my reports don't recognise user defined functions at runtime. Design time they are fine but cannot locate the function when I run the program.

I have created a class which inherits the telerik report class. In this class I define all my report functions as PUBLIC SHARED.

I then base all my reports on my class so they all have access to the shared functions. This works fine when I'm designing so I'm not sure what the problem is at runtime. It simply gives an error "The expression contains an undefined function call ........."

It used to work before upgrading... Any suggestions ?


Regards


Paul.

11 Answers, 1 is accepted

Sort by
0
Arthur Wu
Top achievements
Rank 1
answered on 20 Jul 2010, 01:53 AM
Hi Paul~

I got the same problem too.
Then, i could only copy each share function to every report which is need the function.
0
Paul
Top achievements
Rank 1
answered on 20 Jul 2010, 10:55 AM
Hi Arthur

Not really a solution for me because I have too many reports and I don't want to duplicate so much code.

I am currently trying to find a work-around until Telerik support can assist. I will keep you posted.

Regards


Paul.
0
Patrick
Top achievements
Rank 1
answered on 20 Jul 2010, 01:41 PM
All my ETL reports reside in a single assembly; i.e. ETLReportsLibrary. In that assembly, I have a class that contains a slew of public static methods that can be used in any of the reports in the library :
  • GetMonthBudget()

  • GetMonthActual()

  • GetMonthNet()

  • GetYTDActual()

  • GetYTDBudget()

     

     

For the most part, these methods only make sense in the ETL reports, that's why the ReportUtilities class resides in that assembly. At least that's the approach I'm taking, and it seems to work quite well.

namespace ETLReportsLibrary
{
  public class ReportUtilities
  {
    public static string GetConnectionString()
    {
      return (ETLReportsLibrary.Properties.Settings.Default.oracleConnectionString.ToString());
    }
  
    public static string GetPeriodEndingDate(string fyCode, string fyPeriod)
    {
      string connectionString = GetConnectionString();
      string periodEndingDate = string.Empty;
      string sqlQuery =
        @"SELECT period_ending_calendar_date
          FROM fiscal_periods_view
          WHERE fiscal_yyyypp = '{0}{1}'";
  
      using (OracleConnection oraCn = new OracleConnection(connectionString))
      {
        oraCn.Open();
  
        using (OracleCommand oraCm = new OracleCommand())
        {
          oraCm.CommandType = System.Data.CommandType.Text;
          oraCm.CommandText = string.Format(sqlQuery, fyCode, fyPeriod);
          oraCm.Connection = oraCn;
  
          periodEndingDate = (string)oraCm.ExecuteScalar();
  
          if (periodEndingDate != null)
          {
            periodEndingDate = ProperCase(periodEndingDate.ToString().Replace(",", ", "));
          }
          oraCm.Dispose();
        }
        oraCn.Close();
        oraCn.Dispose();
      }
      return (periodEndingDate);
    }
  
    public static string ProperCase(string input)
    {
      TextInfo ti = new CultureInfo("en-US", false).TextInfo;
      string retVal = ti.ToTitleCase(input.ToLower());
      return (retVal);
    
}
0
Paul
Top achievements
Rank 1
answered on 20 Jul 2010, 02:03 PM
Hi Patrick

That is exactly how I have setup my reports. Are you on the latest release of Telerik, i.e. Q2 2010 ?

Have you also created a class based on the Telerik report class and then based your reports on that class ? That may be the only difference since all my functions are in one assembly along with the reports in the way you described.

The reports work at design time but not runtime. They used to work until the upgrade to Q2 2010.

Many thanks for your help so far. Much appreciated.

Regards


Paul.
0
Patrick
Top achievements
Rank 1
answered on 20 Jul 2010, 02:23 PM
We're using the Q2 2009 release, not sure why we've not made the jump to Q2 2010. I've registered for the "What's new in Q2 2010: WinForms and Reporting" webinar today. Perhaps I can uncover a nugget to use as an argument for going to the latest version.

Regarding your 2nd question, my reports are based on the Telerik.Reporting.Report class.
0
Paul
Top achievements
Rank 1
answered on 20 Jul 2010, 02:40 PM
Hi Patrick

Thanks for the info. I do now think it is Q2 2010 related and will have to wait until Telerik support reply.

Probably the best nugget for an argument to upgrade would the ability to "Drill Down" in reports. I haven't had chance to test this out yet because I can't get my reports to run properly.

They have introduced a few nice features into winforms like Desktop Alert, but also made a few controls obsolete like Tab Strips (they now use PageViews which are quite nice and better in my opinion), Comboboxes and ListBoxes. They now have DropDownLists and ListControls instead.

I would proceed with caution with an upgrade because I fear you will have the same issue as me with regards to reports.

Regards


Paul.
0
Patrick
Top achievements
Rank 1
answered on 20 Jul 2010, 02:54 PM
I've looked very briefly at the "drill down" reporting, but it appears to be more like "report linking", not a true drill down. By that I mean, clicking on a row that contains, let's say a customer order, would expand the report to show all the items on that order. Clicking on another customer order would collapse the previous list and expand the newly selected customer order. I don't know if you have any experience with Crystal Reports, but it has that functionality. As much as I loathe Crystal Reports, it does have a leg up in that regard. If Telerik would implement similar functionality in a future release, that would be more icing on the cake. :o) We are migrating away from Crystal Reports and will be adopting Telerik Reporting across all our Web and desktop applications.

Please keep me informed with your upgrade issues.
0
Chris Gillies
Top achievements
Rank 1
answered on 22 Jul 2010, 10:04 AM
Hi Patric,
This is actually a  drill through. You can read that in the Release notes:
http://www.telerik.com/products/reporting/whats-new/release-history/q2-2010-version-4-1-10-714.aspx
Navigate To Report (drill through) (see video Creating Drillthrough Reports in Telerik Reporting)

0
Peter
Telerik team
answered on 23 Jul 2010, 09:16 AM
Hello Paul,

Thank you for elaborating.

We will need more information in order to reproduce the issue regarding the User Functions behavior. To avoid any confusion, please check out the attached sample project. We would appreciate if you modify the attached project to reflect the problem and send it through the support system or if it is showing what you think is wrong - please let us know.

Best wishes,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Paul
Top achievements
Rank 1
answered on 23 Jul 2010, 11:43 AM
Hi Peter

I think I can give you more information on this issue because I discovered the problem whilst building a sample project for you to see my problem.

What seems to happen is the report's "New" contructor is firing twice. Once when the report object is created and again when the report is refreshed. This is what my problem is because I setup properties when I create the report object and because when I refresh the report it fires the "New" contructor again it loses all my property values. It seems to re-initialise every time the report is refreshed.

I confirmed this by putting a message box in the Sub New() event of the report.

Any ideas or am I missing something...

Thanks for your help.


Regards


Paul.


0
Milen | Product Manager @DX
Telerik team
answered on 28 Jul 2010, 05:52 PM
Hi Paul,

You report will be (re)instantiated using its default (parameterless) constructor while refreshing the report in the following scenarios:


If that is not the case and you believe there is some incorrect behavior while refreshing you report, please open a support ticket with attached sample runnable project reproducing this behavior so that we can help you further.

Kind regards,
Milen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Paul
Top achievements
Rank 1
Answers by
Arthur Wu
Top achievements
Rank 1
Paul
Top achievements
Rank 1
Patrick
Top achievements
Rank 1
Chris Gillies
Top achievements
Rank 1
Peter
Telerik team
Milen | Product Manager @DX
Telerik team
Share this question
or