Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the benefit of Enforce Join option in Crystal Reports?

What is the benefit the makes SAP Crystal reports Enforce Join default option in Link Dialog is "Not Enforced"?

Is it performance issue? because I noticed if you don't select field from the joined table it'll generate SELECT query with only fields of the selected Table only without any joins.

here's some information about the Enforce Join options:

  • Not Enforced: When you select this option, the link you've created is used only if it's explicitly required by the Select statement. This is the default option. Your users can create reports based on the selected tables without restriction (that is, without enforcement based on other tables).

  • Enforced From: When you select this option, if the "to" table for the link is used, the link is enforced. For example, if you create a link from Table A to Table B using Enforce From and select only a field from Table B, the Select statement will still include the join to Table A because it is enforced. Conversely, selecting only from Table A with the same join condition will not cause the join to Table B to be enforced.

  • Enforced To: When you select this option, if the "from" table for the link is used, the link is enforced. For example, if you create a link from Table A to Table B using Enforce To and select only a field from Table A, the join to Table B will be enforced, and the Select statement that is generated will include both tables.

  • Enforced Both: When you select this option, if either the "from" table or the "to" table for this link is used, the link is enforced.

like image 990
Emad Mokhtar Avatar asked May 25 '11 10:05

Emad Mokhtar


People also ask

What is the default join for tables in Crystal Reports?

These settings determine how Crystal Reports matches records from both tables. The default join type is an inner join, which means that only records with a matching key in both tables are included.

What is the purpose of Crystal Reports?

Crystal Reports Features The main purpose of Crystal Reports is to allow users to pull their desired data from a data source, such as an Oracle or MS SQL Server database, and present the data in a repeatable and organized way.


1 Answers

The "enforced" part is used to FORCE the inclusion of tables that contain fields that are NOT used in the report/select conditions.

Well crap, that's what you said.

My understanding:

If you have two tables (tbl_A, tbl_B) w/ a link-able field, and you don't USE any field from the second table, it can be dropped from the select, and the "regular" effects of the join may disappear.

Select 
   'You're account is in default!' as Message,
   tbl_A.full_name, tbl_A.street_address, tbl_A.city, tbl_A.blah_blah
From
   all_customers tbl_A, 
   delinquent_accounts tbl_B
Where
   tbl_A.account_no = tbl_B.account_no

Without the enforced join, might wind up as

Select 
   'You're account is in default!' as Message,
   tbl_A.full_name, tbl_A.street_address, tbl_A.city, tbl_A.blah_blah
From
   all_customers tbl_A, 

In other words, you might wind up setting dunning letters to your whole customer base instead of just the delinquent accounts. (Which is why we test reports before implementing them, I guess).

like image 159
Marc Avatar answered Oct 06 '22 13:10

Marc