visual-studio-2008 - 在 Visual Studio 中搜索 Crystal Reports 并确定是否正在使用 SQL table/proc

标签 visual-studio-2008 search crystal-reports

您好,我的 VS2008 项目中有许多 Crystal 报告。

我正在对我的几个数据库表进行更改,并希望确保对报告进行所有必要的更改。我对正在使用的特定存储过程进行了标准 VS 搜索,但没有找到任何结果。然而,当我进入一份报告并查看“选择专家”时,我发现该程序实际上正在被使用。

有没有办法轻松搜索此程序(和其他程序)的所有报告?还是我必须进入每一份报告并检查?

谢谢,

最佳答案

这是我构建的 VB proc 的一部分,用于生成我的报告使用的所有表的列表。报告列在“报告表”中,我使用备忘录字段来存储所有使用过的表的名称。一旦表被修改,就可以很容易地更新所有请求的报告。

Public function tablesUsedByAReport(myReportName as string) as string
Dim m_report As CRAXDRT.Report, _
      m_crystal As CRAXDRT.Application, _
      m_tablesUsedByAReport As String

Dim m_table As CRAXDRT.DatabaseTable, _
      m_section As CRAXDRT.section, _
      m_objet As Object, _
      m_subReport As CRAXDRT.SubreportObject

Set m_crystal = New CRAXDRT.Application
Set m_rapport = m_crystal.OpenReport(m_nomRapport, 1)

'table names in the report'
For Each m_table In m_rapport.Database.tables
    m_tablesUsedByAReport = m_tablesUsedByAReport & m_table.location & ";"
Next m_table

'table names in each of the subreports'
For Each m_section In m_rapport.Sections
    For Each m_objet In m_section.ReportObjects
        If m_objet.Kind = crSubreportObject Then
            Set m_subReport = m_objet
            Set m_report = m_subReport.OpenSubreport
            For Each m_table In m_rapport.Database.tables
                m_tablesUsedByAReport = m_tablesUsedByAReport & m_table.location & ";"
           Next m_table
        End If
    Next m_objet
Next m_section

'my tables list'
tablesUsedByAReport = m_tablesUsedByAReport

End function    

关于visual-studio-2008 - 在 Visual Studio 中搜索 Crystal Reports 并确定是否正在使用 SQL table/proc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/473645/

相关文章:

asp.net-mvc - Crystal 报表与 Blazor

crystal-reports - Crystal Reports 中交叉表报表的行标题

.net - Intellisense 提示和 XML 返回注释 (VS2008)

mysql - 通配符输入导致其他搜索输入检索多输入搜索表单中的所有数据

css - 如何在 .less 文件上打开 Visual Studio 2008 .css Intellisense

search - 有没有办法在不重新启动 Solr 服务器的情况下动态更新同义词文件?

字符串匹配算法: (multi token strings)

crystal-reports - 消除重复行的 Crystal 报表记录选择公式

visual-studio-2008 - Visual Studio 2008 和 Office 2003

c++ - 如何让visual studio 2008 IDE在正确的地方寻找头文件。编译Qt/C++程序