Integration/Tutorials/Appearance.md
... ...
@@ -1,50 +1,89 @@
1
-#Appearance
1
+###SQL Samples of Various Join Types
2 2
3
-[[_TOC_]]
3
+**Inner (Direct) Join:**  Selects rows from two tables such that the value in one column of the first table also appears in a column of the second table.  
4 4
5
-###Introduction
5
+```sql
6
+SELECT DISTINCT 
7
+[dbo].[Invoices].[CustomerName] AS 'Customer Name'
8
+FROM [dbo].[Orders]
9
+INNER JOIN [dbo].[Invoices] ON [dbo].[Invoices].[CustomerID]=[dbo].[Orders].[CustomerID];
10
+```
6 11
7
-Izenda Reports fully integrates with your application both at the program level and visually. All visual aspects of Izenda Reports are user customizable and can be made to match your existing application's visual look and feel. These are some of the quickest ways to change the look and feel of our application in order to blend seamlessly with your product or application.
12
+**Cross Join:** A cross join will return a result table where each row from the first table is combined with each row from the second table. 
8 13
9
-###Setting Custom CSS and Navigation Image Files
14
+```sql
15
+SELECT DISTINCT 
16
+[dbo].[Invoices].[CustomerName] AS 'Customer Name'
17
+FROM [dbo].[Orders]
18
+CROSS JOIN [dbo].[Invoices];
19
+```
10 20
11
-####Settings.aspx
21
+**Left(First Exists) Join:** The Left Outer Join known also as Left Join returns all rows from the left table in the Left Outer Join clause, no matter if the joined columns match.  A field in a result row will be null if the corresponding input table did not contain a matching row.
12 22
13
-An example of how to set custom CSS:
23
+```sql
24
+SELECT DISTINCT 
25
+[dbo].[Invoices].[CustomerName] AS 'Customer Name'
26
+FROM [dbo].[Orders]
27
+LEFT OUTER JOIN [dbo].[Invoices] ON [dbo].[Invoices].[CustomerID]=[dbo].[Orders].[CustomerID];
28
+```
14 29
15
- * download the archive
16
- * [CSS.ZIP](http://wiki.izenda.us/Integration/Appearance/css.zip)
17
- * edit the CSS files, **but do not change the selector names or the filenames**
18
- * save the edited files to your server where they can be accessed via absolute urls
19
- * navigate to the settings.aspx page and click the "Images & CSS" tab shown below **-OR-** you can define them [[programatically|http://wiki.izenda.us/Integration/Tutorials/Appearance#Programatically]].
30
+**Right Join:** The Right Outer Join known also as Right Join returns all rows from the right table in the Right Outer Join clause, no matter if the joined columns match.  A field in a result row will be null if the corresponding input table did not contain a matching row.
20 31
21
- ![](http://wiki.izenda.us/Appearance/ImagesCssTab.png)
22
- * enter the new absolute URLs of the CSS files
23
- * fully clear your cache and restart the application
32
+```sql
33
+SELECT DISTINCT 
34
+[dbo].[Invoices].[CustomerName] AS 'Customer Name'
35
+FROM [dbo].[Orders]
36
+RIGHT OUTER JOIN [dbo].[Invoices] ON [dbo].[Invoices].[CustomerID]=[dbo].[Orders].[CustomerID];
37
+```
24 38
25
-####Programatically
39
+**Full Join:** The Full Outer Join known also as Full Join returns all rows from Both the Right Outer Join & Left Outer Join.  A field in a result row will be null if the corresponding input table did not contain a matching row.
26 40
27
- * download the archive
28
- * [CSS.ZIP](http://wiki.izenda.us/Integration/Appearance/css.zip)
29
- * edit the CSS files, **but do not change the selector names or the filenames**
30
- * save the edited files to your server where they can be accessed via absolute urls
31
- * Open up your global.asax and override the following properties:
32
- * [[DashboardsCssUrl|/API/CodeSamples/DashboardsCssUrl]]
33
- * [[FieldValueCssUrl|/API/CodeSamples/FieldValueCssUrl]]
34
- * [[ReportCssUrl|/API/CodeSamples/ReportCssUrl]]
35
- * [[SimpleFilterCssUrl|/API/CodeSamples/SimpleFilterCssUrl]]
36
- * [[TabCssUrl|/API/CodeSamples/TabsCssUrl]]
37
- * [[ToolbarCssUrl|/API/CodeSamples/ToolbarCssUrl]]
38
- * [[HeaderStyle|/API/CodeSamples/HeaderStyle]]
39
- * enter the new absolute URLs of the CSS files
40
- * fully clear your cache and restart the application
41
-
42
-After resetting and clearing the cache, the CSS changes should reflect in Izenda Reports.
41
+```sql
42
+SELECT DISTINCT 
43
+[dbo].[Invoices].[CustomerName] AS 'Customer Name'
44
+FROM [dbo].[Orders]
45
+FULL OUTER JOIN [dbo].[Invoices] ON [dbo].[Invoices].[CustomerID]=[dbo].[Orders].[CustomerID];
46
+```
43 47
44
-###Setting the Report List page (ReportList.aspx) CSS
48
+##Filters and Join Types
45 49
46
-Although the html element styles are hard coded into the application, it is possible to change them by simply placing a style tag into the page right after the end of the form. [[Please see this example]].
50
+If you specify a [[filter|http://wiki.izenda.us/Guides/ReportDesign/5.0-Filters-tab]] for the column in first(left) table in JOIN clause, all filters will be applied as usual (i.e. all filters will be in the WHERE clause):
47 51
48
-###Customer Integration Samples
52
+```sql
53
+SELECT
54
+[dbo].[Order Details].[Discount],
55
+[dbo].[Orders].[OrderID]
56
+FROM [dbo].[Order Details]
57
+LEFT OUTER JOIN [dbo].[Orders] ON [dbo].[Orders].[OrderID]=[dbo].[Order Details].[OrderID]
58
+WHERE [dbo].[Order Details].[OrderID] = 10248
59
+```
49 60
50
-We have screenshots of our customers' integrated solutions available [here](http://www.izenda.com/Site/Pages/Clients.aspx).
... ...
\ No newline at end of file
0
+Now let's say we want to specify filter for the column in the second(right) table. In this case, we should add this filter to the JOIN clause itself:
1
+
2
+```sql
3
+SELECT
4
+[dbo].[Order Details].[Discount],
5
+[dbo].[Orders].[OrderID]
6
+FROM [dbo].[Order Details]
7
+LEFT OUTER JOIN [dbo].[Orders] ON [dbo].[Orders].[OrderID]=[dbo].[Order Details].[OrderID] AND [dbo].[Orders].[OrderID] = 10248
8
+```
9
+
10
+The reason why we shouldn't place the filter in the WHERE clause is that it will transform our **LEFT OUTER JOIN** to an **INNER JOIN**. For example, when you use "WHERE [dbo].[Order Details].[OrderID] = 10248", you remove all NULLs from the results (obviously NULL doesn't equal 10248). To avoid this (to retain NULLs in the results) we should follow ANSI-92 SQL syntax and use conditional joins.
11
+
12
+We can also use an inner query to apply our outer left join:
13
+
14
+```sql
15
+SELECT
16
+[dbo].[Order Details].[Discount],
17
+Ord.[OrderID]
18
+FROM [dbo].[Order Details]
19
+LEFT OUTER JOIN
20
+(SELECT * FROM [dbo].[Orders]
21
+WHERE [dbo].[Orders].[OrderID] = 10248) AS Ord
22
+ON Ord.[OrderID]=[dbo].[Order Details].[OrderID]
23
+```
24
+
25
+When we apply filters within the JOIN clause, it's like we applied these filters separately to the table, and then added them to the JOIN. This can help speedup database performance. Please refer to the articles below for more information:
26
+
27
+* [[ANSI SQL-92 Standard|http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt]]
28
+* [[MSDN article about OUTER joins|http://msdn.microsoft.com/en-us/library/aa213228]]
... ...
\ No newline at end of file