▶️ Watch Now: Print Design
1- Click Form (CTRL + F) on the Client screen.
2- Enter the name you will give to your printout in the window and click the arrow button.
3- Form Design will open. You can access general features from the XtraReport area in the Properties section.
4- In Actions section in the Properties window, band can be added to the design screen from the marked area. The properties of each of these bands are different. These will be explained in the next steps.
5- If the Form Design is displayed in the Behavior section on the right side (Properties> XtraReport) in the field named Display Name, the name of the downloaded document will be dynamic according to the data in this field. If this field has an equivalent with AS, it must be written. In the example below, the document name is created according to the data written in the field named Subject.
6- If it is desired to have a dot between them in order to make it easier to read large numbers in a numerical field, the appropriate format can be specified in the "Format String" field under "Data Binding" in the "Actions" field. As an example, if we select that field and write {0: n2} in the Format section, an layout of 2,500,000.00 will be displayed.
7- The first opened design screen includes Top Margin Band, Detail Band, and Bottom Margin Band.
8- You can write the data that you will add to these tapes by dragging and dropping XRLabel from the design tools on the left side to the design screen.
9- You can view the changes made on the design screen in the layout by making a print preview in the area marked below from the tools at the top in the form design. There are cut, copy, paste, delete, back, forward tools in this section. Next to the print preview icon is the Scripts tool where you can add code.
10- In the form design screen, you can create a new report area when you click the marked place in the upper left corner. You can automatically create data in the design area by selecting fields in the table or view from the New via Wizard and Design in Report Wizard sections. You can save the design you created with "Save". You can access Form design again by selecting Form (CTRL + F) from the lower right corner on the Client screen and clicking the name of the layout from the window that appears.
11- When you click on Add New Field, a window appears where you can write queries. You can give a name for the query to the "Field Name" section. You can choose Dynamic, Static or Datasource from the Type section. You can choose the Datasource type when you write a query. You can write the query in the field below. When you use ‘’ $P ‘’ on this screen, you need to have the relevant data on the client screen. You can save and exit the query.
12- On the right side of the form design screen, there is the Fields tool under the Properties tool. Tables, static fields and queries will appear in this field when Datasource List opens. For example, you can open a table and drag any area inside it to the design area. After dragging this area, enter the properties tool again and select XtraReport. You can click the name of the table you selected in the Data Member field from Actions and add where it shows the data from here. There is a Report Explorer tool under the Fields tool. You can view all of the areas you have added to the design in this tool in general.
13- Bands added from actions field in Properties:
After adding these bands, you can pull down from the left with a ruler to expand and contract.
- Top Margin Band: It is the top displayed on each page.
- Report Header Band: The part that follows the Top Margin Band on the first page. If it is longer it continues to other pages. Shows only once, doesn't repeat.
- Page Header Band: It is the part shown on each page. Report Header Shows and repeats on every page immediately after the band ends. No matter how long the information is, it shows up to one page. It remains under Top Margin on every page. (Top of Page)
- Group Header Band: After the Report Header Band section is over, the section immediately following the Page Header Band (as shown on each page) and the section that precedes the Detail. The information in it can be extended, continues to other pages.
- Detail Band: You should put the fields you took with the query and the table here. If more than one value is returned, this will be displayed in the Detail section. Compress the fields you added to the Detail section. From the ruler on the left side of the design, you only need to make room for the Detail area. Because it prints over and over as much as the data contained in this area. Otherwise, it prints as blanks. If you want, you can add a border to the fields from the border.
- Detail Report Band: Can be used to add information below each line in the table in Detail. Because the data here comes after every line.
- Group Footer Band: The part following the detail (and detail report) band. The information may be extended. It continues to the other pages.
- Report Footer Band: The part shown after the Group Footer Band. It may extend to other pages.
- Page Footer Band: It is located just above the Bottom Margin Band at the bottom of each page.
- Bottom Margin Band: This is the bottom part of each page.
- Sub-Band: The lower band part that can be added for each band.
14- Properties - Appearance section
PADDING = Returns the distance of the text on the page to the edges and the background color of the page.
WATERMARK = The part of the text or picture settings to be placed in the background.
Properties – Page Settings
PAPER KIND = You can select the type of paper to be printed here. Letter is displayed when Default is selected.
You can adjust the page settings here.
15- You can add border and text color from the Appearance section of Properties while on a band.
16- When there is a label in the design (it can be any toolbox), you can access its properties from the right side. You can determine the location of the data (by tape) in the label from Actions. You can change the background color, text color, text font, and the position of the text in the label from the Appearance. You can determine the distance of the vehicles from the layout area from the left and top (x and y). You can determine the width and height from the size section.
17- In the design, the Multi-Column Options area information of the Detail band includes printing features as you want the pictures side by side. For example, the pictures in a pictures table are required to be next to each other. For this, the XRPictureBox toolbox, where the picture data will be taken, is dragged into the detail area. And it is compressed between the detail area. Then, from Multi column options for Detail from Properties, Column Count field is determined how many pictures will be next to each other. In other words, the number of columns is determined by thinking like printing on a table on the screen. The width of the column can be adjusted from the Column Width area (the column to the left of the gray area becomes the column width). From the Column Spacing area, the number of spaces between two images can be determined. In the Layout area, it is determined whether the pictures will be placed one after the other or side by side when printing from the database to the screen. AcrossThenDown prints to the right and then to the down line. DownThenAcross prints it down then the next column. Mode is selected automatically by filling in the count or width field. If the Mode field is set to None, printing is performed one after the other in the default.
18- It allows you to comfortably create a table with the XRTable toolbox. You can design any table you want with buttons such as delete, insert row, cell in Actions field in Properties section.
19- Some details in the Actions section of the bands:
Page Header -- Print On
Report Header -- Page Break
Group Header -- Repeat Every Page
-- Page Break
Detail Band -- Page Break
Group Footer -- Page Break
-- Repeat Every Page
-- Print at Bottom
Report Footer -- Print at Bottom
Page Footer -- Print On
20- Print On: The bands on which,
Report Header (1)
Report Footer (2)
Report Header and Report Footer(3)
It ensures that the bands above are not displayed according to the selection made.
Repeat Every Page: When this field is marked on the band, it ensures that the band is displayed on each page.
Page Break: Makes the page jump before or after the selected band.
──────────────────────────────
OTHER EXAMPLES FOR PRINTING
Example 1: Preparing Layout by Grouping an Area on the Grid
1- Prepare a query for the grid. Or you can use the existing table.
Select design in report wizard on the left.
2- Select related query.
3- Send whatever fields we want to be displayed to the right.
4- Select the area to group.
5- If you have numerical data, you can click on it if you want any calculations related to them or if you do not want, you can go through the marking.
6- You can choose the ready drafts below as they look. After selecting, you can delete places you don't like, change the name or change the places you want to see.
7- Here you can choose the fonts available.
8- If there is a text you want to appear as a title in the printout, you can write it in the field below. Finally you can click finish.
Where you don't want to click Next, you can click finish to create the design right up to where you came from.
9- It will look like this:
On the design side;
(If this ready-made image is the area that we want to change, we can make changes for the image you want by paying attention to the bands. The ones that are written in red are only the fields that are specified by name, the areas taken from the query or the table.)
10- Sample data entered by the client;
11- Appearing on the layout side;
──────────────────────────────
Example 2: Example of Subreport Parameter Binding
1- First, Categories and Products create two tables
Domain names are shown in the picture below.
The important area here is the common field of these two tables, CategoryID. And set the type to int.
Categories Table
2- Add two categories to this Categories table.
Categories Table
3-
Products Table
4- Add 3 products to the table of these products, two of which belong to the category of drinks and one to the category of spices.
Products Table
5- Create the layout design name by clicking the Form (CTRL + F) button from the client with the category table.
6- Create queries for categories and products with add new field.
7- Select the data member of the Xtrareport query with the Categories table.
8- Add category name and description from this query to the detail band field.
Turn back to Report File List and create new report for subreport (Report1)
The subreport design should not be opened and saved from the main design. To update the design after making the subreport connection, the Report1 design must be opened from the Report File List window.
9- The newly opened report will not be datasource. To do this, go to the field on the right and add new datasource by clicking add data source.
10- Select query for data member a products table for this subreport.
11- In this design, add table headers to Report Header. Add the information in the table to the detail.
12- Then add parameters from the fields field on the right. Create a parameter by changing its name and type.
13- Add filtering to the Filter String field by selecting the subreport's properties.
14- In the opened editor, click on + next to the editor and add condition.
15- The field below will open.
First, select the CategoryID from the table fields opened by clicking on the left field.
16- Then select Parameter from the left field.
17- Go to the Filter String field and write the name of your parameter next to the question mark.
18- XtraReport and Report1 files should be opened and edited separately from the design list.
19- In the main report, click on the subreport1 field once and go to the properties. Link the CategoryID in the query where we write the Categories table with the parameter you named Category by clicking '' + '' in the PARAMETER BINDINGS field under the DATA feature.
Parameter Name = Category
Binding = CategoryID (field in categories query)
20- Save and exit main report(XtraReport)
21- You can check the image by clicking the print button from the client where the categories table is located and selecting the layout design.
Now your products are sorted by category.
──────────────────────────────
Example 3: GRAPHIC PREPARATION IN LAYOUT DESIGN
1- In the sample form, there are tool boxes named city and weather degree.
2- Create your query with add new file in form design area. Give 1 to UserTableID for testing.
3- Save the form design and exit.
In Properties, add your query from the Data member field when XtraReport is assigned.
4- Drag the toolbox named XRChart on the left to the field.
5- Select properties for Chart.
Open the CHART STRUCTURE field from here. Click to the Chart section.
6- Click Series. Open the Selected Element field. Change the name from the "Name" section of this selected series
7- Type City into Name from SELECTED ELEMENT.
Select the city field for the series from the query by selecting the query in the ArgumentDataMember field. There is VALUE DATA MEMBERS at the bottom. Find your query from the Value section and select the Degree field.
8- In print preview, you can see the inside data looks like this. You can then remove the Where filter in your query for other data.
9- When you save the form design and open it again, you can see all your data comes without filter.
10- If you want to add in binary series;
Add days as an example.
Include Monday and Tuesday.
11- Add two series from the (+) icon next to the Series field in the Chart section.
12- Select the SELECTED ELEMENT section after clicking on the first series.
Now write your first series name, Monday. Select the field named City from your query in the ArgumentDataMember field. Select the Value field in degrees from your query in VALUE DATA MEMBERS. Open the DATA FILTERS section. And add field from + button. Select the Day field from your query for ColumnName from the menu called Data Filter. Choose Monday as Value.
13- Do the same for the second series, Tuesday. And save and quit.
Your chart is now ready.
If you want to add more series and see, you can go on like this.
14- It looks like this as layout.
15- The colors, bar style, tags here are the default ones. If you want to edit them;
You can make changes in the Type field in the VIEW section of SELECTED ELEMENT. There are several types of graphics. You can choose from here.
16- You can determine the color, area, direction, position of the labels in the graphic from the fields in the label under the View.
17- You can edit it by clicking on the label to the right of the legend graphic from the CHART section and opening the SELECTED ELEMENT section. The same is true for Axis X and Axis Y. We can proceed to SELECTED ELEMENT section to edit these fields.