0

I am facing issue when trying to access the CLR Function from the SSRS Report when i am using NodaTime Objects in the function.

When i am calling the CLR Function from the web page its working fine but when i try to access the function from SSRS Report its Giving #error.

If will write simple text and return it the function value is displaying in the SSRS Report only when Nodatime is used that time its giving #error as output.

My DLL which is containing the function is in .net Framework 3.5 and NodaTime 1.3.4 version i am using and SSRS-2014 i am using for report.

This The CLR Function

 public static string ConvertFromUTCToLocalTime()
    {
        //string UserDateTime,string userTimeZone,string validateFormat
        //DateTime UserDateTime
        // Since your input value is in UTC, parse it directly as an Instant.
        var pattern = InstantPattern.CreateWithInvariantCulture("dd/MM/yyyy HH:mm");
        var parseResult = pattern.Parse("31/03/2017 02:00");
        if (!parseResult.Success)
            return "Invalid Date time provided...";
        var instant = parseResult.Value;

        // You will always be better off with the tzdb, but either of these will work.
        var timeZone = DateTimeZoneProviders.Tzdb["Australia/Sydney"];
       // var timeZone = DateTimeZoneProviders.Bcl[userTimeZone];

        // Convert the instant to the zone's local time
        var zonedDateTime = instant.InZone(timeZone);           

        return zonedDateTime.ToString("dd-MMM-yy HH:mm", null);
    }

Please help me thank you.

Liquid
  • 648
  • 1
  • 7
  • 20
  • Do you really have no more information than "#error"? No logs? No way of debugging? I'd love to be able to help, but without more information I'm not sure I'll be able to. – Jon Skeet Mar 31 '17 at 15:10

1 Answers1

0

Hi got the solution i didn't registered the NodaTime.Dll In GAC which was causing this issue. once i added it started working.

Liquid
  • 648
  • 1
  • 7
  • 20