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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW DO I CONNECT TO TWO TABLES FOR ONE REPORT?

Status
Not open for further replies.

jodo

Programmer
Feb 18, 2002
42
0
0
US
Using CR 8.5 designer, inside of VB 6.0.

I have several reports that work running off of one table. Now I need to connect another report using two tables. I've added both of the tables to the database hierarchy in the designer. The join is an equal join. I am connecting a numeric field in one table to another numeric field in the look-up table. However, what I need is the description(string) attribute in the look-up table, not the numeric field I joined with. When I run the report, nothing comes back.

Can someone help me? ;-)
 
Nevermind, I figured it out. Something simple I was doing wrong.
(-: (I feel like this most of the time)
 
O.K. I take that back....it still doesn't work.

SOMEBODY HELP ME PLEEEEAAAASSSE!!!! %-)
 
Hello

Why don't you create a view or stored procedure and then link CR to the view/stored procedure.
 
I did query the tables together in the designer, then I had the report point to that query. But it takes 25 minutes to run the report (I timed it). The way I've done it with the previous single table reports work and I figured a multiple table report would have the same efficiency as a single table report, but I guess not. I've never created a stored procedure before. Have you done what I'm doing, and if so, is it more efficient to use a stored procedure? I'm ignorant to stored procedures, I'm not sure how to connect it to what I'm doing.

Any help is appreciated.
 
Hello

I have done it using views and stored procedures. I have cleaned up other peoples reports who used tables.

If you need to retrieve data from multiple tables from a SQL Server database, the most efficient way is to retrieve it using a stored procedure to retrieve and merge the data as necessary, and then sending the results to the web server for formatting. This is much more efficient that sending two or more queries to SQL Server, returning two or more tables at the web server, and then combining the results of the two or more tables there.

Whenever accessing SQL Server data, consider always use a stored procedure if you want maximum performance. This is true whether you are selecting, inserting, updating, or deleting data. Avoid using ADO.NET's methods to access SQL Server data, as they will always be slower than accessing SQL Server data directly with a stored procedure.

If you will be selecting data from a SQL Server database for non-interactive display only on a web page, you should consider using the SQLDataReader for best performance if you are not using a stored procedure. When using a SQLDataReader, you should select records from your SQL Server database using a SQLCommand query and create a SQLDataReader that is returned from the SQLCommand object's ExecuteReader method.



 
I'm not using SQL Server, I'm using ORACLE as the the database, Visual Basic 6.0 as the front end, and Crystal Reports as the reporting utility. I'm using the Crystal Designer inside of VB, not the stand-alone Crystal Reports. Obviously I've connected the tables the right way, but it takes 25 minutes to run the report. I'm have to find a way to speed up performance.

Any suggestions?
Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top