0 Bewertungen0% fanden dieses Dokument nützlich (0 Abstimmungen)
352 Ansichten11 Seiten
Many times, transactional tables in databases are big. I mean, huge. I have seen tables with 35,000,000 records. Imagine writing a report with four or more tables and the data resides in monstrous tables.
Let’s be clear here. There’s only so much that you can do when you have really big data sets. By the same token, however, often you can reduce the run time for large reports by using commands in Crystal Reports.
In the following PDF, see how I use Microsoft Excel to create a command in Crystal. This ultimately saves a great deal of time when the report runs.
Originaltitel
Creating SQL Commands in Crystal Reports via Microsoft Excel
Many times, transactional tables in databases are big. I mean, huge. I have seen tables with 35,000,000 records. Imagine writing a report with four or more tables and the data resides in monstrous tables.
Let’s be clear here. There’s only so much that you can do when you have really big data sets. By the same token, however, often you can reduce the run time for large reports by using commands in Crystal Reports.
In the following PDF, see how I use Microsoft Excel to create a command in Crystal. This ultimately saves a great deal of time when the report runs.
Copyright:
Attribution Non-Commercial (BY-NC)
Verfügbare Formate
Als PDF, TXT herunterladen oder online auf Scribd lesen
Many times, transactional tables in databases are big. I mean, huge. I have seen tables with 35,000,000 records. Imagine writing a report with four or more tables and the data resides in monstrous tables.
Let’s be clear here. There’s only so much that you can do when you have really big data sets. By the same token, however, often you can reduce the run time for large reports by using commands in Crystal Reports.
In the following PDF, see how I use Microsoft Excel to create a command in Crystal. This ultimately saves a great deal of time when the report runs.
Copyright:
Attribution Non-Commercial (BY-NC)
Verfügbare Formate
Als PDF, TXT herunterladen oder online auf Scribd lesen
Table of Contents INTRODUCTION 2 EXAMPLE: ONLY PULLING STATUS VALUES FROM THE HRHISTORY TABLE 4 CONCLUSION 11
http://www.philsimon.com Phil Simon A Trick for Creating Commands and SQL
2 page
Introduction You can certainly add a command in Crystal Reports by typing in SQL. You cannot, however, simply copy SQL created in Microsoft Access into a command because Access SQL is of the Jet SQL variety and Crystal will not recognizes it. Heres a very useful trick if you like to visualize the tables involving MS Excel using Database Query functionality.
Select the product line on which you wish to report.
http://www.philsimon.com Phil Simon A Trick for Creating Commands and SQL
3 page
You will then be prompted for your user name and password:
Select the table(s) that you wish to use in your Crystal Report.
http://www.philsimon.com Phil Simon A Trick for Creating Commands and SQL
4 page
Example: Only Pulling Status Values from the HRHISTORY Table In this example, we would like to write a report pulling hourly associates previous status values from HRHISTORY (a very large table). The aforementioned Database Query functionality, you can join the appropriate tables and add a filter for FLD_NBR = 20 (status) as follows:
Clicking on the SQL button gives you the following code:
SELECT EMPLOYEE.EMP_STATUS, EMPLOYEE.EMPLOYEE, HRHISTORY.A_VALUE, EMPLOYEE.FIRST_NAME, EMPLOYEE.LAST_NAME FROM DB30_LAW_PROD.lawuser.EMPLOYEE EMPLOYEE, DB30_LAW_PROD.lawuser.HRHISTORY HRHISTORY http://www.philsimon.com Phil Simon A Trick for Creating Commands and SQL
5 page
WHERE HRHISTORY.COMPANY = EMPLOYEE.COMPANY AND HRHISTORY.EMPLOYEE = EMPLOYEE.EMPLOYEE AND ((HRHISTORY.FLD_NBR=20) AND (EMPLOYEE.SALARY_CLASS='H'))
We are now going to paste this code into a Command in a new Crystal Report. In the Database Expert in Crystal, see below:
Clicking Add Command gives us this:
http://www.philsimon.com Phil Simon A Trick for Creating Commands and SQL
6 page
Paste the previously-created code into the command:
http://www.philsimon.com Phil Simon A Trick for Creating Commands and SQL
7 page
Click OK and you will be prompted for authentication:
http://www.philsimon.com Phil Simon A Trick for Creating Commands and SQL
8 page
Your command now appears in Crystal:
[Type a quote from http://www.philsimon.com Phil Simon A Trick for Creating Commands and SQL
9 page
Going to the report design view, you can see the fields selected in the Excel Database Query:
http://www.philsimon.com Phil Simon A Trick for Creating Commands and SQL
10 page
Now, we select the fields, as follows:
http://www.philsimon.com Phil Simon A Trick for Creating Commands and SQL
11 page
Running the report now gives us the data with superior performance (ignoring the non-status values ). Conclusion Use this trick if you would like to significantly decrease the amount of time required to run reports from very large tables and you dont know how to code in proper SQL. http://www.philsimon.com