Finding Crystal Reports in Visual Studio and Determining SQL / proc Table Usage

Hello, I have a series of crystal reports in my VS2008 project.

I am making changes to a couple of my database tables and want to ensure that all necessary changes are made to the reports. I performed a standard VS search for the specific stored procedure that is being used, and it did not find any results. However, when I went into the report and looked at the "Select Expert", I saw that the procedure was actually being used.

Is there a way to easily find all the reports for this procedure (and others)? Or do I need to go to every report and check?

Thanks,

+4
source share
3 answers

This is part of the VB process that I created to create a list of all the tables used by my reports. The reports are listed in the "report table", and I use the memo field to store the name of all the tables used. After updating the tables, it is easy enough to update all the requested reports.

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 
+1
source

I had a similar problem with Reporting Services reports. I ended up using a free application called Agent Ransack . I am sure that there are many tools that do the same, but this is what I use. I simply point it to the folder and put the name of the table that I am looking for in the "containing text box". I pull my source from TFS to my VS projects folder, and it does not take this application long to search all the subdirectories, and it always seems to find what I need. It is not integrated into VS, but it can be useful if no one provides a better solution.

0
source

I changed Philippe code to this:

 Public Function tablesUsedByAReport(ByRef report As CrystalDecisions.CrystalReports.Engine.ReportClass) As String Dim m_tablesUsedByAReport As String = String.Empty Dim myTables As Tables = report.Database.Tables 'table names in the report' For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables m_tablesUsedByAReport = m_tablesUsedByAReport & myTable.Location & ";" Next For Each subreport As CrystalDecisions.CrystalReports.Engine.ReportDocument In report.Subreports For Each mytable As CrystalDecisions.CrystalReports.Engine.Table In subreport.Database.Tables m_tablesUsedByAReport = m_tablesUsedByAReport & mytable.Location & ";" Next Next Return m_tablesUsedByAReport End Function 
0
source

All Articles