vb.net 对于从 VS2008 到 VS2012 的升级项目,Crystal 未使用 UFL 库生成升级报告的代码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19810904/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 15:43:49  来源:igfitidea点击:

Crystal is not generating code for upgraded report with UFL Library for upgraded project from VS2008 to VS2012

vb.netvisual-studio-2012crystal-reports

提问by Hyman Gajanan

i have a solution developed in VS 2008 and 3.5 in VB with almost 38 projects (class libraries) in it. This whole thing is big project with almost 140 reports (crystal reports) in it.

我有一个在 VS 2008 和 VB 3.5 中开发的解决方案,其中包含近 38 个项目(类库)。这整个事情是一个大项目,其中包含近 140 份报告(水晶报告)。

now i install Visual Studio 2012 Ultimate with Crystal Report (CRforVS_13_0_7) and upgraded my solution to .net 4.5 everything works fine.

现在我使用 Crystal Report (CRforVS_13_0_7) 安装 Visual Studio 2012 Ultimate 并将我的解决方案升级到 .net 4.5 一切正常。

some of my reports uses a library written in VB.net CRUFL for InWord support in indian rupee format

我的一些报告使用用 VB.net CRUFL 编写的库来支持印度卢比格式的 InWord

now i am facing problem with upgrading reports to new crystal report format. when i open any report file and verify and save it asks me to save in new crystal report format if i choose yes to upgrade i get error from crystal code generator

现在我面临将报告升级为新的水晶报告格式的问题。当我打开任何报告文件并验证并保存它时,如果我选择是升级,我会要求我以新的水晶报告格式保存,我从水晶代码生成器收到错误

Custom tool error: "Code generator 'ReportCodeGenerator' failed.  Exception stack = CrystalDecisions.Shared.CrystalReportsException: Load report failed. ---> System.Runtime.InteropServices.COMException: UFL 'u212com.dll' that implements this function is missing.
Error in File repAbstract {B0F50159-6708-4E3E-A668-899D0616325C}.rpt:
Error in formula  drInWord: 
'UniSuiteReportingEXReportingEXToWords (ABS(Sum ({@drAmount})))'
UFL 'u212com.dll' that implements this function is missing.
   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   --- End of inner exception stack trace ---
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
   at CrystalDecisions.VSDesigner.CodeGen.ReportClassWriter..ctor(String filePath)
   at CrystalDecisions.VSDesigner.CodeGen.ReportClassWriter..ctor(String filePath, String resourceNamespace)
   at CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator.GenerateCode(String inputFileName, String inputFileContent)"  Z:\World Of Programming\Product\VS .Net\Products\Uni Suite\Uni Suite 2.0\Uni_Suite.Reports\repAbstract.rpt  1   1   Uni_Suite.Reports
  • What I figured out that the problem is with CRUFL function,

  • If I comment function in formula and just return normal string in it and flow the process report upgrades and works fine.

  • If I add new report and use this function is formula that also works fine.

  • I created completely new library written in 4.5 for any upgrading wizard errors but the behavior is same.

  • 我发现问题出在 CRUFL 函数上,

  • 如果我在公式中注释函数并在其中返回普通字符串并流程报告升级并且工作正常。

  • 如果我添加新报告并使用此函数,则公式也可以正常工作。

  • 我为任何升级向导错误创建了用 4.5 编写的全新库,但行为是相同的。

This is clear I cannot create all these reports again in new version, count is huge and some of them are very complex.

很明显,我无法在新版本中再次创建所有这些报告,数量庞大,其中一些非常复杂。

Am I missing something of is there anything I have to study first before upgrading my project

我是否遗漏了什么在升级我的项目之前我必须先学习什么

Please suggest

请建议

one more thing OS is windows 8.1 Pro

另一件事操作系统是 Windows 8.1 Pro

采纳答案by Hyman Gajanan

Found a temporary solution for it. This seems to be a bug in crystal designer in visual studio on windows 8.1

为它找到了一个临时解决方案。这似乎是 windows 8.1 上 Visual Studio 中水晶设计器的一个错误

Temporary solution is:

临时解决方案是:

  • Right click on report file and select properties

  • Remove “CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator” from Custom Tool.

  • Now report designer will not raise any error for any changes or testing, do updates or changes and save report.

  • Close designer of report

  • Now open properties and past “CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator” in custom tool and press enter. This will generate code for report without any error and report will also work fine

  • 右键单击报告文件并选择属性

  • 从自定义工具中删除“CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator”。

  • 现在报表设计器不会为任何更改或测试引发任何错误,进行更新或更改并保存报告。

  • 报表的关闭设计器

  • 现在在自定义工具中打开属性并通过“CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator”并按回车键。这将生成报告代码,没有任何错误,报告也可以正常工作

This will generate code for report without any error and report will also work fine This definitely a bug in crystal report for visual studio I don't know how to submit this bug to SAP but I will search and submit this to crystal report to help them improve this. Meanwhile this is a solution worked for me.

这将生成报告代码,没有任何错误,报告也可以正常工作这绝对是visual studio的水晶报告中的错误我不知道如何将此错误提交给SAP,但我会搜索并将其提交给水晶报告以帮助他们改善这一点。同时,这是一个对我有用的解决方案。

you can find communication regarding this here http://scn.sap.com/thread/3452634

你可以在这里找到关于这个的交流http://scn.sap.com/thread/3452634

EDIT

编辑

but now new issue after using above method report is not accepting any select filter and showing all data from database with select statement.

但是现在使用上述方法报告后的新问题不接受任何选择过滤器并使用选择语句显示数据库中的所有数据。

working on it... any help please

正在努力......任何帮助请

EDIT

编辑

Found solution for this also amazing, this is happening only with reports with UFL in same viewer OK

找到解决方案也很棒,这仅发生在同一查看器中带有 UFL 的报告中

found solution here http://scn.sap.com/message/8179989#8179989

在这里找到解决方案http://scn.sap.com/message/8179989#8179989

what you have to do is to remove following two lines from from designer where your viewer control is.

您需要做的是从查看器控件所在的设计器中删除以下两行。

crystalReportViewer.SelectionFormula = ""
crystalReportViewer.ViewTimeSelectionFormula = ""

EDIT

编辑

now i updated my crystal report to service pack 8 (v. 13.0.8.1216)

现在我将水晶报告更新为 Service Pack 8 (v. 13.0.8.1216)

Link http://scn.sap.com/docs/DOC-7824

链接http://scn.sap.com/docs/DOC-7824

But no luck still using method mentioned above

但是仍然使用上述方法没有运气

EDIT

编辑

i updated to crystal report service pack 10 (v.13.0.10.1385) & VS 2013 (64Bit windows 8.1 update 1)

我更新到了 Crystal Report Service Pack 10 (v.13.0.10.1385) & VS 2013 (64Bit windows 8.1 update 1)

but still no luck, using above method

但仍然没有运气,使用上述方法

回答by Matt

I received a similar error code in C# VS2010. I got it when adding Parameter fields to SubReports. It seems to happen before I link a field to the Parameter from the Main report. Just setting the links after creating the parameter seems to make the error go away again.

我在 C# VS2010 中收到了类似的错误代码。我在将参数字段添加到 SubReports 时得到了它。这似乎发生在我将字段链接到主报告中的参数之前。在创建参数后设置链接似乎会使错误再次消失。

回答by Kdunc2015

I know this is an old post but I got this error and my fix was different...

我知道这是一篇旧帖子,但我遇到了这个错误,我的修复方法有所不同......

Basically the error is responding to an out of date EF formula. I got the following answer through Viewpoint support.. OLD func. syntax throwing error: EFCityStateZip ({APPB.City},{APPB.State}, {APPB.Zip})

基本上错误是响应过时的 EF 公式。我通过 Viewpoint 支持得到了以下答案.. 旧功能。语法抛出错误:EFCityStateZip ({APPB.City},{APPB.State}, {APPB.Zip})

New func. syntax that works: ({APPB.City}&', '&{APPB.State}&' '& {APPB.Zip})

新功能 有效的语法:({APPB.City}&', '&{APPB.State}&' '& {APPB.Zip})