Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 在CLR函数中使用节点时间Dll对象时,SSRS CLR函数给出#错误_.net_Sql Server_Reporting Services_Nodatime_Ssrs 2014 - Fatal编程技术网

.net 在CLR函数中使用节点时间Dll对象时,SSRS CLR函数给出#错误

.net 在CLR函数中使用节点时间Dll对象时,SSRS CLR函数给出#错误,.net,sql-server,reporting-services,nodatime,ssrs-2014,.net,Sql Server,Reporting Services,Nodatime,Ssrs 2014,当我在函数中使用NodeTime对象时,试图从SSRS报告访问CLR函数时,我遇到了一个问题 当我从网页调用CLR函数时,它工作正常,但当我试图从SSRS访问该函数时,报告它的Giving#错误 If将写入简单文本并返回该文本,只有在使用Nodatime时,函数值才会显示在SSRS报告中,并将其给出#错误作为输出 我的DLL包含该函数,我使用的是.net Framework 3.5和NodeTime 1.3.4版本,报告使用的是SSRS-2014 这是CLR功能 public static s

当我在函数中使用NodeTime对象时,试图从SSRS报告访问CLR函数时,我遇到了一个问题

当我从网页调用CLR函数时,它工作正常,但当我试图从SSRS访问该函数时,报告它的Giving#错误

If将写入简单文本并返回该文本,只有在使用Nodatime时,函数值才会显示在SSRS报告中,并将其给出#错误作为输出

我的DLL包含该函数,我使用的是.net Framework 3.5和NodeTime 1.3.4版本,报告使用的是SSRS-2014

这是CLR功能

 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);
    }

请帮助我,谢谢。

您好,我得到了解决方案。我没有在GAC中注册NodaTime.Dll,这是导致此问题的原因。一旦我添加了,它就开始工作了。

你真的没有“错误”以外的信息了吗?没有日志?无法调试?我很想帮忙,但是如果没有更多的信息,我不确定我能不能帮上忙。