向RDLC自定义代码添加多个功能

编程入门 行业动态 更新时间:2024-10-16 08:19:28
本文介绍了向RDLC自定义代码添加多个功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试为我的 Web 应用程序制作一个相对复杂的 rdlc 报告,而我目前面临的问题是报告的自定义代码部分中定义了一个函数.然后我在那里添加了另一个函数,报告没有执行,给出错误报告的定义无效".每次我删除此功能时,报告都会顺利运行,当我将其添加回来时,它会在报告查看器中出现此错误.

I am trying to make a comparatively complex rdlc report for my web application and the problem that I am currently facing is that there is one function defined in the custom code section of the report. And then I added another function there and the report is not executing giving an error "The definition of report is invalid." Everytime I remove this function the report runs smoothly, when I add it back it gives this error in the report viewer.

推荐答案

用于在 rdlc 中编写自定义代码:

For writing custom code in rdlc :

  • 在报告"菜单上,单击报告属性".
  • 在引用"选项卡上,单击添加"按钮,然后从添加引用"对话框中选择或浏览到程序集.
  • 在类中,键入类的名称并提供要在报告中使用的实例名称.这是实例成员的情况,对于静态(在 VB 中共享)成员的情况,您不需要在类中添加任何内容.
  • 在自定义代码中,您可以编写函数:

    In Custom Code You can Write your functions:

    Public ReadOnly Property FetchSomeData() As String Get Return sharedMember End Get End Property Dim sharedMember As String = "Shared Data (Does not require initialization)" Public Function MyFunction(ByVal s As String) '' Write your code and return String Return s.toUpper() End Function

    更多推荐

    向RDLC自定义代码添加多个功能

    本文发布于:2023-11-22 06:05:45,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1616251.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:多个   自定义   代码   功能   RDLC

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!