crystal reports viewers, crystal reports schedulers, view crystal reports, report analyzers, burst reporting, report scheduler
 
view crystal reports, rpt viewer, crystal reports viewers, crystal reports schedulers, report analyzers, burst reporting, report scheduler
desktop viewer, crystal reports viewers, crystal reports schedulers, report analyzers, burst reporting, report scheduler

Crystal Reports Tools: Improve Performance While Saving Time and Money

  Resources  
Best sellers:
cView
Report Analyzer
cViewSERVER
ReCrystallize
 


Articles:
Administration
Advanced
Basic
Crystal eNL
Database
Financial
Problems Solved

Books:
CR Books

Database Books
Developer Books

 
Tools:
Analyzers
Bestsellers

CR Schedulers
CR UFLs
CR Viewers
DataBase Tools
Graphics
International
Mail UFLs
ReCrystallizePro


Add'l:

About us

Contact Us
cViewSUITE Ppt
Support

 

CrystalReports
on Steroids

Crystal Reports: Join tables together with a UNION join

Sometimes, we need to have a record appear in more than one place in our Crystal Report. Examples of this include stock movements in and out of the warehouse, or call centers where calls come in and get resolved.

If you want to display activity or status on a series of days, the same call or stock item needs to appear on several days.

One solution to this problem is to use SQL to create a different view of the data. A UNION join will combine a series of tables into one recordset for your report:

SELECT "In" as CallType, InDate as CallDate, CallID from Calls

UNION ALL

SELECT "Out" as CallType, OutDate as CallDate, CallID from Calls

The UNION ALL includes duplicate records, otherwise a UNION is adequate. You can also combine several of these if you want stock status at different dates. You can’t do this with the SQL inside Crystal Reports but you can use this technique if you can create SQL views or queries in your database. You can also do it in the Crystal SQL designer.

 

What is the difference between UNION and UNION ALL

When we use SQL to combine two tables using a UNION statement we usually use "UNION ALL" because that’s what seems to work properly. But why? What does the UNION ALL do that the UNION by itself does not?

UNION will do a reprocessing of the records to remove any duplicates, while UNION ALL will skip this step. For that reason UNION ALL will be a lot faster than a UNION. Some databases discourage UNION and will insist that a UNION ALL is used.

 

SQL Designer

If you do a "Full" install of Crystal Reports, you get the Crystal SQL Designer and Crystal Dictionary programs installed. These can be very useful additions to your reporting weaponry.

Click here for an article on the Crystal Dictionary.

The Crystal SQL Designer has an expert that can gently lead you through an inquiry against your database or you can enter your SQL directly. The retrieved records can then be used as the source for a report, or exported to another format.

So why use it? There are several advantages you might discover.

1) You can save data in your QRY file. This means you execute the SQL against the main database once, and then can process your Crystal Reports against the QRY file without compromising the performance of your main database.

2) You also have the ability to send the QRY file to a remote site, so a user there can process reports without requiring a connection to your original data

3) If the Application developer doesn’t want you to have permission to make changes to the Db, you can use this tool to process the SQL you would normally use in a view or stored procedure.

4) A full set of SQL functions is available here, including Summary functions and UNION joins.

 

 

This article is copyrighted by Crystalkeen, Mindconnection, and Chelsea Technologies Ltd. It may be freely copied and distributed as long as the original copyright is displayed and no modifications are made to this material. Extracts are permitted. The names Crystal Reports and Seagate Info are trademarks owned by Business Objects.