Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some Info

Status
Not open for further replies.

pritiw

Programmer
Mar 2, 2001
14
US
Can someone help me with a requirement that i have.

we have a lot of reports accessing a database which has a lot of views, and we r not sure which views r being accessed by these reports.

we know its possible to get the list of views accessed by one particular report. but we need list of all views accessed by a set of reports(in one folder)....is it possible?...
by using some tools.
thanx
 
By using external programming language (I use Delphi) you can extract a list of tables that are associated with a crystal reports object - I would have thought that the logic would be the same and allow the same with views - unless anyone can suggest otherwise ?
Steve
 
hi steven,

thanks a lot for the tip. could u please give the sample code to do it.

thanks again
 
pritiw : Just to clarify - we are talking about 'view' objects in the database structure ?
What database type is it ?
What language do you program in ?
I'll try and knock together an example shortly ..
Steve
 
hi steve....
its SQL Server(7.0) database....
i am comfortable with c,c++ and VB.....
and yes we are indeed talking about views....
thanx a lot for u'r help....
Priti
 
Pritiw : OK - just checked an old app written in Delphi and it can be used to indicate a single '.RPT' file and generate a list of the tables/views used in the report. I'll go over it again shortly and modify it so that it cycles through an indicated directory and output the findings to a text file. I'll try and get it to you in the next day or two - what e-mail address can I send it to ?
Steve.
 
hi steve,
thanx again for the help.....
my emailid is pritiw@yahoo.com
thanx again....
priti
 
priti : I've just found that I don't have the example code on my machine at home but have managed to dig out some printed stuff that should help. Bear in mind that this code is from Delphi and you will need to interpret into the language you are using :
In the form declarations I declare a variable 'CRReport' of type 'IReport'.
As for the code itself you just need to iterate through the database tables associated with the open report (in path 'tpRptPath'). Application1 is of type TApplication and is an installed component from CRAXDRT_TLB.
CRReport := Application1.OpenReport(tpRptPath);
for tpI := 1 to (CRReport.Database.Count) do
begin
StringList.Add('Table/View : ' + CRReport.Database.Tables[tpI].Name;
StringList.Add('Location : ' + CRReport.Database.Tables[tpI].Location;
end;

The result of this code will be that your StringList will be populated with alternating Table (or View) names and their respective locations in the database (i.e. Database-Name.Table-Name).
If this doesn't help let me know and I'll find the code for you on Monday and e-mail it to you .....
Steve
 
thanks a lot steve.......it works.....
priti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top