Skip to content

Commit

Permalink
update 23.2 documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ritazakhodyaeva committed Feb 14, 2024
1 parent b359bca commit 01a68f9
Show file tree
Hide file tree
Showing 49 changed files with 588 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,132 @@ title: Add Watermarks to a Report
---
# Add Watermarks to a Report

This tutorial describes how to add watermarks to a report and use preprinted forms.
DevExpress Reporting allows you to display text and picture watermarks on report pages. You can also specify an expression that assigns different watermarks to pages.

* How to add watermarks.

* How to specify watermark settings.

* How to use pre-printed forms.

![eurd-win-add-watermarks-result](../../../../images/eurd-win-add-watermarks-result.png)

## <a name="addwatermark"></a>Add a Watermark to a Report
To add a watermark to a report, do the following.

1. Switch to the [toolbar](../report-designer-tools/toolbar.md)'s **Page** page and press **Watermark**.
Switch to the [toolbar](../report-designer-tools/toolbar.md)'s **Page** page and press **Watermark**.

![eurd-win-add-watermarks-use-toolbox](../../../../images/eurd-win-add-watermarks-use-toolbox.png)
2. In the invoked **Watermark** dialog, select either the **Text Watermark** or **Picture Watermark** tab, depending on the type of watermark you wish to add.

For a text watermark, specify the text, direction and font options.

![eurd-win-watermark-editor](../../../../images/eurd-win-watermark-editor.png)
![eurd-win-add-watermarks-use-toolbox](../../../../images/eurd-win-add-watermarks-use-toolbox.png)

In the invoked **Watermark** dialog, select either the **Text Watermark** or **Picture Watermark** tab, depending on the type of watermark you wish to add.

## Specify Text Watermark Settings

Specify the following settings:

For a picture watermark, you need to specify an image. To do this, click the ellipsis button for the **Load image** option.
![eurd-win-watermark-editor](../../../../images/eurd-win-watermark-editor.png)

![eurd-win-watermark-editor-picture](../../../../images/eurd-win-watermark-editor-picture.png)
* Text

The watermark’s text.

* Direction

The incline of the watermark’s text.

* Font

The font of the watermark’s text.

* Color

The foreground color of the watermark’s text.

* Size

The size of the watermark’s text.

* Bold

Formats the watermark’s text as bold.

* Italic

Formats the watermark’s text as italic.

* Position

Specifies whether a watermark should be printed behind or in front of page content.

* Transparency

The transparency of the watermark’s text.

* Id

The unique identifier of a watermark used to specify the watermark in the WatermarkId property (See the Manage Watermark Collection section for details).

* Page Range

The range of pages which contain a watermark.

Click **OK** to add a watermark to the watermark collection. The added watermark is automatically displayed in the report in Preview mode.

> [!NOTE]
> A report can display only one watermark on a report page.
## Specify Picture Watermark Settings

Specify an image. Click the **Load image** option’s **Browse** button.

![eurd-win-watermark-editor-picture](../../../../images/eurd-win-watermark-editor-picture.png)

In the invoked **Select Picture** dialog, select the file containing the image that you wish to use as a watermark and click **Open**. Next, specify the size mode and alignment options for the picture.
In the invoked **Select Picture** dialog, select the file containing the image that you wish to use as a watermark and click **Open**.

Additionally, for both textual and picture watermarks, you can adjust the transparency, position (in front of or behind the document content), and the page range in which the watermark will be printed.
![eud-select-picture-dialog](../../../../images/eud-select-picture-dialog.png)

Specify the following picture options:

![eud-specify-picture-watermark-settings](../../../../images/eud-specify-picture-watermark-settings.png)

* Size Mode

The mode in which a picture watermark is displayed.

* Tiling

Specifies whether a picture watermark should be tiled.

* Horizontal Alignment

> [!NOTE]
> The **Transparency** property is unavailable when you specify an SVG image.
Specifies the horizontal alignment of the watermark.

* Vertical Alignment

Specifies the vertical alignment of the watermark.

* Position

Specifies whether a watermark should be printed behind or in front of page content.

* Transparency

The transparency of the watermark’s image. The **Transparency** property is unavailable when you specify an SVG image.

* Id

The unique identifier of a watermark used to specify the watermark in the WatermarkId property (See the Manage Watermark Collection section for details).

* Page Range

The range of pages which contain a watermark.

> [!NOTE]
> A report can display only one watermark on a report page.
Click **OK** to add a watermark to the watermark collection. The added watermark is automatically displayed in the report in Preview mode.

### <a name="preprintedform"></a>Supply a Preprinted Form

## <a name="preprintedform"></a>Supply a Preprinted Form
You can use a picture watermark as a template, to display an image of the preprinted form on the report's body at design time.

To display a watermark at design time, switch to the [toolbar](../report-designer-tools/toolbar.md)'s **View** page and activate **Watermark**.
Expand All @@ -43,4 +141,71 @@ The following image illustrates a report with a watermark shown at design-time t

Place report controls on the report's body according to the layout of the preprinted form.

![eurd-win-add-a-template-watermark-result](../../../../images/eurd-win-add-a-template-watermark-result.png)
![eurd-win-add-a-template-watermark-result](../../../../images/eurd-win-add-a-template-watermark-result.png)

### Supported Image Formats

A picture watermark supports the following formats:

* BMP
* JPG / JPEG / JPE / JFIF
* GIF
* TIF / TIFF
* PNG
* ICO
* DIB
* RLE
* EMF / WMF
* SVG

## Combine Text and a Picture in One Watermark

You can display both text and a picture in one watermark.

For example, create a watermark and specify its text and picture settings.

Set position of the text to In front:

![Position In front](../../../../images/infront-text-position.png)

Set position of the picture to Behind:

![Position Behind](../../../../images/behind-image-position.png)

As a result, the image is displayed behind the table, while the text is in front of the content:

![Display text and image watermarks in one page](../../../../images/watermark-text-infront-image-behind.png)

## Display a Specific Watermark in a Report

**Watermark Id** allows you to specify a watermark from the collection to display in the report. This property has a priority over the watermark’s **Page Range** property.

Create two watermarks in the Watermarks collection editor.

![Create two watermarks](../../../../images/add-watermarks-in-the-collection-editor.png)

Set Watermark Id to Watermark2 (the Id option's value)

![Display the second watermark in the collection](../../../../images/propery-grid-watermark-id.png)

The image below shows the result.

![Display specific watermark](../../../../images/display-specific-watermark-example.png)

## Display Watermarks According to the Specified Condition

Bind **Watermark Id** to an expression to apply watermarks stored in the collection to specific report pages.

Create the “First page watermark”, “Even page watermark”, and “Odd page watermark” watermarks with the following settings:

![Create three watermarks](../../../../images/bind-watermarks-to-expression--ui.png)

Specify the expression in the report’s WatermarkId property:

`Iif([Arguments.PageIndex]=0,'Watermark_0',Iif([Arguments.PageIndex]%2=0,'Watermark_1','Watermark_2'))`

![Specify the binding expression](../../../../images/specify-watermark-expression-in-the-expression-editor.png)

The image below shows the result.

![Display different watermarks](../../../../images/watermarks-expression-example.png)
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ title: Provide Interactivity
The documents in this section provide information on the interactive features that enable report customization in Print Preview.

* [Create Drill-Down Reports](provide-interactivity/create-drill-down-reports.md)
* [Create Drill-Through Reports](provide-interactivity/create-drill-through-reports.md)
* [Sort a Report in Print Preview](provide-interactivity/sort-a-report-in-print-preview.md)
* [Content Editing in Print Preview](provide-interactivity/edit-content-in-print-preview.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Create Drill-Through Reports
---
# Create Drill-Through Reports

Follow this tutorial to create a _drill-through report_ (a user can click a Category entry to invoke a detail report with Products). This report type keeps the original report compact while still allowing access to more detailed information.

The tutorial involves two main steps:

- Add a master-detail relationship between "Categories" and "Products" reports within one project.
- Use detail report parameters to filter records based on the selected category.

![Drill-Through report](../../../../images/drill-through-result.png)

## Add a Master-Detail Relationship between Reports

Define a master-detail relationship between _Category_ and _Product_ reports within a single project:

- Select the XRControl's element (**Table Cell** in this example) in the main report.
- Set its **Action** property to **NavigateToReportAction**.
- Assign the **ReportSource** property to a detail report instance.

![Specify the Navigate to Report action](../../../../images/specify-navigate-to-report-action.png)

If you switch to **Preview**, you can click on a _Category_ value in the table. The **Preview** window navigates to the detail report that contains all _Product_ entries. The next step explains how to filter this list.

![Drill-Through report preview](../../../../images/detail-report-navigation.png)

A Breadcrumb control automatically appears below the Document Viewer toolbar and allows you to navigate back to the original report.

![Breadcrumb navigation](../../../../images/breadcrumb-control-navigation.png)

## Specify Parameter Binding to Display Required Data

You can specify parameters during detail report navigation. Use the **Parameter Bindings** property to limit displayed records (such as products) to a selected category.

To invoke the **Parameter Binding Collection Editor**, click the ellipsis button in the **Parameter Bindings** property. Within this editor, click the **Sync** button to automatically obtain detail report parameters and set **Binding** to the data field or parameter of the original report.

![Parameter Binding Collection Editor](../../../../images/parameter-binding-editor.png)

Set **Binding** to the _CategoryID_ field.

![Specify Parameter Binding](../../../../images/specify-binding.png)

Set the following filter string in the detail report to display product records for the selected category.

![Set filter string](../../../../images/set-filter-string.png)

## Result

Switch to **Preview** and click on a category entry in the master report. The **Preview** navigates to the detail report that displays only products related to the selected category.

![Drill-Through report](../../../../images/drill-through-result.png)
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This topic lists the functions that you can use in an [expression](expressions-o
| Avg(Value) | Evaluates the average of the values in the collection. | [Products].Avg([UnitPrice]) |
| Count() | Returns the number of objects in a collection. | [Products].Count() |
| Exists() | Determines whether the object exists in the collection. | [Categories][[CategoryID] == 7].Exists() |
| Join() | Concatenates all Expression values in the _Collection_ based on the specified _Condition_ (optional) into a single string separated by the specified _Separator_ (optional). If you do not specify a _Separator_, the function uses a comma.<br>The function has the following overloads:<br>`[Collection][Condition].Join(Expression)`<br>`[Collection][Condition].Join(Expression, Separator)`| The following expression concatenates _CompanyName_ field values within a report grouped by the _CategoryID_ field into a single string separated by a semicolon:<br>`[][[CategoryID] == [^.CategoryID]].Join([CompanyName], ';')`|
| Max(Value) | Returns the maximum expression value in a collection. | [Products].Max([UnitPrice]) |
| Min(Value) | Returns the minimum expression value in a collection. | [Products].Min([UnitPrice]) |
| Single() | Returns an object if it is the only element in a collection. | [Accounts].Single() is not null |
Expand Down
Loading

0 comments on commit 01a68f9

Please sign in to comment.