|
| 1 | +--- |
| 2 | +title: Create a Balance Sheet |
| 3 | +author: Anna Gubareva |
| 4 | +--- |
| 5 | +# Create a Balance Sheet |
| 6 | + |
| 7 | +This tutorial describes how to use the Cross Tab control to create a **Balance Sheet** report. |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +> [!Tip] |
| 12 | +> This tutorial shows how to configure a Cross Tab using the [Report Wizard](../report-designer-tools/report-wizard.md). See [Create a Cross-Tab Report](create-a-cross-tab-report.md) for information on how to use the Cross-Tab Report Wizard. |
| 13 | +
|
| 14 | +## Add a Cross Tab and Bind It to Data |
| 15 | + |
| 16 | +1. Invoke the Report Wizard and [add a blank report](../add-new-reports.md) to your application. |
| 17 | + |
| 18 | +1. Drop the Cross Tab control from the Toolbox onto the report's [Detail band](../introduction-to-banded-reports.md). |
| 19 | + |
| 20 | +  |
| 21 | + |
| 22 | +3. Click the Cross Tab's smart tag, expand the **Data Source** property's drop-down menu and click **Add New Data Source**. |
| 23 | + |
| 24 | +  |
| 25 | + |
| 26 | +4. Use the invoked [Data Source Wizard](../report-designer-tools/data-source-wizard.md) to bind the Cross Tab to a data source. |
| 27 | + |
| 28 | +Click **Finish** to complete the Data Source Wizard and assign the created data source to the Cross Tab. |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +The data source structure becomes available in the [Field List](../report-designer-tools/ui-panels/field-list.md). |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +> [!Note] |
| 37 | +> Ensure that the report's **Data Source** property is not set if you place a Cross Tab into the [Detail band](../introduction-to-banded-reports.md). Otherwise, the Cross Tab data is printed as many times as there are rows in the report data source. |
| 38 | +
|
| 39 | +## Define the Cross Tab Layout |
| 40 | + |
| 41 | +1. Drop data fields from the Field List onto the Cross Tab's areas to define the Cross Tab's rows, columns, and data. |
| 42 | + |
| 43 | + A row is added to the bottom of the Cross Tab to display grand total values calculated against the added row or column header. |
| 44 | + |
| 45 | +  |
| 46 | + |
| 47 | + Drop nested row headers next to the parent header cells to create a hierarchy. |
| 48 | + |
| 49 | +  |
| 50 | + |
| 51 | +Switch to Print Preview to see the Cross Tab populated with data. |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +## Specify Group Settings |
| 56 | + |
| 57 | +As you can see in the image above, the Cross Tab displays data for individual days. |
| 58 | + |
| 59 | +Select the column header cell and click its smart tag. Set the **Group Interval** property to group data. |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | +## Specify Layout Options |
| 66 | + |
| 67 | +1. The Cross Tab control stacks row headers horizontally. You can change the view so that parent values span the entire row header panel width. |
| 68 | + |
| 69 | + Select the Cross Tab and switch to the [Property Grid](../report-designer-tools/ui-panels/property-grid-tabbed-view.md). Expand the **Layout Options** group and enable the **Hierarchical Row Layout** property. |
| 70 | + |
| 71 | +  |
| 72 | + |
| 73 | +2. Set the **Corner Header Display Mode** property to **None** to merge cells in the top-left corner into a single empty cell. |
| 74 | + |
| 75 | +  |
| 76 | + |
| 77 | +Switch to Print Preview to see the result. |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | +## Hide Grand Totals |
| 82 | + |
| 83 | +1. Select the bottom right cell and click its smart tag. Disable the **Row Visible** and **Column Visible** properties to hide the row and column that display grand total values. Invisible cells are filled with a hatch brush. |
| 84 | + |
| 85 | +  |
| 86 | + |
| 87 | +2. Resize the Cross Tab. You can also resize individual rows and columns. |
| 88 | + |
| 89 | +  |
| 90 | + |
| 91 | +The Cross Tab control no longer displays grand total values. |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +## Sort and Format Data |
| 96 | + |
| 97 | +1. Select the row sub-header cell and change its sort order. The Cross Tab sorts row and column field values in ascending order. Set the **Sort Order** property to **None** to restore the original data source order. |
| 98 | + |
| 99 | +  |
| 100 | + |
| 101 | +2. Format the data. Hold down SHIFT or CTRL and select cells. Specify the cells' **Text Format String** property. |
| 102 | + |
| 103 | +  |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | +## Customize Appearance |
| 108 | + |
| 109 | +1. Select the Cross Tab, switch to the **Properties** window and expand the **Styles** property. Use the **General Style** property to specify common appearance settings that apply to all Cross Tab cells. Set the following properties: |
| 110 | + |
| 111 | + * **Background Color** to **White** |
| 112 | + * **Border Color** to **SlateGray** |
| 113 | + * **Font** to **Tahoma 8.25** |
| 114 | + * **Foreground Color** to **SlateGray** |
| 115 | + |
| 116 | +  |
| 117 | + |
| 118 | +2. Expand the **Header Area Style** property and do the following: |
| 119 | + |
| 120 | + * reset the **Background Color** property value to inherit the color from the general style; |
| 121 | + * set the **Foreground Color** property to **MidnightBlue** to override the general foreground color; |
| 122 | + * set the **Font** property to **Tahoma 8.25** to override the general font. |
| 123 | + |
| 124 | +  |
| 125 | + |
| 126 | +3. Expand the **Total Area Style** property and set the following properties to override general settings: |
| 127 | + |
| 128 | + * **Font** to **Tahoma 8.25 Bold** |
| 129 | + * **Foreground Color** to **MidnightBlue** |
| 130 | + |
| 131 | +  |
| 132 | + |
| 133 | +4. Select the row sub-header cell and set the following appearance properties: |
| 134 | + |
| 135 | + * **Foreground Color** to **SlateGray** |
| 136 | + * **Font** to **Tahoma 8.25** |
| 137 | + |
| 138 | + These values apply to the selected cell only and override values specified for the entire header area. |
| 139 | + |
| 140 | +  |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | +5. Select the cells in the top row and in the rows with total values. Set the **Borders** property to **Bottom** and **Border Width** property to **2**. |
| 145 | + |
| 146 | +  |
| 147 | + |
| 148 | +6. Select the cells you did not customize in the previous step and set the **Borders** property to **None**. |
| 149 | + |
| 150 | +  |
| 151 | + |
| 152 | +7. Select the cells in the top row and set the **Background Color** property to **LightSteelBlue**. |
| 153 | + |
| 154 | +  |
| 155 | + |
| 156 | +8. Select the row sub-header cell and the next cell in the data area. Set their **Background Color** property to **AliceBlue**. |
| 157 | + |
| 158 | +  |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | +## Apply Odd and Even Row Styles |
| 163 | + |
| 164 | +Use the **GroupRowIndex** variable in [expressions](../use-expressions.md) to identify odd and even rows. |
| 165 | + |
| 166 | +Select the row sub-header cell and the next cell in the data area. Go to the **Properties** window and open the **Expressions** tab. Click the **Background Color** property's marker, select **Background Color Expression** and specify the following expression: |
| 167 | + |
| 168 | +_iif([Arguments.GroupRowIndex] % 2 == 1, Rgb(235, 241, 252), ?)_ |
| 169 | + |
| 170 | + |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | +As you can see, the row backgrounds do not start from the page's left border, but have indents. These indents correspond to auxiliary cells in a tree. |
| 175 | + |
| 176 | +Select these auxiliary cells and disable the **Column Visible** property. |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | +To add indents to row field values and imitate a tree-like view, set the **Padding** property for the Cross Tab's cells. |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | +## Add a Report Title |
| 187 | + |
| 188 | +1. Right-click the report and select **Insert Band / ReportHeader** from the context menu. |
| 189 | + |
| 190 | +  |
| 191 | + |
| 192 | +2. Drop a [Label](../use-report-elements/use-basic-report-controls/label.md) from the Toolbox onto the created Report Header. |
| 193 | + |
| 194 | +  |
| 195 | + |
| 196 | +3. Double-click the label and type the report title. Specify appearance settings. |
| 197 | + |
| 198 | +  |
| 199 | + |
| 200 | +Switch to Print Preview to see the final result. |
| 201 | + |
| 202 | + |
0 commit comments