diff --git a/ai-coding-assistant/mcp-server.md b/ai-coding-assistant/mcp-server.md index 68cddb971..29abe1fc2 100644 --- a/ai-coding-assistant/mcp-server.md +++ b/ai-coding-assistant/mcp-server.md @@ -60,16 +60,16 @@ An active Telerik Reporting license is required to use the Telerik Reporting MCP - When installing the MCP server by using the .NET tooling (`dnx` or `dotnet tool install`), the [license key file](slug:license-key) will be retrieved automatically if it is present in the default directory on your system (**%AppData%\Telerik\telerik-license.txt** on Windows and **~/.telerik/telerik-license.txt** on Linux). - When using the .NET tooling, if your [license key file](slug:license-key) is not in the default directory, you can add the [license key file](slug:license-key) as an environment variable in the `mcp.json` file using one of the following options: - ```JSON Path - "env": { - "TELERIK_LICENSE_PATH": "THE_PATH_TO_YOUR_LICENSE_FILE" - } - ``` - ```JSON Inline - "env": { - "TELERIK_LICENSE": "YOUR_LICENSE_KEY_HERE" - } - ``` + ```JSON Path + "env": { + "TELERIK_LICENSE_PATH": "THE_PATH_TO_YOUR_LICENSE_FILE" + } + ``` + ```JSON Inline + "env": { + "TELERIK_LICENSE": "YOUR_LICENSE_KEY_HERE" + } + ``` > tip Using a license file path is _recommended_ unless you are sharing settings across different systems. Remember to [update the license key](slug:license-key#updating-your-license-key) when renewing. @@ -83,59 +83,59 @@ The Telerik Reporting MCP server is available as a NuGet package: https://www.nu ### Automatic Configuration through the Visual Studio UI 1. Open the Configure MCP server menu in Visual Studio - - Open the [Visual Studio GitHub Copilot Chat](https://learn.microsoft.com/en-us/visualstudio/ide/visual-studio-github-copilot-get-started?view=vs-2022) - - Click on the button at the bottom right corner to open the _Select tools_ context menu. - - Click on the `+` button at the top right corner of the menu to open the _Configure MCP server_ menu. - - ![Steps to open the Configure MCP server menu in the Visual Studio GitHub Copilot Chat](images/vs-autoinstall-open-mcp-configuration-menu.png) + - Open the [Visual Studio GitHub Copilot Chat](https://learn.microsoft.com/en-us/visualstudio/ide/visual-studio-github-copilot-get-started?view=vs-2022) + - Click on the button at the bottom right corner to open the _Select tools_ context menu. + - Click on the `+` button at the top right corner of the menu to open the _Configure MCP server_ menu. + + ![Steps to open the Configure MCP server menu in the Visual Studio GitHub Copilot Chat](images/vs-autoinstall-open-mcp-configuration-menu.png) 1. Use the following values for the configuration fields: - - In `Destination` select either _Global-Available in all solutions_ or _Solution-Available in this solution_. - - For `Server ID` use _telerik-reporting-assistant_. - - Select _stdio_ as `Type`. - - The `Command (with optional arguments)` field should contain _dnx Telerik.Reporting.MCP --yes_. - - Click on the `Save` button to preserve the configuration. - - ![Steps to configure the MCP server in the Visual Studio](images/vs-autoinstall-configure-mcp-server.png) + - In `Destination` select either _Global-Available in all solutions_ or _Solution-Available in this solution_. + - For `Server ID` use _telerik-reporting-assistant_. + - Select _stdio_ as `Type`. + - The `Command (with optional arguments)` field should contain _dnx Telerik.Reporting.MCP --yes_. + - Click on the `Save` button to preserve the configuration. + + ![Steps to configure the MCP server in the Visual Studio](images/vs-autoinstall-configure-mcp-server.png) 1. Enable the `telerik-reporting-assistant` tool in the [Copilot Chat window's tool selection dropdown](https://learn.microsoft.com/en-us/visualstudio/ide/mcp-servers?view=vs-2022#configuration-example-with-github-mcp-server). - The `telerik-reporting-assistant` tool should now appear in the _Select tools_ context menu. Check it to enable the Telerik Reporting AI Coding Assistant: - - ![Enable the just added `telerik-reporting-assistant` tool in the Visual Studio](images/vs-autoinstall-enable-reporting-assistant.png) + The `telerik-reporting-assistant` tool should now appear in the _Select tools_ context menu. Check it to enable the Telerik Reporting AI Coding Assistant: + + ![Enable the just added `telerik-reporting-assistant` tool in the Visual Studio](images/vs-autoinstall-enable-reporting-assistant.png) ### Manual Configuration The steps below describe the sample procedure for configuring the Telerik Reporting MCP server in Visual Studio. 1. Add an `.mcp.json` file to either of the following locations: - - For a workspace-specific setup, add the file to the solution's folder. - - For a global setup, add the file to your user directory, `%USERPROFILE%` (for example, `C:\Users\YourName\.mcp.json`). + - For a workspace-specific setup, add the file to the solution's folder. + - For a global setup, add the file to your user directory, `%USERPROFILE%` (for example, `C:\Users\YourName\.mcp.json`). 1. Add the following configuration to the `.mcp.json` file: - ```JSON .NET 10 - { - "servers": { - "telerik-reporting-assistant": { - "type": "stdio", - "command": "dnx", - "args": ["Telerik.Reporting.MCP", "--yes"] - } - } - } - ``` - ```JSON .NET 8/9 - { - "servers": { - "telerik-reporting-assistant": { - "type": "stdio", - "command": "dotnet", - "args": ["tool", "run", "telerik-reporting-assistant"] - } - } - } - ``` + ```JSON .NET 10 + { + "servers": { + "telerik-reporting-assistant": { + "type": "stdio", + "command": "dnx", + "args": ["Telerik.Reporting.MCP", "--yes"] + } + } + } + ``` + ```JSON .NET 8/9 + { + "servers": { + "telerik-reporting-assistant": { + "type": "stdio", + "command": "dotnet", + "args": ["tool", "run", "telerik-reporting-assistant"] + } + } + } + ``` 1. Restart Visual Studio. 1. Enable the `telerik-reporting-assistant` tool in the [Copilot Chat window's tool selection dropdown](https://learn.microsoft.com/en-us/visualstudio/ide/mcp-servers?view=vs-2022#configuration-example-with-github-mcp-server). @@ -173,8 +173,8 @@ The `Add/Update GitHub Copilot Instructions` option is visible only if you have After configuration and restart: 1. Open Copilot Chat. -2. Enable the `telerik-reporting-assistant` tool. -3. Grant permissions when prompted (_per session, workspace, or always_). +1. Enable the `telerik-reporting-assistant` tool. +1. Grant permissions when prompted (_per session, workspace, or always_). ![An image demonstrating how to allow the usage of the Telerik Reporting MCP tool in the VS Copilot Chat](images/mcp-images/vs-allow-reporting-mcp-tool.png) @@ -192,38 +192,38 @@ The basic setup in Visual Studio Code involves the following steps: 1. Enable [`chat.mcp.enabled`](vscode://settings/chat.mcp.enabled) in Visual Studio Code settings. 1. Create `.vscode/mcp.json` in your workspace root (or user folder for global setup). -The settings below allow you to use the `#telerik-reporting-assistant` handle to call the Telerik Reporting MCP server. To use a custom handle, change the server name in the `mcp.json`. + The settings below allow you to use the `#telerik-reporting-assistant` handle to call the Telerik Reporting MCP server. To use a custom handle, change the server name in the `mcp.json`. -```JSON .NET 10 -{ - "servers": { - "telerik-reporting-assistant": { - "type": "stdio", - "command": "dnx", - "args": ["Telerik.Reporting.MCP", "--yes"] + ```JSON .NET 10 + { + "servers": { + "telerik-reporting-assistant": { + "type": "stdio", + "command": "dnx", + "args": ["Telerik.Reporting.MCP", "--yes"] + } } } -} -``` -```JSON .NET 8/9 -{ - "servers": { - "telerik-reporting-assistant": { - "type": "stdio", - "command": "dotnet", - "args": ["tool", "run", "telerik-reporting-assistant"] + ``` + ```JSON .NET 8/9 + { + "servers": { + "telerik-reporting-assistant": { + "type": "stdio", + "command": "dotnet", + "args": ["tool", "run", "telerik-reporting-assistant"] + } } } -} -``` + ``` 1. For global discovery, enable [`chat.mcp.discovery.enabled`](vscode://settings/chat.mcp.discovery.enabled) in `settings.json`: - ```JSON - { - "chat.mcp.discovery.enabled": true - } - ``` + ```JSON + { + "chat.mcp.discovery.enabled": true + } + ``` 1. Restart Visual Studio Code. @@ -269,9 +269,9 @@ To use the Telerik Reporting MCP Server: 1. Choose your preferred mode and model.
At the time of publishing, **Claude Sonnet 4** and **GPT-5** produce optimal results. 1. Start your prompt with `#telerik-reporting-assistant` (or with '#' followed by your [custom MCP server name](#configuration), if set): 1. Inspect the output and verify that the MCP server is used. Look for messages similar to the ones below: - - Visual Studio: `Running telerik-reporting-assistant` - - Visual Studio Code: `Running telerik-reporting-assistant` - - Cursor: `Calling MCP tool telerik-reporting-assistant` + - Visual Studio: `Running telerik-reporting-assistant` + - Visual Studio Code: `Running telerik-reporting-assistant` + - Cursor: `Calling MCP tool telerik-reporting-assistant` 1. If the Telerik Reporting MCP server is not used even though it's installed and enabled, double-check the server name in your configuration and try rephrasing your prompt. 1. If requested, grant the Telerik Reporting MCP Server permissions to run for this session, workspace, or always. diff --git a/designing-reports/connecting-to-data/data-items/how-to-nest-a-graph-item-in-a-table-item.md b/designing-reports/connecting-to-data/data-items/how-to-nest-a-graph-item-in-a-table-item.md index 7ebce489c..aa4a17b43 100644 --- a/designing-reports/connecting-to-data/data-items/how-to-nest-a-graph-item-in-a-table-item.md +++ b/designing-reports/connecting-to-data/data-items/how-to-nest-a-graph-item-in-a-table-item.md @@ -26,22 +26,7 @@ We will use the **AdventureWorks** sample database and the [Telerik Report Desig 1. Cancel the Telerik Report Wizard, because it would not be needed for the current example. 1. Start the CrossTab Wizard and create a new SqlDataSource with the following select statement: - ```SQL - SELECT - C.FirstName + ' ' + COALESCE (C.MiddleName, '') + ' ' + C.LastName AS SalesPersonName - , YEAR(SOH.OrderDate) as OrderYear - , PC.Name as CategoryName - FROM - Sales.SalesPerson AS SP - INNER JOIN Sales.SalesOrderHeader AS SOH ON SOH.SalesPersonID = SP.SalesPersonID - INNER JOIN Sales.SalesOrderDetail AS SOD ON SOD.SalesOrderID = SOH.SalesOrderID - INNER JOIN Production.Product AS P ON P.ProductID = SOD.ProductID - INNER JOIN Production.ProductSubcategory AS PSC ON PSC.ProductSubcategoryID = P.ProductSubcategoryID - INNER JOIN Production.ProductCategory AS PC ON PC.ProductCategoryID = PSC.ProductCategoryID - INNER JOIN HumanResources.Employee AS E ON E.EmployeeID = SP.SalesPersonID - INNER JOIN Person.Contact AS C ON C.ContactID = E.ContactID - ``` - + {{source=CodeSnippets\CS\SQL\SelectSalesPersonByYear.sql}} 1. On the following page add the **SalesPersonName** field to the **RowGroups** box, **OrderYear** to the **Column Groups** box and the **CategoryName** field to the **Detail Values** box, where it will be automatically changed to **Count(CategoryName)**. After the wizard ends, you can make some design adjustments to the generated crosstab to make it look better. 1. Set the row group's **Filters** to `"Count(Fields.CategoryName) Top N =5"`. Your group properties should now be set like this: diff --git a/designing-reports/connecting-to-data/data-items/how-to-use-the-reportitem.dataobject-property-in-expressions.md b/designing-reports/connecting-to-data/data-items/how-to-use-the-reportitem.dataobject-property-in-expressions.md index 0a5e173b7..3d213ccf2 100644 --- a/designing-reports/connecting-to-data/data-items/how-to-use-the-reportitem.dataobject-property-in-expressions.md +++ b/designing-reports/connecting-to-data/data-items/how-to-use-the-reportitem.dataobject-property-in-expressions.md @@ -55,12 +55,7 @@ When complicated logic should be applied or.NET framework routines need to be ut 1. Add an SqlDataSource connected to **AdventureWorks** sample database and set it as a report's datasource. 1. Put the following text in the SqlDataSource's SelectCommand value: - ```SQL - select Contact.* - from Person.Contact - where Contact.AdditionalContactInfo is not null - ``` - + {{source=CodeSnippets\CS\SQL\SelectContactsWithAdditionalInfo.sql}} 1. Place two textboxes on your report’s detail section. 1. Set the first textbox's expression to @@ -93,13 +88,7 @@ The following screenshot shows the expected report output that should be created 1. Create or open an existing report. 1. Add an SqlDataSource as a report's DataSource and set its SelectCommand property to: - ```SQL - select top 100 Product.Name, Product.ProductNumber, Product.Color, Product.SafetyStockLevel - from Production.Product - where Product.Color is not null - order by Product.Name, Product.Color - ``` - + {{source=CodeSnippets\CS\SQL\SelectTop100ColoredProducts.sql}} 1. Place two textboxes on your report's detail section and set their expressions to `= Fields.Name` diff --git a/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/connecting-the-cubedatasource-component-to-an-olap-database.md b/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/connecting-the-cubedatasource-component-to-an-olap-database.md index 3515e5a2d..222bcecff 100644 --- a/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/connecting-the-cubedatasource-component-to-an-olap-database.md +++ b/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/connecting-the-cubedatasource-component-to-an-olap-database.md @@ -1,4 +1,4 @@ ---- +--- title: Connecting to OLAP Database page_title: Connecting CubeDataSource to OLAP Database description: "Learn how to use the configured Telerik Reporting CubeDataSource component to connect to an OLAP database." @@ -21,16 +21,7 @@ The sample code below illustrates how to connect a `CubeDataSource` component to Instead of setting connection strings as property settings in the __CubeDataSource__ object, you can store them centrally as part of your application's configuration settings using the `connectionStrings` configuration element. This enables you to manage connection strings independently of your reports, including encrypting them using __Protected Configuration__. The following example shows how to connect to the __Adventure Works DW 2008R2__ sample database using a connection string which stored in the `connectionStrings` configuration element named __MyAdventureWorksDW__: -````XML - - - - - -```` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\CubeDataSourceConfiguration.xml region=CubeDataSourceConfiguration}} When the connection string is stored in the configuration file you need to specify the name of the configuration element as a value for the `ConnectionString` property of the `CubeDataSource` component: {{source=CodeSnippets\CS\API\Telerik\Reporting\CubeDataSourceSnippets.cs region=ConnectionNameSnippet}} diff --git a/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/selecting-data-from-an-olap-cube-with-the-cubedatasource-component.md b/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/selecting-data-from-an-olap-cube-with-the-cubedatasource-component.md index 622bb9d80..eb62962de 100644 --- a/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/selecting-data-from-an-olap-cube-with-the-cubedatasource-component.md +++ b/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/selecting-data-from-an-olap-cube-with-the-cubedatasource-component.md @@ -16,13 +16,7 @@ You can specify an __MDX__ query for the `CubeDataSource` component to execute b The following example demonstrates an __MDX__ query that retrieves a result set consisting of product sales grouped by category and subcategory: -````SQL -select non empty { [Measures].[Sales Amount] } on columns, - non empty { [Product].[Category].[Category] * - [Product].[Subcategory].[Subcategory] } on rows -from [Adventure Works] -```` - +{{source=CodeSnippets\CS\SQL\MdxSalesAmountByCategory.sql}} The next code sample illustrates how to set the `ConnectionString` and `SelectCommand` properties of a `CubeDataSource` component to retrieve the data from the above __MDX__ query: {{source=CodeSnippets\CS\API\Telerik\Reporting\CubeDataSourceSnippets.cs region=SelectCommandSnippet}} diff --git a/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/specifying-query-parameters-with-the-cubedatasource-component.md b/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/specifying-query-parameters-with-the-cubedatasource-component.md index 4e5df09a1..6c5b03462 100644 --- a/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/specifying-query-parameters-with-the-cubedatasource-component.md +++ b/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/specifying-query-parameters-with-the-cubedatasource-component.md @@ -18,14 +18,7 @@ The `CubeDataSource` component supports parameterized __MDX__ queries by associa When creating a parameterized query, you identify the parameter name by prefixing the name with the *"@"* character. For example, *"@Year"* would be a valid parameter name. __MDX__ supports only parameters for literal or scalar values. To create a parameter that references a member, set, or tuple, you would have to use a function such as __StrToMember__ or __StrToSet__. To illustrate this, let us define a simple __MDX__ query that selects product sales grouped by category and subcategory, and define a slicing axis by year, where the chosen year is specified as a parameter. Since the *"@Year"* parameter is passed as a string literal value, we need to use the __StrToMember__ function to convert that value to a valid member of the cube as shown below: -````SQL -select non empty { [Measures].[Sales Amount] } on columns, - non empty { [Product].[Category].[Category] * - [Product].[Subcategory].[Subcategory] } on rows -from [Adventure Works] -where StrToMember(@Year) -```` - +{{source=CodeSnippets\CS\SQL\MdxSalesAmountFilterByMember.sql}} The following code sample illustrates how to pass a value to the *"@Year"* parameter of the query using the `Parameters` collection of the `CubeDataSource` component: {{source=CodeSnippets\CS\API\Telerik\Reporting\CubeDataSourceSnippets.cs region=SingleValueParameterSnippet}} @@ -33,14 +26,7 @@ The following code sample illustrates how to pass a value to the *"@Year"* param When you need to pass multiple values as a single parameter to the query, use the __StrToSet__ function instead. For example, to pass several years for the slicing axis at once, we can modify the previous query as shown below: -````SQL -select non empty { [Measures].[Sales Amount] } on columns, - non empty { [Product].[Category].[Category] * - [Product].[Subcategory].[Subcategory] } on rows -from [Adventure Works] -where StrToSet(@Year) -```` - +{{source=CodeSnippets\CS\SQL\MdxSalesAmountFilterBySet.sql}} Now it is possible to assign an array of years to the data source parameter: {{source=CodeSnippets\CS\API\Telerik\Reporting\CubeDataSourceSnippets.cs region=MultiValueParameterSnippet}} diff --git a/designing-reports/connecting-to-data/data-source-components/entitydatasource-component/retrieving-data-from-an-entity-data-model-with-the-entitydatasource-component.md b/designing-reports/connecting-to-data/data-source-components/entitydatasource-component/retrieving-data-from-an-entity-data-model-with-the-entitydatasource-component.md index c94306521..5f2d2f223 100644 --- a/designing-reports/connecting-to-data/data-source-components/entitydatasource-component/retrieving-data-from-an-entity-data-model-with-the-entitydatasource-component.md +++ b/designing-reports/connecting-to-data/data-source-components/entitydatasource-component/retrieving-data-from-an-entity-data-model-with-the-entitydatasource-component.md @@ -37,12 +37,12 @@ Another common problem is related to the lazy loading feature of the [ADO.NET E The above expression relies upon the built-in lazy loading mechanism to obtain the `ProductSubcategory` entity for the current `Product` entity via the corresponding relation property, and then the `ProductCategory` entity for the current `ProductSubcategory` entity. While convenient, lazy loading requires additional round-trips to the database for the entities that are not present in memory. If this happens frequently it might significantly impact the performance of the report. To overcome this you can try performing eager loading of the entities instead. For example, the following statement uses the Include method to preload the `ProductSubcategory` and the `ProductCategory` entities while retrieving the `Product` entities: -````C# +```C# this.Products.Include("ProductSubcategory").Include("ProductSubcategory.ProductCategory").ToList(); -```` -````VB +``` +```VB.NET Me.Products.Include("ProductSubcategory").Include("ProductSubcategory.ProductCategory").ToList() -```` +``` However in certain scenarios eager loading might be costly too. Given the previous example, we materialize all `ProductSubcategory` and `ProductCategory` entities only to show the category name of each product. This means a lot of unnecessary data is downloaded from database just to be discarded later. The most flexible and efficient method for retrieving data from the __Entity Data Model__ is to execute a custom query against the entities. The following sample method uses a __LINQ__ query to obtain only the necessary data for the report and then packs it into a collection of __POCOs:__ @@ -53,4 +53,3 @@ The sample code that binds the EntityDataSource component to that method is show {{source=CodeSnippets\CS\API\Telerik\Reporting\EntityDataSourceSnippets.cs region=LinqBindingSnippet}} {{source=CodeSnippets\VB\API\Telerik\Reporting\EntityDataSourceSnippets.vb region=LinqBindingSnippet}} - diff --git a/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/connecting-the-sqldatasource-component-to-a-data-source.md b/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/connecting-the-sqldatasource-component-to-a-data-source.md index baf2247b4..8a6a4687a 100644 --- a/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/connecting-the-sqldatasource-component-to-a-data-source.md +++ b/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/connecting-the-sqldatasource-component-to-a-data-source.md @@ -1,4 +1,4 @@ ---- +--- title: Connecting to a Data Source page_title: Connect the SqlDataSource to Database description: "Learn how to set up the SqlDataSource component to connect to a Data Source in .NET Framework and in .NET Core through the configuration file and code." @@ -21,16 +21,7 @@ Instead of setting connection strings at design time as property settings in the The following example shows how to connect to the **SQL Server AdventureWorks** sample database using a connection string which stored in the `connectionStrings` configuration element named `MyAdventureWorksDB`: -```XML - - - - - -``` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\SqlDataSourceConfiguration.xml region=SqlDataSourceConfiguration}} .NET Framework applications use configuration files in XML format, while .NET Core and .NET applications usually have a JSON-based configuration file, called `appsettings.json`. The configuration of the connection strings section in .NET is explained in the following documentation article: [How to Host Reports Service in ASP.NET Core in .NET {{site.mindotnetversion}}](slug:how-to-host-reports-service-in-aspnet-core-in-net-6-with-minimal-api). When the connection string is stored in the configuration file, you need to specify the name of the configuration element as a value for the `ConnectionString` property of `SqlDataSource`. Specifying a value for the `ProviderName` property is no longer necessary, since that information is already present in the configuration element itself. @@ -40,8 +31,5 @@ When the connection string is stored in the configuration file, you need to spec The `SqlDataSource` component retrieves data using a SQL statement defined through the `SelectCommand` property. If the data source component connects to a database that supports stored procedures, you can specify the name of a stored procedure in place of the SQL statement. You can create parameterized commands that include placeholders for values to be supplied at run time. The following example shows a typical parameterized SQL select command: -```SQL -SELECT CustomerID, CompanyName FROM Customers WHERE City = @City -``` - +{{source=CodeSnippets\CS\SQL\SelectCustomersByCity.sql}} You can create parameter objects that specify where the command should get parameter values from at run time. You can also use expressions which values will be evaluated when processing the report or pass specific values programmatically. diff --git a/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/how-to-connect-to-a-sql-database.md b/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/how-to-connect-to-a-sql-database.md index 52925c2c6..4c94d7961 100644 --- a/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/how-to-connect-to-a-sql-database.md +++ b/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/how-to-connect-to-a-sql-database.md @@ -80,10 +80,7 @@ You can connect to a SQL database using the Telerik `SqlDataSource` component. T In this tutorial we will use the **Select Statement** option. Type the following SQL query: - ```SQL - SELECT * FROM [HumanResources].[Department] WHERE [HumanResources].[Department].[DepartmentID]=@ID - ``` - + {{source=CodeSnippets\CS\SQL\SelectDepartmentById.sql}} > If the SQL query returns more than one set of data, only the first result will be used. Test running the SQL query on the SQL server database to verify the syntax. 1. If the entered SQL query contains SQL parameters, recognizable by the.NET data provider, clicking the Next button will navigate you to the **Configure data source parameters** step. You should see listed the recognized SQL parameters and their DbType in a grid. In the Value column you can specify static value, report parameter, field, or other expression which once evaluated will be passed to the SQL query. diff --git a/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/selecting-data-with-the-sqldatasource-component.md b/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/selecting-data-with-the-sqldatasource-component.md index 9d5c53830..ea0bacdca 100644 --- a/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/selecting-data-with-the-sqldatasource-component.md +++ b/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/selecting-data-with-the-sqldatasource-component.md @@ -20,10 +20,7 @@ You can specify a SQL query for the `SqlDataSource` component to execute by sett The following example demonstrates a SQL query that retrieves a result set consisting of the names of all the persons in the `Contact` table from the __AdventureWorks__ sample database: -````SQL -SELECT FirstName, LastName FROM Person.Contact; -```` - +{{source=CodeSnippets\CS\SQL\SelectContactFirstLastName.sql}} The following code example shows how to set the `ConnectionString` and `SelectCommand` properties of a `SqlDataSource` component to retrieve the data from the above SQL query: {{source=CodeSnippets\CS\API\Telerik\Reporting\SqlDataSourceSnippets.cs region=SelectCommandSnippet}} @@ -31,12 +28,7 @@ The following code example shows how to set the `ConnectionString` and `SelectCo If the database you are working with supports stored procedures, you can set the `SelectCommand` property to the name of an existing stored procedure and the `SelectCommandType` property to `StoredProcedure` to indicate that the `SelectCommand` property refers to a stored procedure. The following example demonstrates a simple stored procedure that you can create in SQL Server: -````SQL -CREATE PROCEDURE GetAllContacts AS -SELECT FirstName, LastName FROM Person.Contact; -GO -```` - +{{source=CodeSnippets\CS\SQL\GetAllContactsProcedure.sql}} To configure the `SqlDataSource` component to use this stored procedure, set the `SelectCommand` text to *"GetAllContacts"* and the `SelectCommandType` property to `StoredProcedure`: {{source=CodeSnippets\CS\API\Telerik\Reporting\SqlDataSourceSnippets.cs region=StoredProcedureSnippet}} diff --git a/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/using-parameters-with-the-sqldatasource-component.md b/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/using-parameters-with-the-sqldatasource-component.md index 8bd21bff2..e04916a35 100644 --- a/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/using-parameters-with-the-sqldatasource-component.md +++ b/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/using-parameters-with-the-sqldatasource-component.md @@ -26,10 +26,7 @@ The syntax used for the placeholders varies, depending on the type of the databa The `System.Data.SqlClient` provider supports named parameters as placeholders, as shown in the following example: -````SQL -SELECT * FROM Person.Contact WHERE FirstName = @FirstName AND LastName = @LastName -```` - +{{source=CodeSnippets\CS\SQL\SelectContactsByNamedParams.sql}} With named parameters, the order in which the parameters are specified in the command's parameters collection is not important. However, you must ensure that the parameter names that you use in your SQL command correspond to the names of the parameters in the associated collection. The following example shows how to use named parameters in an SQL command for a `SqlDataSource` component that uses the `System.Data.SqlClient` provider: {{source=CodeSnippets\CS\API\Telerik\Reporting\SqlDataSourceSnippets.cs region=NamedParametersSnippet}} @@ -39,10 +36,7 @@ With named parameters, the order in which the parameters are specified in the co The `System.Data.OleDb` and `System.Data.Odbc` providers support only positional parameters identified by the *'?'* character, as shown in the following example: -````SQL -SELECT * FROM Person.Contact WHERE FirstName = ? AND LastName = ? -```` - +{{source=CodeSnippets\CS\SQL\SelectContactsByPositionalParams.sql}} When you use the `System.Data.OleDb` and `System.Data.Odbc` providers with parameterized SQL query statements, the order in which you specify the parameter placeholders must match exactly the order of the parameter objects in the `Parameters` collection of the `SqlDataSource` component. Specifying names for the parameters in this case is only for informative purposes, these names are not used when binding the parameter values to the SQL query statement. The following example shows how to specify parameters for a `SqlDataSource` component that uses the `System.Data.OleDb` provider: diff --git a/designing-reports/connecting-to-data/expressions/extending-expressions/overview.md b/designing-reports/connecting-to-data/expressions/extending-expressions/overview.md index 1b8d4b056..b1f33d81c 100644 --- a/designing-reports/connecting-to-data/expressions/extending-expressions/overview.md +++ b/designing-reports/connecting-to-data/expressions/extending-expressions/overview.md @@ -1,4 +1,4 @@ ---- +--- title: Overview page_title: Extending Expressions Explained description: "Learn how to Extend the Expressions with custom User functions and User aggregate functions in Telerik Reporting." @@ -16,23 +16,7 @@ Expressions can easily be extended by providing user functions written in any .N In order to expose your custom functions, so they can be utilized by the Reporting engine, you have to add a reference to the assembly they are defined in. This can be done through the [assemblyReferences element](slug:telerikreporting/using-reports-in-applications/export-and-configure/configure-the-report-engine/assemblyreferences-element) in the application's configuration file. -````XML - - -
- - … - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\ExtendingExpressionsConfiguration.xml region=ExtendingExpressionsConfiguration}} ````JSON "telerikReporting": { "assemblyReferences": [ diff --git a/designing-reports/connecting-to-data/report-parameters/how-to-cascade-parameters-with-applied-filtering-on-data-source-level.md b/designing-reports/connecting-to-data/report-parameters/how-to-cascade-parameters-with-applied-filtering-on-data-source-level.md index 9db7070ac..0236b2b3c 100644 --- a/designing-reports/connecting-to-data/report-parameters/how-to-cascade-parameters-with-applied-filtering-on-data-source-level.md +++ b/designing-reports/connecting-to-data/report-parameters/how-to-cascade-parameters-with-applied-filtering-on-data-source-level.md @@ -18,18 +18,7 @@ To create cascading report parameters with applied filtering on data source leve 1. Using the [Data Source Wizard](slug:telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/data-source-wizards/datasource-wizard), bind the report to **SqlDataSource** with query: - ```SQL - SELECT - Production.Product.ProductNumber, Production.Product.Name AS ProductName, - Production.ProductSubcategory.Name AS SubcategoryName - FROM - Production.Product - INNER JOIN Production.ProductSubcategory - ON Production.Product.ProductSubcategoryID = Production.ProductSubcategory.ProductSubcategoryID - WHERE - (Production.Product.ProductSubcategoryID = @ProductSubcategoryID) - ``` - + {{source=CodeSnippets\CS\SQL\SelectProductsBySubcategoryParam.sql}} Note that there is a **WHERE** clause that filters the datasource based on the _ProductSubcategoryID_ parameter. 1. Click the **Next** button and the **"Configure Data Source Parameters"** step of the **SqlDataSource** appears. Set the **DbType** of the ProductSubcategoryID @@ -42,16 +31,7 @@ To create cascading report parameters with applied filtering on data source leve 1. Expand the **AvailableValues**. 1. Start the Data Source Wizard and set the DataSource for the parameter to the following query: - ```SQL - SELECT - ProductSubcategoryID, - Name AS SubcategoryName - FROM - Production.ProductSubcategory - WHERE - (ProductCategoryID = @ProductCategoryID) - ``` - + {{source=CodeSnippets\CS\SQL\SelectSubcategoriesByCategoryParam.sql}} Note that there is a **WHERE** clause that filters the datasource based on the _ProductSubcategoryID_ parameter. 1. Click the **Next** button and the **"Configure Data Source Parameters"** step of the **SqlDataSource** appears. Set the **DbType** of the **ProductCategoryID** parameter to **Int32** and select "**New Report Parameter**" for the **Value**. @@ -63,14 +43,7 @@ To create cascading report parameters with applied filtering on data source leve 1. Expand the AvailableValues. 1. Start the **Data Source Wizard** and set the DataSource for the parameter to the following query: - ```SQL - SELECT - ProductCategoryID, - Name AS CategoryName - FROM - Production.ProductCategory - ``` - + {{source=CodeSnippets\CS\SQL\SelectProductCategories.sql}} 1. Click **Next** and **Finish** the Data Source Wizard. 1. Set the DisplayMember to **= Fields.CategoryName** column. 1. Set the ValueMember to **= Fields.ProductCategoryID**. diff --git a/designing-reports/connecting-to-data/report-parameters/how-to-cascade-parameters-with-applied-filtering-on-report-level.md b/designing-reports/connecting-to-data/report-parameters/how-to-cascade-parameters-with-applied-filtering-on-report-level.md index 7230fa286..f5117282c 100644 --- a/designing-reports/connecting-to-data/report-parameters/how-to-cascade-parameters-with-applied-filtering-on-report-level.md +++ b/designing-reports/connecting-to-data/report-parameters/how-to-cascade-parameters-with-applied-filtering-on-report-level.md @@ -16,18 +16,7 @@ To create cascading report parameters with applied filtering on report level fol 1. Using the [DataSource Wizard](slug:telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/data-source-wizards/datasource-wizard), bind the report to SqlDataSource with query: - ```SQL - SELECT - Production.Product.ProductNumber, - Production.Product.Name AS ProductName, - Production.Product.ProductSubcategoryID, - Production.ProductSubcategory.Name AS SubcategoryName - FROM - Production.Product - INNER JOIN Production.ProductSubcategory - ON Production.Product.ProductSubcategoryID = Production.ProductSubcategory.ProductSubcategoryID - ``` - + {{source=CodeSnippets\CS\SQL\SelectProductsWithSubcategoryName.sql}} 1. Click the ellipses on the **Report.ReportParameters** property. This invokes the **ReportParameter Collection editor**. 1. Add new Report Parameter. 1. **Name** it **ProductCategoryID**. @@ -35,14 +24,7 @@ To create cascading report parameters with applied filtering on report level fol 1. Expand the **AvailableValues**. 1. Set the **DataSource** using the **Data Source Wizard** to SqlDataSource with query: - ```SQL - SELECT - ProductCategoryID, - Name AS CategoryName - FROM - Production.ProductCategory - ``` - + {{source=CodeSnippets\CS\SQL\SelectProductCategories.sql}} 1. It is not compulsory to set the **DataMember** property when the data source contains only one table. 1. Set the **DisplayMember** to **= Fields.CategoryName** column. 1. Set the **ValueMember** to **= Fields.ProductCategoryID**. @@ -54,15 +36,7 @@ To create cascading report parameters with applied filtering on report level fol 1. Expand the **AvailableValues**. 1. Set the **DataSource** using the **Data Source Wizard** to SqlDataSource with query: - ```SQL - SELECT - ProductCategoryID, - ProductSubcategoryID, - Name AS SubcategoryName - FROM - Production.ProductSubcategory - ``` - + {{source=CodeSnippets\CS\SQL\SelectSubcategoriesAll.sql}} 1. It is not compulsory to set the **DataMember** property when the data source contains only one table. 1. Set the **DisplayMember** to **= Fields.SubcategoryName** column. 1. Set the **ValueMember** to **= Fields.ProductSubcategoryID**. diff --git a/designing-reports/connecting-to-data/report-parameters/using-multivalue-parameters.md b/designing-reports/connecting-to-data/report-parameters/using-multivalue-parameters.md index bb3816203..baa134661 100644 --- a/designing-reports/connecting-to-data/report-parameters/using-multivalue-parameters.md +++ b/designing-reports/connecting-to-data/report-parameters/using-multivalue-parameters.md @@ -29,19 +29,10 @@ The [Data Source Components](slug:telerikreporting/designing-reports/connecting- The example below shows the use of the IN keyword in the WHERE clause of a T-SQL statement. For more information about the IN keyword or the results returned by this query, see [IN (Transact-SQL)](https://learn.microsoft.com/en-us/previous-versions/sql/sql-server-2005/ms177682(v=sql.90)). -````SQL -SELECT ProductID, Name, Color -FROM Production.Product -WHERE ProductID IN (@ProductID) -```` - +{{source=CodeSnippets\CS\SQL\SelectProductsByMultiValueParam.sql}} To test the approach in a report, add [SqlDataSource Component](slug:telerikreporting/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/overview) using this query. Create a new report parameter and set it as the value for the _@ProductID__ data source parameter. Set its `MultiValue` and `Visible` properties to True, and its `Type` property to Integer. Using the `AvailableValues` properties, configure the DataSource for the parameter to a new [SqlDataSource Component](slug:telerikreporting/designing-reports/connecting-to-data/data-source-components/sqldatasource-component/overview) with the following query: -````SQL -SELECT ProductID, Name -FROM Production.Product -```` - +{{source=CodeSnippets\CS\SQL\SelectProductIdAndName.sql}} Set the `ValueMember` property to `= Fields.ProductID` and the `DisplayMember` property to `= Fields.Name`. Run the report and select different values for the report parameter in order to show a particular selection of data rows based on the selected report parameter values. >note The report engine rewrites queries for data sources that cannot process parameters as an array. The rewrite logic is triggered when a parameter is defined as multivalue and the database query uses an IN statement to specify the parameter. diff --git a/designing-reports/report-book/report-book-parameters.md b/designing-reports/report-book/report-book-parameters.md index aa1308533..c34e138ee 100644 --- a/designing-reports/report-book/report-book-parameters.md +++ b/designing-reports/report-book/report-book-parameters.md @@ -54,12 +54,12 @@ In the sample pictures below, you will see in a few steps how to set a value for * __When report parameters have unique names or the target parameters are merged:__ If a parameter is distinguishable by its Name property or the Name denotes several merged parameters, refer to the parameter directly by the value of its Name property. -{{source=CodeSnippets\CS\API\Telerik\Reporting\ReportSourceSnippets.cs region=Set_Values_For_Unique_Or_Mergable_ReportParameters_In_ReportSource_Snippet}} -{{source=CodeSnippets\VB\API\Telerik\Reporting\ReportSourceSnippets.vb region=Set_Values_For_Unique_Or_Mergable_ReportParameters_In_ReportSource_Snippet}} + {{source=CodeSnippets\CS\API\Telerik\Reporting\ReportSourceSnippets.cs region=Set_Values_For_Unique_Or_Mergable_ReportParameters_In_ReportSource_Snippet}} + {{source=CodeSnippets\VB\API\Telerik\Reporting\ReportSourceSnippets.vb region=Set_Values_For_Unique_Or_Mergable_ReportParameters_In_ReportSource_Snippet}} * __When report parameters have repeating names but they are not merged:__ In this case, you need to refer to the individual occurrence of the parameter in a particular report. This is done by denoting the target report by its zero-based index inside the report book. -{{source=CodeSnippets\CS\API\Telerik\Reporting\ReportSourceSnippets.cs region=Set_Values_For_NotMergable_ReportParameters_In_ReportSource_Snippet}} -{{source=CodeSnippets\VB\API\Telerik\Reporting\ReportSourceSnippets.vb region=Set_Values_For_NotMergable_ReportParameters_In_ReportSource_Snippet}} + {{source=CodeSnippets\CS\API\Telerik\Reporting\ReportSourceSnippets.cs region=Set_Values_For_NotMergable_ReportParameters_In_ReportSource_Snippet}} + {{source=CodeSnippets\VB\API\Telerik\Reporting\ReportSourceSnippets.vb region=Set_Values_For_NotMergable_ReportParameters_In_ReportSource_Snippet}} >note If you do not use the specified syntax and you refer to the report parameter directly by the `Name` property's value, the value will be set only for the _first_ occurrence of the report parameter in the report book. \ No newline at end of file diff --git a/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/configuration/extending-report-designer.md b/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/configuration/extending-report-designer.md index 4f479c565..a9614c582 100644 --- a/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/configuration/extending-report-designer.md +++ b/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/configuration/extending-report-designer.md @@ -1,4 +1,4 @@ ---- +--- title: Extending Report Designer page_title: Extending Report Designer at a Glance description: "Learn how to make the Telerik Reporting Standalone Designer recognize custom CLR public methods and properties to be used as User functions and ObjectDataSources." @@ -16,24 +16,7 @@ It is a common requirement to add your own [User Functions](slug:telerikreportin To expose your data, so it can be utilized by the Object/OpenAccess/Entity [data source components](slug:telerikreporting/designing-reports/connecting-to-data/data-source-components/overview), or extend the default behavior of the Telerik Reporting engine with custom User Functions, you have to use the [assemblyReferences Element](slug:telerikreporting/using-reports-in-applications/export-and-configure/configure-the-report-engine/assemblyreferences-element) of the Telerik.Reporting configuration section to reference your custom assembly: -````XML - - -
- - ... - - - - - - -```` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\ExtendingReportDesignerAssemblyConfiguration.xml region=ExtendingReportDesignerAssemblyConfiguration}} This can be achieved either by manually editing the configuration file or by using the Standalone Report Designer's **Options** page. ## Update the Designer Configuration File through the UI @@ -66,23 +49,7 @@ The section should be added to the designer configuration file, __Telerik.Report To instruct the Report Designer to look for assemblies in other locations as well, use the [`` Element](https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-2.0/823z9h8w(v=vs.80)). For more information, see [Locating the Assembly through Codebases or Probing](https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/15hyw9x3(v=vs.100)): -````XML - -... - - - - - - - - - - -... - -```` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\ExtendingReportDesignerProbingConfiguration.xml region=ExtendingReportDesignerProbingConfiguration}} ## See Also * [How to use external assemblies with custom CLR objects in the Report Designer](slug:how-to-use-external-assemblies-with-custom-clr-objects-in-the-report-designer) diff --git a/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/configuration/overview.md b/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/configuration/overview.md index a20bf48ae..2a91774e6 100644 --- a/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/configuration/overview.md +++ b/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/configuration/overview.md @@ -1,4 +1,4 @@ ---- +--- title: Overview page_title: Standalone Report Designer Configuration Overview description: "Learn how to configure the Standalone Report Designer in Telerik Reporting through its Configuration file." @@ -14,57 +14,18 @@ reportingArea: General The Telerik Report Designer application can be configured through its configuration file. Application configuration files contain settings specific to the application. This file contains configuration settings such as connectionStrings, traceListeners, assembly binding policy (for the .NET Framework version only), and so on. For example, this file can specify a global connection string that can be used by all reports created with the Report Designer: -```XML - - - -``` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\ReportDesignerConnectionStringsConfiguration.xml region=ReportDesignerConnectionStringsConfiguration}} or it can define Trace Listeners to log important information for troubleshooting: - For `.NET Framework` version this may be done in `system.diagnostics` section: - ```XML - - - - - - - - - ``` - + {{source=CodeSnippets\MvcCS\XmlConfiguration\ReportDesignerDiagnosticsConfiguration.xml region=ReportDesignerDiagnosticsConfiguration}} - For `.NET` version this may be done in `Telerik.Reporting` section: - ```XML - - - - - - - ``` - + {{source=CodeSnippets\MvcCS\XmlConfiguration\ReportDesignerTraceListenersConfiguration.xml region=ReportDesignerTraceListenersConfiguration}} In the .NET Framework version, it can hold binding redirect to the latest version of the Reporting engine: -```XML - - - - - - - - - - -``` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\ReportDesignerRuntimeConfiguration.xml region=ReportDesignerRuntimeConfiguration}} For more information, see [Application Configuration Files](). > The configuration files of all Standalone Report Designer versions use `UTF-8` encoding. Make sure that your text editor of choice does not override the default encoding when you modify these files, as this can prevent the designers from loading. @@ -73,111 +34,12 @@ For more information, see [Application Configuration Files]( - - -
-
- - - - - - - - - - - - - - - - - - - - - - - -``` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\ReportDesignerFullConfiguration.xml}} ## Default Configuration for the .NET 10 Standalone Report Designer The following code example shows the default `Telerik.ReportDesigner.Net.dll.config` file that is distributed with the Report Designer for .NET. A major difference with the designer for .NET Framework is that the Trace Listener for .NET is in the `Telerik.Reporting` section rather than in the `system.diagnostics` section as in .NET Framework. -```XML - - - -
-
- - - - - - - - - - - - - - - - -``` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\ReportDesignerConfigurationOverview_2.xml}} If you configure a custom Trace Listener, you need to provide in the `type` the Assembly Qualified Name of the Trace Listener type implementing the abstract class [System.Diagnostics.TraceListener](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracelistener?view=net-6.0). The assembly name _CustomListenersAssembly_ must be specified along with the full type name _CustomListenersNamespace.CustomListener_. You need also to copy the assembly in the designer's folder, by default **[InstallDir]/Report Designer/.NET**. You may use the Trace Listeners in `System.Diagnosics` like [System.Diagnostics.TextWriterTraceListener](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.textwritertracelistener?view=net-6.0) without the assembly name. The full type name _System.Diagnostics.TextWriterTraceListener_ is sufficient to discover and utilize the Trace Listener. diff --git a/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/configuration/report-designer-configuration.md b/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/configuration/report-designer-configuration.md index dcac25c39..d97c7fd0a 100644 --- a/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/configuration/report-designer-configuration.md +++ b/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/configuration/report-designer-configuration.md @@ -1,4 +1,4 @@ ---- +--- title: Configuration Sections page_title: Standalone Report Designer Configuration Sections Explained description: "Learn which are the configuration sections related to the Telerik Reporting Engine and Report Designer and what settings may be provided there." @@ -14,44 +14,15 @@ reportingArea: General The settings of the Telerik Reporting engine are defined in a custom configuration section called `Telerik.Reporting`. This section should be added to the Report Designer configuration file `Telerik.ReportDesigner.exe.config`: -````XML - - -
- - ... - -```` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\ReportDesignerReportingSectionConfiguration.xml region=ReportDesignerReportingSectionConfiguration}} Using this section, you can control particular aspects of the engine such as the available rendering extensions and the cache management system which is utilized by the viewers. For more information, see [Telerik Reporting Configuration Section](slug:telerikreporting/using-reports-in-applications/export-and-configure/configure-the-report-engine/overview). The Telerik Report Designer offers additional configuration through its own custom configuration section, called `Telerik.ReportDesigner`: -````XML - - -
- - ... - -```` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\ReportDesignerDesignerSectionConfiguration.xml region=ReportDesignerDesignerSectionConfiguration}} This section lets you specify the working directory of the Report Designer via a single attribute: -````XML - - -```` - - +{{source=CodeSnippets\MvcCS\XmlConfiguration\ReportDesignerElementConfiguration.xml region=ReportDesignerElementConfiguration}} ## See Also * [Configuration](slug:telerikreporting/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/configuration/overview) diff --git a/designing-reports/report-designer-tools/desktop-designers/tools/report-wizards/band-report-wizard/how-to-use-the-report-wizard-to-create-a-band-report.md b/designing-reports/report-designer-tools/desktop-designers/tools/report-wizards/band-report-wizard/how-to-use-the-report-wizard-to-create-a-band-report.md index 91844bf4f..7024dffab 100644 --- a/designing-reports/report-designer-tools/desktop-designers/tools/report-wizards/band-report-wizard/how-to-use-the-report-wizard-to-create-a-band-report.md +++ b/designing-reports/report-designer-tools/desktop-designers/tools/report-wizards/band-report-wizard/how-to-use-the-report-wizard-to-create-a-band-report.md @@ -36,15 +36,7 @@ To create a new report with this wizard: > The Query Builder is part of Visual Studio and is available only in the [Visual Studio Report Designer](slug:telerikreporting/designing-reports/report-designer-tools/desktop-designers/visual-studio-report-designer/overview). As of Telerik Reporting Q3 2014 SQL queries can be built in the Standalone Designer with the [Query Designer in the Standalone Designer](slug:telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/data-source-wizards/sqldatasource-wizard/query-designer-in-the-standalone-designer). If you are using the [Standalone Report Designer](slug:telerikreporting/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/overview) use the following select query and click Next: - ```SQL - SELECT Production.Product.Name, Production.Product.ProductNumber, Production.Product.ReorderPoint, - Production.ProductPhoto.ThumbNailPhoto, Production.ProductInventory.Quantity - FROM Production.Product - INNER JOIN Production.ProductInventory ON Production.Product.ProductID = Production.ProductInventory.ProductID - INNER JOIN Production.ProductProductPhoto ON Production.Product.ProductID = Production.ProductProductPhoto.ProductID - INNER JOIN Production.ProductPhoto ON Production.ProductProductPhoto.ProductPhotoID = Production.ProductPhoto.ProductPhotoID - ``` - + {{source=CodeSnippets\CS\SQL\SelectProductsForBandReport.sql}} - In the **Add Table** dialog select "Product", "ProductInventory", "ProductPhoto" and "ProductProductPhoto" from the list of tables. Note: You can hold down the control key and click each of the tables to select them all at one time. - Click the **Add** button to close the dialog. - On the **Query Builder** select the fields shown in the figure below. In the Product table select "Name", "ProductNumber" and "ReorderPoint". In ProductPhoto select the "ThumbNailPhoto" column. In the ProductInventory table select the "Quantity" column. diff --git a/designing-reports/report-designer-tools/web-report-designer/how-to-set-up-in-.net-framework-application.md b/designing-reports/report-designer-tools/web-report-designer/how-to-set-up-in-.net-framework-application.md index ef671dfca..cf230693c 100644 --- a/designing-reports/report-designer-tools/web-report-designer/how-to-set-up-in-.net-framework-application.md +++ b/designing-reports/report-designer-tools/web-report-designer/how-to-set-up-in-.net-framework-application.md @@ -92,78 +92,8 @@ The REST service works as a backend and is responsible for storage operations li 1. Navigate to `Views` -> `Home` and add a new CSHTML Page for the Web Report Designer. Name the file `Index.cshtml`. Add the required references to load the font, jQuery, Telerik Kendo UI libraries, telerikReportViewer, and webReportDesigner scripts listed in the example below. Finally, add the initialization of the telerik_WebReportDesigner widget. Note that the Web Report Designer container has a minimum width of 1200px. The complete report viewer page should look like this: - ````CSHTML - @using Telerik.Reporting - @{ - Layout = null; - } - - - - Telerik Web Report Designer Demo - - - - - -
- loading... -
- - - - - - - - ```` - ````VBHTML - @Imports Telerik.Reporting - @Code - Layout = Nothing - End Code - - - - Telerik Web Report Designer Demo - - - - - -
- loading... -
- - - - - - - - ```` + {{source=CodeSnippets\MvcCS\Views\Home\WebReportDesignerSetup.cshtml region=WebReportDesignerExample}} + {{source=CodeSnippets\MvcVB\Views\Home\WebReportDesignerSetup.vbhtml region=WebReportDesignerExample}} The *ReportDesignerController* we added above is configured to search for its reports in a sub-folder named `Reports`. The Report Designer widget we just configured will try to load a report named `SampleReport.trdp`. Add a new folder named `Reports` to the solution and add an existing report named `SampleReport.trdp` to it. diff --git a/designing-reports/report-designer-tools/web-report-designer/how-to-set-up-in-blazor-application.md b/designing-reports/report-designer-tools/web-report-designer/how-to-set-up-in-blazor-application.md index a708059d6..672c996bf 100644 --- a/designing-reports/report-designer-tools/web-report-designer/how-to-set-up-in-blazor-application.md +++ b/designing-reports/report-designer-tools/web-report-designer/how-to-set-up-in-blazor-application.md @@ -90,19 +90,11 @@ Alternatively, instead of using the item template, the Designer REST service and 1. Add NuGet package reference to the `Telerik.WebReportDesigner.Blazor` package hosted on the Progress Telerik proprietary NuGet feed. Make sure you have the needed NuGet feed added to the VS setting using the article [How to add the Telerik private NuGet feed to Visual Studio](slug:telerikreporting/using-reports-in-applications/how-to-add-the-telerik-private-nuget-feed-to-visual-studio). 1. Add JavaScript dependencies to the **head** element of the `Pages/_Host.cshtml` (Blazor Server) or `wwwroot/index.html` (Blazor WebAssembly), or `App.razor` (Blazor Web App): - ```HTML - - - - - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\WebReportDesignerSetUpInBlazorApplication.html region=WebReportDesignerAddingTheBlazorWebReportDesignerComponent}} 1. Add the dedicated `telerikWebReportDesignerInterop.js` dependency at the end of the **body** element of the `Pages/_Host.cshtml` (Blazor Server) or `wwwroot/index.html` (Blazor WebAssembly), or in `App Razor` (Blazor Web App): - ```HTML - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\WebReportDesignerSetUpInBlazorApplication.html region=WebReportDesignerAddingTheBlazorWebReportDesignerComponent2}} 1. Use the following snippet to place the designer component in a razor page like `Pages/Index.razor`. diff --git a/designing-reports/report-designer-tools/web-report-designer/how-to-set-up-in-dotnet.md b/designing-reports/report-designer-tools/web-report-designer/how-to-set-up-in-dotnet.md index 2d0222ec9..171e18580 100644 --- a/designing-reports/report-designer-tools/web-report-designer/how-to-set-up-in-dotnet.md +++ b/designing-reports/report-designer-tools/web-report-designer/how-to-set-up-in-dotnet.md @@ -156,37 +156,7 @@ The REST service works as a backend and is responsible for storage operations li 1. Add a new HTML Page for the Web Report Designer by right-clicking on _wwwroot_ and **Add > New Item... > HTML Page**. Name the file `index.html`. Add the required references to load the font, jQuery, Telerik Kendo UI libraries, telerikReportViewer, and webReportDesigner scripts listed in the example below. Finally, add the initialization of the telerik_WebReportDesigner widget. Note that the Web Report Designer container has a minimum width of 1200px. The complete report viewer page should look like this: - ```HTML - - - - Telerik Web Report Designer - - - - - -
- loading... -
- - - - - - - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\WebReportDesignerSetUpInDotnet.html region=WebReportDesignerAddingTheWebReportDesigner}} 1. To set up the `index.html` as a startup page, check [Make index.html as startup file in ASP.NET Core](https://www.talkingdotnet.com/make-index-html-startup-file-in-aspnet-core/). Then, change the _launchUrl_ to _index.html_ in `launchSettings.json`. 1. Finally, run the project to preview the web designer. diff --git a/designing-reports/report-designer-tools/web-report-designer/localizing-the-web-report-designer.md b/designing-reports/report-designer-tools/web-report-designer/localizing-the-web-report-designer.md index 82cf5ca03..442c87030 100644 --- a/designing-reports/report-designer-tools/web-report-designer/localizing-the-web-report-designer.md +++ b/designing-reports/report-designer-tools/web-report-designer/localizing-the-web-report-designer.md @@ -34,13 +34,7 @@ This article elaborates on how to localize the strings used and displayed by the On the page containing the Web Report Designer and its initialization script, add in the following snippet of JavaScript to load in the strings. - ```HTML - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\WebReportDesignerLocalizingTheWebReportDesigner.html region=WebReportDesignerSetup}} > note The localization file must be loaded on the page after the **jQuery** and **Web Report Designer** scripts have been loaded. diff --git a/doc-output/configure-the-export-formats/image-device-information-settings.md b/doc-output/configure-the-export-formats/image-device-information-settings.md index 445fc1f7e..6e985eed9 100644 --- a/doc-output/configure-the-export-formats/image-device-information-settings.md +++ b/doc-output/configure-the-export-formats/image-device-information-settings.md @@ -1,4 +1,4 @@ ---- +--- title: Image Device Information Settings page_title: Image Device Information Settings at a glance description: "Find detailed information about the different Image rendering settings available, and understand their XML-based and JSON-based configuration file formats." @@ -46,38 +46,7 @@ For a detailed example of how to set up the settings for a rendering extension, The following example demonstrates how to configure the settings for __IMAGE__, __IMAGEPrintPreview__, and __IMAGEPrint__ formats. -````XML - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\ImageDeviceInfoConfiguration.xml region=ImageDeviceInfoConfiguration}} ````JSON "telerikReporting": { "extensions": [ diff --git a/doc-output/configure-the-export-formats/imageinteractive-device-information-settings.md b/doc-output/configure-the-export-formats/imageinteractive-device-information-settings.md index 217d90e7a..10c4246ae 100644 --- a/doc-output/configure-the-export-formats/imageinteractive-device-information-settings.md +++ b/doc-output/configure-the-export-formats/imageinteractive-device-information-settings.md @@ -1,4 +1,4 @@ ---- +--- title: ImageInteractive Device Information Settings page_title: ImageInteractive Device Information Settings at a glance description: "Find detailed information about the different ImageInteractive rendering settings available, and understand their XML-based and JSON-based configuration file formats." @@ -41,25 +41,7 @@ For a detailed example of how to set up the settings for a rendering extension, XML-based configuration file: -````XML - - -
- - - - - - - - - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\ImageInteractiveDeviceInfoConfiguration.xml region=ImageInteractiveDeviceInfoConfiguration}} ````JSON "telerikReporting": { "extensions": [ diff --git a/doc-output/configure-the-report-engine/aiclient-element.md b/doc-output/configure-the-report-engine/aiclient-element.md index 2c6262feb..e10340f16 100644 --- a/doc-output/configure-the-report-engine/aiclient-element.md +++ b/doc-output/configure-the-report-engine/aiclient-element.md @@ -1,4 +1,4 @@ ---- +--- title: AIClient Element page_title: AIClient Element Configuration description: "Learn how to utilize the AIClient Element to configure the AI model used for GenAI-powered insights during report preview." @@ -63,28 +63,7 @@ __`` element__ The following code example demonstrates how to configure the Reporting engine with an Azure OpenAI client that uses the GPT-4o mini model variant. In addition, the AI functionality is limited to a few predefined prompts that enable it to summarize and translate the report. -````XML - - - -
- - - - - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\AiClientElementConfiguration.xml}} ````JSON "telerikReporting": { "AIClient": { diff --git a/doc-output/configure-the-report-engine/appdata-element.md b/doc-output/configure-the-report-engine/appdata-element.md index 6040a50d4..bea5fbb76 100644 --- a/doc-output/configure-the-report-engine/appdata-element.md +++ b/doc-output/configure-the-report-engine/appdata-element.md @@ -1,4 +1,4 @@ ---- +--- title: appData Element page_title: appData Element Configuration description: "Learn how to use the appData Element to choose where temporary application settings will be stored on the file system" @@ -35,16 +35,7 @@ __`` element__ ### Windows -````XML - - -
- - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\AppDataElementConfiguration.xml region=AppDataElementConfiguration}} ````JSON "telerikReporting": { "appData": { @@ -55,16 +46,7 @@ __`` element__ ### Unix(Linux/Mac): -````XML - - -
- - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\AppDataElementConfiguration_2.xml region=AppDataElementConfiguration_2}} ````JSON "telerikReporting": { "appData": { diff --git a/doc-output/configure-the-report-engine/assemblyreferences-element.md b/doc-output/configure-the-report-engine/assemblyreferences-element.md index 48b03566a..376eb129b 100644 --- a/doc-output/configure-the-report-engine/assemblyreferences-element.md +++ b/doc-output/configure-the-report-engine/assemblyreferences-element.md @@ -1,4 +1,4 @@ ---- +--- title: assemblyReferences Element page_title: assemblyReferences Element Configuration description: "Learn how to set up the assemblyReferences Element to use custom user functions in the report and create ObjectDataSource components" @@ -25,20 +25,7 @@ Defines a collection of assembly references used by the Reporting Engine during The types from the assemblies included in the _assemblyReferences_ element do not need to be registered explicitly in the [_typeReferences_ Element](slug:telerikreporting/using-reports-in-applications/export-and-configure/configure-the-report-engine/typeReferences-element) as all types in the assembly will be permitted to be used by the Reporting Engine. -````XML - - -
- - - - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\AssemblyReferencesElementConfiguration.xml region=AssemblyReferencesElementConfiguration}} ````JSON "telerikReporting": { "assemblyReferences": [ @@ -72,24 +59,7 @@ The following code example demonstrates how to configure the reporting engine to > The [probing](https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/probing-element) element is not supported in the .NET Standalone Designer -````XML - - - -
- - - - - - - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\AssemblyReferencesElementConfiguration_2.xml}} ````JSON "telerikReporting": { "assemblyReferences": [ diff --git a/doc-output/configure-the-report-engine/cache-element.md b/doc-output/configure-the-report-engine/cache-element.md index 861c635a1..b4587d64c 100644 --- a/doc-output/configure-the-report-engine/cache-element.md +++ b/doc-output/configure-the-report-engine/cache-element.md @@ -1,4 +1,4 @@ ---- +--- title: cache Element page_title: cache Element Configuration description: "Learn how to change the cache Element settings to control the cache management system used by the report viewers" @@ -61,23 +61,7 @@ All parameters and attributes for the available cache providers may be seen in t This is the default cache provider. When the `Cache` section is omitted from the `Telerik.Reporting` configuration, or the `BasePath` is not specified, the Reporting engine utilizes the temporary folder of the current user. -````XML - - … - - - - - - - - - - - - … - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\CacheElementAutoConfiguration.xml region=CacheElementAutoConfiguration}} ````JSON "telerikReporting": { "cache": { @@ -101,23 +85,7 @@ This is the default cache provider. When the `Cache` section is omitted from the When the `BasePath` is not specified, the Reporting engine utilizes the temporary folder of the current user. -````XML - - … - - - - - - - - - - - - … - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\CacheElementFileConfiguration.xml region=CacheElementFileConfiguration}} ````JSON "telerikReporting": { "cache": { @@ -139,19 +107,7 @@ When the `BasePath` is not specified, the Reporting engine utilizes the temporar ### The Memory Cache Provider -````XML - - … - - - - - - - - … - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\CacheElementMemoryConfiguration.xml region=CacheElementMemoryConfiguration}} ````JSON "telerikReporting": { "cache": { @@ -167,19 +123,7 @@ When the `BasePath` is not specified, the Reporting engine utilizes the temporar ### The IsolatedStorage Cache Provider -````XML - - … - - - - - - - - … - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\CacheElementIsolatedStorageConfiguration.xml region=CacheElementIsolatedStorageConfiguration}} ````JSON "telerikReporting": { "cache": { @@ -195,24 +139,7 @@ When the `BasePath` is not specified, the Reporting engine utilizes the temporar ### The Database Cache Provider -````XML - - … - - - - - - - - - - - - - … - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\CacheElementDatabaseConfiguration.xml region=CacheElementDatabaseConfiguration}} ````JSON "telerikReporting": { "cache": { @@ -238,24 +165,7 @@ When the `BasePath` is not specified, the Reporting engine utilizes the temporar ### The ADO.NET Cache Provider -````XML - - … - - - - - - - - - - - - - … - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\CacheElementAdoNetConfiguration.xml region=CacheElementAdoNetConfiguration}} ````JSON "telerikReporting": { "cache": { diff --git a/doc-output/configure-the-report-engine/dpiaware-element.md b/doc-output/configure-the-report-engine/dpiaware-element.md index e5445b5cb..b48b1d759 100644 --- a/doc-output/configure-the-report-engine/dpiaware-element.md +++ b/doc-output/configure-the-report-engine/dpiaware-element.md @@ -1,4 +1,4 @@ ---- +--- title: dpiAware Element page_title: dpiAware Element Configuration description: "Learn how to change the DPI awareness settings of the application through the dpiAware configuration element." @@ -34,11 +34,7 @@ The following snippet demonstrates how to set the current application's DPI awar XML-based configuration file: -````XML - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\DpiAwareElementConfiguration.xml region=DpiAwareElementConfiguration}} ````JSON "telerikReporting": { "dpiAware": { diff --git a/doc-output/configure-the-report-engine/extensions-element.md b/doc-output/configure-the-report-engine/extensions-element.md index 5aed9870d..7b3378070 100644 --- a/doc-output/configure-the-report-engine/extensions-element.md +++ b/doc-output/configure-the-report-engine/extensions-element.md @@ -1,4 +1,4 @@ ---- +--- title: extensions Element page_title: extensions Element Configuration description: "Learn how to configure the device info settings for all report rendering formats through the extensions configuration element." @@ -74,24 +74,7 @@ Parameter XML element specifies a parameter for the extension defined in the anc ## Example -````XML - - -
- - - - - - - - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\ExtensionsElementRenderConfiguration.xml region=ExtensionsElementRenderConfiguration}} ````JSON "telerikReporting": { "extensions": [ @@ -117,21 +100,7 @@ You should also specify the `description` attribute of the Extension element. Th The following example illustrates how to use the default Image rendering extension (which produces `TIFF` output) alongside a second instance that outputs reports in `EMF`. Notice that the extension name distinguishes one instance from the other: -````XML - - - - - - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\ExtensionsElementTiffConfiguration.xml region=ExtensionsElementTiffConfiguration}} ````JSON "telerikReporting": { "extensions": [ diff --git a/doc-output/configure-the-report-engine/fontlibrary-element.md b/doc-output/configure-the-report-engine/fontlibrary-element.md index efb912156..de1b2b63c 100644 --- a/doc-output/configure-the-report-engine/fontlibrary-element.md +++ b/doc-output/configure-the-report-engine/fontlibrary-element.md @@ -1,4 +1,4 @@ ---- +--- title: fontLibrary Element page_title: fontLibrary Element Configuration description: "Learn how to configure which folders the rendering engine will traverse when searching for a specific font through the fontLibrary configuration element." @@ -54,21 +54,7 @@ The following sections describe attributes, child elements, and parent elements. The following example demonstrates how to configure the reporting engine to skip searching the default font folders and declares which folder will be used for font resolving. -````XML - - - -
- - - - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\FontLibraryElementConfiguration.xml}} ````JSON "telerikReporting": { "fontLibrary": { diff --git a/doc-output/configure-the-report-engine/overview.md b/doc-output/configure-the-report-engine/overview.md index 442d2e098..116dd536a 100644 --- a/doc-output/configure-the-report-engine/overview.md +++ b/doc-output/configure-the-report-engine/overview.md @@ -1,4 +1,4 @@ ---- +--- title: Configure the Report Engine page_title: Basic Configuration of the Reporting Engine description: "Learn how to use the Telerik.Reporting root element to configure the reporting engine for your needs." @@ -45,83 +45,10 @@ The snippets in this section show the `` configuration used i The settings for the Telerik Reporting engine are stored in a custom configuration section called `Telerik.Reporting`. The declaration of this section has to be included in a `` element which should be the **first child element** of ``, like this: -```XML - - -
- - -``` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\ReportEngineConfigSectionConfiguration.xml region=ReportEngineConfigSectionConfiguration}} The custom configuration section's content: -```XML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -``` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\ReportEngineSchemaConfiguration.xml region=ReportEngineSchemaConfiguration}} ## JSON-based Configuration The JSON-based configuration structure used in `appsettings.json` or other key-value-based files looks like the following: diff --git a/doc-output/configure-the-report-engine/privatefonts-element.md b/doc-output/configure-the-report-engine/privatefonts-element.md index d418b1f02..20d60fd3b 100644 --- a/doc-output/configure-the-report-engine/privatefonts-element.md +++ b/doc-output/configure-the-report-engine/privatefonts-element.md @@ -1,4 +1,4 @@ ---- +--- title: privateFonts Element page_title: Configuring the privateFonts Element description: "Learn how to use any TrueType font, without having to install it on the host machine, through the privateFonts configuration element." @@ -44,19 +44,7 @@ The private fonts are used for all rendering extensions. Still the font renderin As with most types of software, font files are licensed, rather than sold, and licenses that govern the use of fonts vary from vendor to vendor. As a developer it is your responsibility to ensure that you have the required license rights for any font you use as private font, or otherwise redistribute. -````XML - - -
- - - - - - - -```` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\PrivateFontsElementConfiguration.xml region=PrivateFontsElementConfiguration}} ## Attributes and Elements The following sections describe attributes, child elements, and parent elements. @@ -81,21 +69,7 @@ The following sections describe attributes, child elements, and parent elements. The following example demonstrates how to configure the reporting engine to use Ubuntu and Courier New fonts. The fonts are part of the project with the following properties: -````XML - - - -
- - - - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\PrivateFontsElementConfiguration_2.xml}} ````JSON "telerikReporting": { "privateFonts": [ diff --git a/doc-output/configure-the-report-engine/processing-element.md b/doc-output/configure-the-report-engine/processing-element.md index 08e395fc7..aa7109d43 100644 --- a/doc-output/configure-the-report-engine/processing-element.md +++ b/doc-output/configure-the-report-engine/processing-element.md @@ -1,4 +1,4 @@ ---- +--- title: processing Element page_title: Configuring the processing Element description: "Learn how to configure the processing options of the reporting engine, such as whether the definition properties should be cached, or to set up custom SharedDataSource and Resources resolvers." @@ -33,48 +33,7 @@ The Processing element specifies the configuration settings that will be applied ### Example -````XML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\ProcessingElementConfiguration.xml region=ProcessingElementConfiguration}} ````JSON "telerikReporting": { "processing": { diff --git a/doc-output/configure-the-report-engine/restreportservice-element.md b/doc-output/configure-the-report-engine/restreportservice-element.md index b8e43fbae..359b3d883 100644 --- a/doc-output/configure-the-report-engine/restreportservice-element.md +++ b/doc-output/configure-the-report-engine/restreportservice-element.md @@ -1,4 +1,4 @@ ---- +--- title: restReportService Element page_title: Configuring the restReportService Element description: "Learn how to set the Reporting REST Service configuration settings from the configuration file of the running project via the restReportService configuration element." @@ -64,35 +64,7 @@ __`` element__ ## Examples -````XML - - -
- - - - - - - - - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\RestReportServiceElementConfiguration.xml region=RestReportServiceElementConfiguration}} ````JSON "telerikReporting": { "restReportService": { diff --git a/doc-output/configure-the-report-engine/typeValidation-element.md b/doc-output/configure-the-report-engine/typeValidation-element.md index d0fd84c97..ea945990f 100644 --- a/doc-output/configure-the-report-engine/typeValidation-element.md +++ b/doc-output/configure-the-report-engine/typeValidation-element.md @@ -1,4 +1,4 @@ ---- +--- title: typeValidation Element page_title: typeValidation Element Configuration description: "Learn how to set up the typeValidation Element allowing you to disable the built-in type validation." @@ -26,9 +26,7 @@ As Telerik Reporting consumes report definitions, they are a potential attack ve To prevent that, the Reporting engine validates the serialization types of the report definition and the expression types used in the report. The `typeValidation` element defines the configuration settings for this validation. -```XML - -``` +{{source=CodeSnippets\MvcCS\XmlConfiguration\TypeValidationElementOnlyConfiguration.xml region=TypeValidationElementOnlyConfiguration}} ```JSON "typeValidation": { "validateExpressionTypes": "true", @@ -51,17 +49,7 @@ The following code example demonstrates how to disable the type validation perfo > warning The type validation of the Reporting engine is an important security feature, and disabling it can make you vulnerable to attacks! Proceed at your own risk, only if you are confident in the security of your environment. -```XML - - - -
- - - - - -``` +{{source=CodeSnippets\MvcCS\XmlConfiguration\TypeValidationFullConfiguration.xml}} ```JSON "telerikReporting": { "typeValidation": { diff --git a/doc-output/configure-the-report-engine/typereferences-element.md b/doc-output/configure-the-report-engine/typereferences-element.md index 100051b8d..1c2da94bd 100644 --- a/doc-output/configure-the-report-engine/typereferences-element.md +++ b/doc-output/configure-the-report-engine/typereferences-element.md @@ -1,4 +1,4 @@ ---- +--- title: typeReferences Element page_title: typeReferences Element Configuration description: "Learn how to set up the typeReferences Element, allowing you to use custom user functions in the report and create ObjectDataSource components." @@ -26,20 +26,7 @@ Defines a collection of type references used by the Reporting Engine to resolve XML-based configuration file: -````XML - - -
- - - - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\TypeReferencesElementConfiguration.xml region=TypeReferencesElementConfiguration}} ````JSON "telerikReporting": { "typeReferences": [ @@ -65,19 +52,7 @@ The following code example demonstrates how to configure the Reporting Engine to If the type is correctly resolvable at runtime, it will be permitted to be used as a source for the ObjectDataSource's data retrieval. This configuration element also allows listing custom types that are allowed in the report definition. -````XML - - - -
- - - - - - - -```` +{{source=CodeSnippets\MvcCS\XmlConfiguration\TypeReferencesElementConfiguration_2.xml}} ````JSON "telerikReporting": { "typeReferences": [ diff --git a/embedding-reports/cache-management/configuring-cache.md b/embedding-reports/cache-management/configuring-cache.md index a84957067..88e7e8f60 100644 --- a/embedding-reports/cache-management/configuring-cache.md +++ b/embedding-reports/cache-management/configuring-cache.md @@ -1,4 +1,4 @@ ---- +--- title: Cache Management page_title: Configuring the Cache Management System of the Reporting Engine description: "Learn how to configure the cache management system of the Reporting engine by specifying a cache provider when working with Telerik Reporting." @@ -28,12 +28,7 @@ table th:nth-of-type(3) { The cache management system can be configured by specifying one or more cache providers in the [Telerik Reporting Configuration Section](slug:telerikreporting/using-reports-in-applications/export-and-configure/configure-the-report-engine/overview) of the application’s configuration file. For example, the following XML snippet configures the cache to store the rendered pages and resources in the file system: -````XML - - - -```` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\CacheManagementFileConfiguration.xml region=CacheManagementFileConfiguration}} The "provider" attribute of the "Cache" element specifies the name of the current cache provider used by the viewers. There are several preconfigured providers that can be used by applications without any additional setup: | Provider | Description | Parameters | @@ -53,21 +48,7 @@ The "provider" attribute of the "Cache" element specifies the name of the curren The individual providers are registered by adding one or more "Provider" elements. The "name" attribute specifies the friendly name of the provider and the "type" attribute specifies the assembly-qualified type name of that provider. It is not necessary to specify the "type" for the preconfigured providers in the table above. If the provider requires additional parameters, these can be specified under the "Parameters" child element of the "Provider" element. The individual parameters are specified by adding one or more "Parameter" elements. The "name" attribute specifies the name of the parameter and the "value" attribute specifies the value of that parameter. -````XML - - - - - - - - - - - -```` - - +{{source=CodeSnippets\MvcCS\XmlConfiguration\CacheManagementFilePathConfiguration.xml region=CacheManagementFilePathConfiguration}} ## See Also * [Configuring the File Cache Provider](slug:telerikreporting/using-reports-in-applications/export-and-configure/cache-management/other-reportviewer-controls/configuring-the-file-cache-provider) diff --git a/embedding-reports/cache-management/configuring-custom-cache-provider.md b/embedding-reports/cache-management/configuring-custom-cache-provider.md index 897409a65..f917dbb0f 100644 --- a/embedding-reports/cache-management/configuring-custom-cache-provider.md +++ b/embedding-reports/cache-management/configuring-custom-cache-provider.md @@ -1,4 +1,4 @@ ---- +--- title: Custom Cache Providers page_title: Configuring Custom Cache Providers for the Reporting engine description: "Learn how to configure a custom cache provider for the Reporting engine when working with Telerik Reporting." @@ -26,21 +26,7 @@ Except the preconfigured cache providers, additional providers can be used. To d To register this new provider set the __provider__ attribute of the "Cache" element to the class name which implements ICacheProvider. Under "Providers" child element of the "Cache" element, create a "Provider" element with the same __name__ attribute as the __provider__ attribute of the "Cache" element. The __type__ attribute should be the [assembly qualified name](https://learn.microsoft.com/en-us/dotnet/api/system.type.assemblyqualifiedname?view=net-7.0#System_Type_AssemblyQualifiedName) of MyCacheProvider type. The following code snippet demonstrates how to configure such custom provider: -````XML - - - - - - - - - - - -```` - - +{{source=CodeSnippets\MvcCS\XmlConfiguration\CacheManagementCustomProviderConfiguration.xml region=CacheManagementCustomProviderConfiguration}} ## See Also * [Configuring Cache](slug:telerikreporting/using-reports-in-applications/export-and-configure/cache-management/other-reportviewer-controls/configuring-cache) diff --git a/embedding-reports/cache-management/configuring-the-file-cache-provider.md b/embedding-reports/cache-management/configuring-the-file-cache-provider.md index 5cd155891..865d9d8be 100644 --- a/embedding-reports/cache-management/configuring-the-file-cache-provider.md +++ b/embedding-reports/cache-management/configuring-the-file-cache-provider.md @@ -1,4 +1,4 @@ ---- +--- title: File Cache Provider page_title: Configuring the File Cache Providers for the Reporting engine description: "Learn how to configure the file cache provider for the Reporting engine when working with Telerik Reporting." @@ -16,28 +16,10 @@ reportingArea: General The file cache provider is used to cache rendered pages and resources as temporary files on disk. This can help reducing the memory footprint of the application without sacrificing the performance significantly. It is necessary to configure the [Telerik Reporting Configuration Section](slug:telerikreporting/using-reports-in-applications/export-and-configure/configure-the-report-engine/overview) first and then use the following XML snippet that configures the viewers in the application to use the file cache provider: -````XML - - - -```` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\CacheManagementFileConfiguration.xml region=CacheManagementFileConfiguration}} By default, this provider stores the files in the temporary folder of the current user. However it can be configured to store the files in another location by specifying the "BasePath" parameter, as illustrated below: -````XML - - - - - - - - - - - -```` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\CacheManagementFilePathConfiguration.xml region=CacheManagementFilePathConfiguration}} The __BasePath__ can represent either an absolute path on disk or a relative path. In the latter case the path is mapped to the application’s working directory. > In web applications deployed on a web farm, the __BasePath__ parameter should specify a shared folder with the necessary permissions which should be accessible from all servers. diff --git a/embedding-reports/display-reports-in-applications/how-to-deploy-a-report-created-with-standalone-report-designer.md b/embedding-reports/display-reports-in-applications/how-to-deploy-a-report-created-with-standalone-report-designer.md index 0167eb3f0..25264b760 100644 --- a/embedding-reports/display-reports-in-applications/how-to-deploy-a-report-created-with-standalone-report-designer.md +++ b/embedding-reports/display-reports-in-applications/how-to-deploy-a-report-created-with-standalone-report-designer.md @@ -20,13 +20,13 @@ To show a report created with the [Standalone Report Designer](slug:telerikrepor * __Use [UriReportSource](/api/Telerik.Reporting.UriReportSource)__ and a path to the TRDX|TRDP file: -{{source=CodeSnippets\CS\API\Telerik\Reporting\ReportSourceSnippets.cs region=CreateUriReportSourceSnippet}} -{{source=CodeSnippets\VB\API\Telerik\Reporting\ReportSourceSnippets.vb region=CreateUriReportSourceSnippet}} + {{source=CodeSnippets\CS\API\Telerik\Reporting\ReportSourceSnippets.cs region=CreateUriReportSourceSnippet}} + {{source=CodeSnippets\VB\API\Telerik\Reporting\ReportSourceSnippets.vb region=CreateUriReportSourceSnippet}} * __Use [XmlReportSource](/api/Telerik.Reporting.XmlReportSource)__ and read the plain XML of a TRDX file: -{{source=CodeSnippets\CS\API\Telerik\Reporting\ReportSourceSnippets.cs region=CreateXmlReportSourceSnippet}} -{{source=CodeSnippets\VB\API\Telerik\Reporting\ReportSourceSnippets.vb region=CreateXmlReportSourceSnippet}} + {{source=CodeSnippets\CS\API\Telerik\Reporting\ReportSourceSnippets.cs region=CreateXmlReportSourceSnippet}} + {{source=CodeSnippets\VB\API\Telerik\Reporting\ReportSourceSnippets.vb region=CreateXmlReportSourceSnippet}} * __Deserialize the XML report definition from a TRDX file__ : If working with CLR types and objects is your thing, you can deserialize the XML report definition and proceed following the basic concepts of the programming language and the.NET platform. For example you can create an InstanceReportSource and and set its ReportDocument property to the deserialized report object. See [Serialize Report Definition in XML](slug:telerikreporting/using-reports-in-applications/program-the-report-definition/serialize-report-definition-in-xml) for more information. * __Unpackaging the XML report definition from a TRDP file__ : If you need to obtain a Telerik Report instance in code from a TRDP file, you can unpackage the content in code. Then create an InstanceReportSource and set its ReportDocument property to the unpackaged report object. See [Package Report Definition](slug:telerikreporting/using-reports-in-applications/program-the-report-definition/package-report-definition) for more information. diff --git a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/events.md b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/events.md index ac4611e4c..7dc62ecfd 100644 --- a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/events.md +++ b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/events.md @@ -25,32 +25,11 @@ table th:nth-of-type(2) { 1. Create a handler function in the component's `.TS` file: - ```TypeScript - export class ReportViewerComponent implements AfterViewInit { - @ViewChild('viewer1') viewer: TelerikReportViewerComponent; - - ready() { - console.log('ready'); - } - viewerToolTipOpening(e: any, args: any) { - console.log('viewerToolTipOpening ' + args.toolTip.text); - } - } - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerEvents.ts region=AngularViewerEventHandlers}} 1. In the `.HTML` component file, assing the handler to the corresponding event: - ```HTML - - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\AngularViewerEvents.html region=AngularViewerHowToUseTheEvents}} Below is a list of all available report viewer events. diff --git a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/methods.md b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/methods.md index 013e3639a..89c63c945 100644 --- a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/methods.md +++ b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/methods.md @@ -23,10 +23,7 @@ table th:nth-of-type(3) { Each method can be called using a reference to the report viewer component. -```HTML - - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\AngularViewerApi.html region=AngularViewerRefreshMethod}} The example above refreshes the report viewer. diff --git a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/options.md b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/options.md index 1bf75a53d..971c974a7 100644 --- a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/options.md +++ b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/options.md @@ -27,42 +27,8 @@ Below is a list of all options available during initialization. The report viewer options can be set from the `.HTML`/`.TS` component file or both(combined): -````HTML - - -```` -````TypeScript -export class ReportViewerComponent implements AfterViewInit { - @ViewChild('viewer1') viewer: TelerikReportViewerComponent; - - title = "Report Viewer"; - viewerContainerStyle = { - position: 'absolute', - left: '5px', - right: '5px', - top: '40px', - bottom: '5px', - overflow: 'hidden', - clear: 'both', - ['font-family']: 'ms sans serif' - }; - - ready() { - console.log('ready'); - } - viewerToolTipOpening(e: any, args: any) { - console.log('viewerToolTipOpening ' + args.toolTip.text); - } -} -```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\AngularViewerApi.html region=AngularViewerOptions}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\AngularHtml5Viewer.ts region=AngularViewerEventBinding_AfterViewInit}} ## Available Options diff --git a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/properties.md b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/properties.md index 8469081db..1bbd7b676 100644 --- a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/properties.md +++ b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/api-reference/properties.md @@ -32,10 +32,7 @@ Each [command](slug:telerikreporting/using-reports-in-applications/display-repor The other two methods, `enabled()` and `checked()` return a boolean value and can be used before executing a command or to find in what state the UI for the command should be. -```HTML - - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\AngularViewerApi.html region=AngularViewerPrintCommand}} The example above creates a _Print_ button and in the click event handler invokes report viewer `print` command. diff --git a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/customizing/how-to-pass-values-to-report-parameters.md b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/customizing/how-to-pass-values-to-report-parameters.md index 80fdac090..1ae41fd1b 100644 --- a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/customizing/how-to-pass-values-to-report-parameters.md +++ b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/customizing/how-to-pass-values-to-report-parameters.md @@ -18,30 +18,13 @@ This topic explains how to update the report parameters with values passed from 1. Add the custom UI in your application. For example: - ```HTML - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\AngularViewerPassValuesToReportParameters.html region=AngularViewerPassValuesToReportParametersFromTheApplicationUi}} 1. Declare the variable for the viewer and update the viewer's report source with a new parameter value: - ```TypeScript - import { Component, ViewChild } from '@angular/core'; - import { TelerikReportViewerComponent } from '@progress/telerik-angular-report-viewer'; + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerPassParameters.ts region=AngularViewerPassValuesToReportParameters}} - export class AppComponent { - @ViewChild('viewer1') viewer: TelerikReportViewerComponent; - - onButtonClick(param: string) { - var rs = { - report: 'Invoice.trdp', - parameters: { OrderNumber: param } - }; - this.viewer.setReportSource(rs); - } - } - ``` - - The `setReportSource(rs)` method will automatically refresh the report with the new parameter values. + The `setReportSource(rs)` method will automatically refresh the report with the new parameter values. ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/customizing/localization.md b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/customizing/localization.md index ea7293ef4..741bdece4 100644 --- a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/customizing/localization.md +++ b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/customizing/localization.md @@ -16,44 +16,14 @@ The article elaborates on how to localize the messages displayed by the Angular 1. To localize the report viewer, create a new TypeScript file `stringResources.ts`: - ```TypeScript - export class StringResources { - static english = { - loadingReport: 'Loading...', - // override other string resources here - } - static japanese = { - loadingReport: 'ちょっと、まってください...', - // override other string resources here - } - // override string resources for other cultures here - } - ``` - - The file can contain all or only part of the string resources which would be localized. For a full list of the report viewer string resources which could be localized, please refer to [HTML5 Report Viewer Localization](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/customizing/localization). + {{source=CodeSnippets\Blazor\Docs\TypeScript\ViewerLocalizationStringResources.ts region=StringResourcesDefinition}} + + The file can contain all or only part of the string resources, which would be localized. For a full list of the report viewer string resources that could be localized, please refer to [HTML5 Report Viewer Localization](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/customizing/localization). 1. Import the new file with the localized strings in the component where the viewer is used: - ```TypeScript - import { StringResources } from './stringResources'; - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\ViewerLocalizationImport.ts region=ImportStringResources}} 1. Implement the `AfterViewInit` event and extend the viewer object with the string resources for the desired culture: - ```TypeScript - import { AfterViewInit, Component, ViewChild } from '@angular/core'; - import { TelerikReportViewerComponent } from '@progress/telerik-angular-report-viewer'; - import { StringResources } from './stringResources'; - - export class AppComponent implements AfterViewInit { - @ViewChild('viewer1') viewer: TelerikReportViewerComponent; - ngAfterViewInit(): void { - const language = navigator.language; - let resources = StringResources.english; // default - if(language === 'ja-JP'){ - resources = StringResources.japanese; - } - this.viewer.viewerObject.stringResources = Object.assign(this.viewer.viewerObject.stringResources, resources); - } - } - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerLocalization.ts region=AngularViewerLocalizationApply}} diff --git a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/event-binding.md b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/event-binding.md index a85653969..54b4942ce 100644 --- a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/event-binding.md +++ b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/event-binding.md @@ -18,25 +18,11 @@ The Angular Report Viewer exposes these [Events](slug:telerikreporting/using-rep To attach an event handler to the viewer, specify the name of your function when binding the corresponding input property of the viewer component. For example, we can attach to the `ready` and `viewerToolTipOpening` events of the viewer: -````HTML - - -```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\AngularViewerApi.html region=AngularViewerEventBinding}} Then, we can create the event handler functions in the component where the viewer is used: -````TypeScript -export class AppComponent { - myReadyHandler() { - console.log('The viewer is ready!'); - } - myViewerToolTipOpeningHandler(e: any, args: any) { - console.log('Tooltip shows: ' + args.toolTip.text); - } -} -```` +{{source=CodeSnippets\Blazor\Docs\TypeScript\AngularHtml5Viewer.ts region=AngularViewerEventHandlers_Ready}} ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-angular-report-viewer-with-angular-cli.md b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-angular-report-viewer-with-angular-cli.md index f0eec3252..56bc4cc93 100644 --- a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-angular-report-viewer-with-angular-cli.md +++ b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-angular-report-viewer-with-angular-cli.md @@ -26,114 +26,77 @@ The following list describes the prerequisites for this tutorial: - Copy of the "Product Catalog.trdp" report file from `C:\Program Files (x86)\Progress\Telerik Reporting {{site.suiteversion}}\Report Designer\Examples` placed in the folder used by the [UriReportSourceResolver](/api/telerik.reporting.services.urireportsourceresolver) in the Reporting REST service implementation. - Entry with the default connection string used by Telerik Reporting sample reports in the `web.config`/`appsettings.json` file of the project hosting the Reporting REST service. - XML-based configuration file: - - ```XML - - - - ``` - - JSON-based configuration file: - - ```JSON - "ConnectionStrings": { - //This connection string will use System.Data.SqlClient as data provider invariant name. - //"Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString": "Data Source=.\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=true" - - //This connection string explicitly states the data provider invariant name - mandatory for databases other than MSSQL Server. - "Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString": { - "connectionString": "Data Source=.\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=true", - "providerName": "System.Data.SqlClient" - } - } - ``` + XML-based configuration file: + + ```XML + + + + ``` + + JSON-based configuration file: + + ```JSON + "ConnectionStrings": { + //This connection string will use System.Data.SqlClient as data provider invariant name. + //"Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString": "Data Source=.\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=true" + + //This connection string explicitly states the data provider invariant name - mandatory for databases other than MSSQL Server. + "Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString": { + "connectionString": "Data Source=.\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=true", + "providerName": "System.Data.SqlClient" + } + } + ``` ## Using Angular Report Viewer in Angular application ### Steps: -1. Create new Angular application using the [Angular CLI](https://angular.io/cli) tutorial. -1. Install the Telerik Angular Report Viewer NPM package by running: - - ```powershell - npm install @progress/telerik-angular-report-viewer - ``` - - > If you receive a _403 Forbidden Error_, you need to register and login at [npmjs.com](https://www.npmjs.com/) before performing this step. - > - > ```powershell - > npm login --registry=https://registry.npmjs.org --scope=@progress - > ``` - -1. Once installed, import the `TelerikReportingModule` in [your application root module](https://angular.io/guide/ngmodules#!#angular-modularity) or [standalone component](https://angular.dev/guide/components): - - ```TypeScript - import { TelerikReportingModule } from '@progress/telerik-angular-report-viewer'; - - @Component({ - selector: 'app-root', - standalone: true, - imports: [TelerikReportingModule], - templateUrl: './app.component.html', - styleUrl: './app.component.scss' - }) - ``` - -1. Add the desired report viewer container styling using a property of the custom component class(_in this example - AppComponent_): - - ```TypeScript - export class AppComponent { - viewerContainerStyle = { - position: 'relative', - width: '1000px', - height: '800px', - ['font-family']: 'ms sans serif' - }; - } - ``` - -1. Use the report viewer selector in the `AppComponent` template: - - ```HTML - - - ``` - - For all available report viewer options refer to [Options](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/angular-report-viewer/api-reference/options). - -1. Style the viewer using the desired Kendo UI [Sass-Based Theme](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) by adding references to the Sass-based CSS files in the `` element of _index.html_: - - ```HTML - - ``` - - > To get the Sass-based Kendo UI themes, you can use either the pre-build CSS files or the NPM packages ([Getting the Sass-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview#getting-the-themes)). - - If you use the **styleUrls** attribute to reference the CSS, it is required to set the view encapsulation to **None**: - - ```TypeScript - import { Component, ViewEncapsulation } from '@angular/core'; - @Component({ - encapsulation: ViewEncapsulation.None - ``` - -1. Run the application: - - ```powershell - ng serve - ``` +1. Create new Angular application using the [Angular CLI](https://angular.io/cli) tutorial. +1. Install the Telerik Angular Report Viewer NPM package by running: + + ```powershell + npm install @progress/telerik-angular-report-viewer + ``` + + > If you receive a _403 Forbidden Error_, you need to register and login at [npmjs.com](https://www.npmjs.com/) before performing this step. + > + > ```powershell + > npm login --registry=https://registry.npmjs.org --scope=@progress + > ``` + +1. Once installed, import the `TelerikReportingModule` in [your application root module](https://angular.io/guide/ngmodules#!#angular-modularity) or [standalone component](https://angular.dev/guide/components): + + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithAngularCli.ts region=AngularViewerImportStandaloneComponent}} + +1. Add the desired report viewer container styling using a property of the custom component class(_in this example - AppComponent_): + + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithAngularCli.ts region=AngularViewerContainerStyle}} + +1. Use the report viewer selector in the `AppComponent` template: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\AngularViewerUseAngularReportViewerWithAngularCli.html region=AngularViewerSteps}} + + For all available report viewer options refer to [Options](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/angular-report-viewer/api-reference/options). + +1. Style the viewer using the desired Kendo UI [Sass-Based Theme](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) by adding references to the Sass-based CSS files in the `` element of _index.html_: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerStyling.html region=Html5ViewerKendoThemeCss}} + + > To get the Sass-based Kendo UI themes, you can use either the pre-build CSS files or the NPM packages ([Getting the Sass-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview#getting-the-themes)). + + If you use the **styleUrls** attribute to reference the CSS, it is required to set the view encapsulation to **None**: + + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithAngularCli_1.ts region=AngularViewerDisableEncapsulation}} + +1. Run the application: + + ```powershell + ng serve + ``` ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-angular-report-viewer-with-report-server.md b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-angular-report-viewer-with-report-server.md index 3f3fb5c59..da23c7cce 100644 --- a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-angular-report-viewer-with-report-server.md +++ b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-angular-report-viewer-with-report-server.md @@ -26,89 +26,48 @@ The following list describes the prerequisites for this tutorial: ### Steps: -1. Create new Angular application using the [Angular CLI](https://angular.io/cli) tutorial. -1. Install the Telerik Angular Report Viewer NPM package by running: - - ```powershell - npm install @progress/telerik-angular-report-viewer - ``` - - > If you receive a _403 Forbidden Error_, you need to register and login at [npmjs.com](https://www.npmjs.com/) before performing this step. - > - > ```powershell - > npm login --registry=https://registry.npmjs.org --scope=@progress - > ``` - -1. Once installed, import the `TelerikReportingModule` in [your application root module](https://angular.io/guide/ngmodules#!#angular-modularity) or [standalone component](https://angular.dev/guide/components): - - ```TypeScript - import { TelerikReportingModule } from '@progress/telerik-angular-report-viewer'; - - @Component({ - selector: 'app-root', - standalone: true, - imports: [TelerikReportingModule], - templateUrl: './app.component.html', - styleUrl: './app.component.scss' - }) - ``` - -1. Add the desired report viewer container styling using a property of the custom component class(_in this example - AppComponent_): - - ```TypeScript - export class AppComponent { - viewerContainerStyle = { - position: 'relative', - width: '1000px', - height: '800px', - ['font-family']: 'ms sans serif' - }; - } - ``` - -1. Use the report viewer selector in the AppComponent template: - - ```HTML - - - ``` - - For all available report viewer options refer to [Options](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/angular-report-viewer/api-reference/options). - -1. Style the viewer using the desired Kendo UI [Sass-Based Theme](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) by adding references to the Sass-based CSS files in the `` element of _index.html_: - - ```HTML - - ``` - - > To get the Sass-based Kendo UI themes, you can use either the pre-build CSS files or the NPM packages ([Getting the Sass-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview#getting-the-themes)). - - If you use the **styleUrls** attribute to reference the CSS, it is required to set the view encapsulation to **None**: - - ```TypeScript - import { Component, ViewEncapsulation } from '@angular/core'; - @Component({ - encapsulation: ViewEncapsulation.None - ``` - -1. Run the application: - - ```powershell - ng serve - ``` +1. Create new Angular application using the [Angular CLI](https://angular.io/cli) tutorial. +1. Install the Telerik Angular Report Viewer NPM package by running: + + ```powershell + npm install @progress/telerik-angular-report-viewer + ``` + + > If you receive a _403 Forbidden Error_, you need to register and login at [npmjs.com](https://www.npmjs.com/) before performing this step. + > + > ```powershell + > npm login --registry=https://registry.npmjs.org --scope=@progress + > ``` + +1. Once installed, import the `TelerikReportingModule` in [your application root module](https://angular.io/guide/ngmodules#!#angular-modularity) or [standalone component](https://angular.dev/guide/components): + + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithAngularCli.ts region=AngularViewerImportStandaloneComponent}} + +1. Add the desired report viewer container styling using a property of the custom component class(_in this example - AppComponent_): + + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithAngularCli.ts region=AngularViewerContainerStyle}} + +1. Use the report viewer selector in the AppComponent template: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\AngularViewerUseAngularReportViewerWithReportServer.html region=AngularViewerSteps2}} + + For all available report viewer options refer to [Options](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/angular-report-viewer/api-reference/options). + +1. Style the viewer using the desired Kendo UI [Sass-Based Theme](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) by adding references to the Sass-based CSS files in the `` element of _index.html_: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerStyling.html region=Html5ViewerKendoThemeCss}} + + > To get the Sass-based Kendo UI themes, you can use either the pre-build CSS files or the NPM packages ([Getting the Sass-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview#getting-the-themes)). + + If you use the **styleUrls** attribute to reference the CSS, it is required to set the view encapsulation to **None**: + + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithAngularCli_1.ts region=AngularViewerDisableEncapsulation}} + +1. Run the application: + + ```powershell + ng serve + ``` ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-angular-report-viewer-with-systemjs/index.md b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-angular-report-viewer-with-systemjs/index.md index ba38ef8f8..dfda75552 100644 --- a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-angular-report-viewer-with-systemjs/index.md +++ b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-angular-report-viewer-with-systemjs/index.md @@ -27,30 +27,30 @@ The following list describes the prerequisites for this tutorial: - Copy of the "Product Catalog.trdp" report file from `[TelerikReporting_InstallDir]\ReportDesigner\Examples` in the folder used by the [UriReportSourceResolver](/api/telerik.reporting.services.urireportsourceresolver) in the Reporting REST service implementation. - Entry with the default connection string used by Telerik Reporting sample reports in the `web.config`/`appsettings.json` file of the project hosting the Reporting REST service. - XML-based configuration file: - - ```XML - - - - ``` - - JSON-based configuration file: - - ```JSON - "ConnectionStrings": { - //This connection string will use System.Data.SqlClient as data provider invariant name. - //"Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString": "Data Source=.\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=true" - - //This connection string explicitly states the data provider invariant name - mandatory for databases other than MSSQL Server. - "Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString": { - "connectionString": "Data Source=.\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=true", - "providerName": "System.Data.SqlClient" - } - } - ``` + XML-based configuration file: + + ```XML + + + + ``` + + JSON-based configuration file: + + ```JSON + "ConnectionStrings": { + //This connection string will use System.Data.SqlClient as data provider invariant name. + //"Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString": "Data Source=.\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=true" + + //This connection string explicitly states the data provider invariant name - mandatory for databases other than MSSQL Server. + "Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString": { + "connectionString": "Data Source=.\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=true", + "providerName": "System.Data.SqlClient" + } + } + ``` ## Clone Angular Quickstart @@ -70,95 +70,78 @@ npm install 1. The Angular Report Viewer requires jQuery peer dependencies. To install it use the following command: - ```powershell - npm install --save jquery - ``` + ```powershell + npm install --save jquery + ``` 1. The Telerik Angular Report Viewer package is published in the public NPM registry. To install the package, run: - ```powershell - npm install --save @progress/telerik-angular-report-viewer - ``` + ```powershell + npm install --save @progress/telerik-angular-report-viewer + ``` 1. Configure SystemJS The configuration file, which SystemJS uses, is in the project template under `src/systemjs.config.js`. To add the Angular Report Viewer and jQuery configuration to the map and packages section, use the following example: - ```JSON - map: { - //... - '@progress': 'npm:@progress', - '@telerik': 'npm:@telerik', - 'jquery': 'npm:jquery/dist/jquery.js', - }, - packages: { - //... - // Telerik Angular Report Viewer package - '@progress/telerik-angular-report-viewer': { - main: 'dist/cjs/main', - format: 'cjs', - defaultExtension: 'js' - } - } - ``` + ```JSON + map: { + //... + '@progress': 'npm:@progress', + '@telerik': 'npm:@telerik', + 'jquery': 'npm:jquery/dist/jquery.js', + }, + packages: { + //... + // Telerik Angular Report Viewer package + '@progress/telerik-angular-report-viewer': { + main: 'dist/cjs/main', + format: 'cjs', + defaultExtension: 'js' + } + } + ``` 1. Import the `TelerikReportingModule` in [your application root module](https://angular.io/guide/ngmodules#!#angular-modularity): - ```TypeScript - import { TelerikReportingModule } from '@progress/telerik-angular-report-viewer'; - @NgModule({ - imports: [TelerikReportingModule] - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithSystemJs.ts region=AngularViewerImportNgModule}} 1. Add the desired report viewer container style using a property of the `AppComponent` class: - ```TypeScript - export class AppComponent { - viewerContainerStyle = { - position: 'relative', - width: '1000px', - height: '800px', - ['font-family']: 'ms sans serif' - }; - } - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithSystemJs.ts region=AngularViewerContainerStyleSystemJs}} 1. Use the report viewer selector in the `AppComponent` template: - ```HTML - - - ``` - - For all available report viewer options, refer to [Options](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/angular-report-viewer/api-reference/options). + ```HTML + + + ``` + + For all available report viewer options, refer to [Options](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/angular-report-viewer/api-reference/options). 1. Style the viewer using the desired Kendo UI theme (еither using [LESS-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/less-themes/overview) or [SASS-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview)): Add references to the LESS-based CSS files in the `` element of `index.html`: - ```HTML - - - - ``` + ```HTML + + + + ``` - > To get the SASS-based Kendo UI themes, you can use either the pre-build CSS files or the NPM packages ([Getting the Sass-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview#getting-the-themes)). + > To get the SASS-based Kendo UI themes, you can use either the pre-build CSS files or the NPM packages ([Getting the Sass-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview#getting-the-themes)). - If you are using the `styleUrls` attribute to reference the CSS, it is required to set the view encapsulation to `None`: + If you are using the `styleUrls` attribute to reference the CSS, it is required to set the view encapsulation to `None`: - ```TypeScript - import { Component, ViewEncapsulation } from '@angular/core'; - @Component({ - encapsulation: ViewEncapsulation.None - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithSystemJs_1.ts region=AngularViewerDisableEncapsulationSystemJs}} 1. Run the application: - ```powershell - npm run start - ``` + ```powershell + npm run start + ``` diff --git a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-with-report-server-net.md b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-with-report-server-net.md index cca079b63..63ce7c23d 100644 --- a/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-with-report-server-net.md +++ b/embedding-reports/display-reports-in-applications/web-application/angular-report-viewer/how-to-use-with-report-server-net.md @@ -26,96 +26,55 @@ The user account that will authenticate with the Report Server may be any User, 1. Install the Telerik Angular Report Viewer NPM package by running: - ```powershell - npm install @progress/telerik-angular-report-viewer - ``` + ```powershell + npm install @progress/telerik-angular-report-viewer + ``` - > If you receive a _403 Forbidden Error_, you need to register and log in at [npmjs.com](https://www.npmjs.com/) before performing this step. - > - > ```powershell - > npm login --registry=https://registry.npmjs.org --scope=@progress - > ``` + > If you receive a _403 Forbidden Error_, you need to register and log in at [npmjs.com](https://www.npmjs.com/) before performing this step. + > + > ```powershell + > npm login --registry=https://registry.npmjs.org --scope=@progress + > ``` 1. Once installed, import the `TelerikReportingModule` in [your application root module](https://angular.io/guide/ngmodules#!#angular-modularity) or [standalone component](https://angular.dev/guide/components): - ```TypeScript - import { TelerikReportingModule } from '@progress/telerik-angular-report-viewer'; - - @Component({ - selector: 'app-root', - standalone: true, - imports: [TelerikReportingModule], - templateUrl: './app.component.html', - styleUrl: './app.component.scss' - }) - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithReportServerNet.ts region=AngularViewerImportWithReportServerNet}} 1. Style the viewer using the desired Kendo UI [Sass-Based Theme](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) by adding references to the Sass-based CSS files in the `` element of _index.html_: - ```HTML - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\AngularViewerUseWithReportServerNet.html region=AngularViewerSteps3}} - > To get the Sass-based Kendo UI themes, you can use either the pre-built CSS files or the NPM packages ([Getting the Sass-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview#getting-the-themes)). + > To get the Sass-based Kendo UI themes, you can use either the pre-built CSS files or the NPM packages ([Getting the Sass-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview#getting-the-themes)). - If you use the **styleUrls** attribute to reference the CSS, it is required to set the view encapsulation to **None**: + If you use the **styleUrls** attribute to reference the CSS, it is required to set the view encapsulation to **None**: - ```TS - import { Component, ViewEncapsulation } from '@angular/core'; - @Component({ - encapsulation: ViewEncapsulation.None - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithReportServerNet_1.ts region=AngularViewerImportWithReportServerNetDisableEncapsulation}} 1. In the class of the component(e.g. `AppComponent`) where the viewer will be displayed, define a `viewerContainerStyle` object property that will be used to set the container styling: - ```TS - export class AppComponent { - viewerContainerStyle = { - position: 'relative', - width: '1000px', - height: '800px', - ['font-family']: 'ms sans serif' - }; - } - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithReportServerNet.ts region=AngularViewerImportWithReportServerNetContainerStyle}} 1. In the same component class, define a `reportSource` object property specifying the category and the name of the report that will be displayed. For example, if the category is **Samples** and the report is **Dashboard**, the syntax will look as follows: - ```TS - reportSource = { - report: 'Samples/Dashboard', - parameters: {} - } - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithReportServerNet_1.ts region=AngularViewerImportWithReportServerRestService}} 1. In the same component class, define a `reportServer` object property with a `url` string pointing to the Report Server for .NET, and a `getPersonalAccessToken` callback, which will be executed when the report viewer requests from the server to render the report. - ```TS - reportServer = { - url: 'http://dnikolovlap:81/', - getPersonalAccessToken: () => fetch('/rs-token').then(response => response.text()) - } - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithReportServerNet_1.ts region=AngularViewerImportWithReportServerReportServer}} - In this example, the `getPersonalAccessToken` callback makes a request to a _/rs-token_ endpoint that returns the token used to authorize access to using the Report Server for .NET REST API. + In this example, the `getPersonalAccessToken` callback makes a request to a _/rs-token_ endpoint that returns the token used to authorize access to using the Report Server for .NET REST API. - This is the **recommended** approach, but if an endpoint cannot be exposed, the token can be hardcoded in the callback: `getPersonalAccessToken: () => Promise.resolve('TOKEN_STRING')` + This is the **recommended** approach, but if an endpoint cannot be exposed, the token can be hardcoded in the callback: `getPersonalAccessToken: () => Promise.resolve('TOKEN_STRING')` 1. In the HTML template of the component, define the `` element, and pass the defined properties to their corresponding properties of the Angular Wrapper Report Viewer: - ```HTML - - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\AngularViewerUseWithReportServerNet.html region=AngularViewerSteps4}} 1. Run the application: - ```powershell - ng serve - ``` + ```powershell + ng serve + ``` ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/event-binding.md b/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/event-binding.md index afa6c38a7..d2d28d1d0 100644 --- a/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/event-binding.md +++ b/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/event-binding.md @@ -22,26 +22,8 @@ The event handler functions can be implemented inside the **wwwroot/index.html** For example, we can attach handlers to the `ExportBegin` and `ExportEnd` events of the viewer: -```RAZOR - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\BlazorViewerEventBinding.razor region=BlazorViewerClientEvents}} Then, we can create the event handler functions in the **wwwroot/index.html** (Blazor WebAssembly) or **Pages/\_Host.cshtml** (Blazor Server): -```HTML - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\BlazorViewerScripts.html region=BlazorViewerEventHandlers}} diff --git a/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/how-to-create-a-custom-parameter-editor.md b/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/how-to-create-a-custom-parameter-editor.md index 2c32e4db2..4e8943ac5 100644 --- a/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/how-to-create-a-custom-parameter-editor.md +++ b/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/how-to-create-a-custom-parameter-editor.md @@ -32,75 +32,11 @@ The following example uses the **Dashboard** example report that we ship with th - In the shared `HTML`/`CSHTML` file: -```HTML - - - - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\BlazorViewerScripts.html region=BlazorViewerCustomParameterEditor}} - Then in the Blazor Report Viewer Initialization: -```RAZOR - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\BlazorViewerCustomParameterEditor.razor region=BlazorViewerParameterEditors}} ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/how-to-use-blazor-report-viewer.md b/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/how-to-use-blazor-report-viewer.md index fb278159c..f73bdad36 100644 --- a/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/how-to-use-blazor-report-viewer.md +++ b/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/how-to-use-blazor-report-viewer.md @@ -47,25 +47,15 @@ If you wish to connect the Report Viewer to a Report Server instance, refer to t 1. Add JavaScript dependencies to the `head` element of the `Pages/_Host.cshtml` (Blazor Server) or `wwwroot/index.html` (Blazor WebAssembly), or `Components/App.razor` (Blazor Web App): - ```HTML - - @* For Reports service hosted in the same project: *@ - - @* For Reports service hosted in another application / Report Server use absolute URI: *@ - @**@ - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\BlazorViewerUseBlazorReportViewer.html region=BlazorViewerAddingTheBlazorReportViewerComponentManually}} 1. Add a [Telerik Kendo UI SASS-Based Theme](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) to the `head` element of the `Pages/_Host.cshtml` (Blazor Server) or `wwwroot/index.html` (Blazor WebAssembly), or `Components/App.razor` (Blazor Web App). The Razor syntax for a server application differs and you need to escape the **@** symbol as **@@**: - ```HTML - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerStyling.html region=Html5ViewerKendoThemeCss}} 1. Add the dedicated `interop.js` dependency at the end of the `body` element of the `Pages/_Host.cshtml` (Blazor Server) or `wwwroot/index.html` (Blazor WebAssembly), or `Components/App.razor` (Blazor Web App): - ```HTML - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\BlazorViewerUseBlazorReportViewer.html region=BlazorViewerAddingTheBlazorReportViewerComponentManually2}} 1. When using the Telerik Reporting web service (either locally hosted or in another application) use the following snippet to place the viewer component in a razor page like `Pages/Index.razor`. diff --git a/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/methods-and-commands.md b/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/methods-and-commands.md index 5dc5ae463..9ecc14761 100644 --- a/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/methods-and-commands.md +++ b/embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/methods-and-commands.md @@ -20,21 +20,4 @@ To call report viewer methods and execute commands, first get a reference to the For example, refresh and print of the current report can be triggered like this: -```RAZOR - - - - - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\BlazorViewerUseBlazorReportViewerWithRsNet.html region=BlazorViewerAddingTheBlazorReportViewerComponentManually3}} 1. Add a [Telerik Kendo UI SASS-Based Theme](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) to the `head` element of the `Pages/_Host.cshtml` (Blazor Server) or `wwwroot/index.html` (Blazor WebAssembly), or `Components/App.razor` (Blazor Web App). The Razor syntax for a server application differs and you need to escape the **@** symbol as **@@**: - ```HTML - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\AngularViewerUseWithReportServerNet.html region=AngularViewerSteps3}} 1. Add the dedicated `interop.js` dependency at the end of the `body` element of the `Pages/_Host.cshtml` (Blazor Server) or `wwwroot/index.html` (Blazor WebAssembly), or `Components/App.razor` (Blazor Web App): - ```HTML - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\BlazorViewerUseBlazorReportViewer.html region=BlazorViewerAddingTheBlazorReportViewerComponentManually2}} ## Connect to the Report Server for .NET instance @@ -69,27 +62,7 @@ The Report Server for .NET provides two approaches for authenticating from the T Use the following snippet to place the viewer component in a Razor page like `Pages/Index.razor`: -```RAZOR -@page "/" -@* For Blazor Web Apps, an interactive render mode should be used, for example: *@ -@* @rendermode InteractiveServer *@ -@using Telerik.ReportViewer.Blazor - - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\BlazorViewerTokenAuth.razor region=BlazorViewerTokenAuth}} > caution The `serviceUrl` option shouldn't be present, or the viewer would default to no authentication scheme utilizing the Report Server for .NET as a regular Reporting REST Service. @@ -122,27 +95,7 @@ app.MapGet("/rs-token", (HttpContext context) => If you prefer to use hardcoded credentials, use the following snippet to place the viewer component in a Razor page like `Pages/Index.razor`. -```RAZOR -@page "/" -@* For Blazor Web Apps, an interactive render mode should be used, for example: *@ -@* @rendermode InteractiveServer *@ -@using Telerik.ReportViewer.Blazor - - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\BlazorViewerReportServerAuth.razor region=BlazorViewerUsernamePasswordAuth}} > caution The **Guest User** may connect to the Report Server for .NET only with a **Token**. It doesn't have a password and cannot connect to the Report Server for .NET with Null credentials, as the Report Server for .NET Framework 4.6.2. diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/client-events.md b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/client-events.md index 1440cbfb5..2f42f8e63 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/client-events.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/client-events.md @@ -24,27 +24,8 @@ This article explains how to attach client event handlers to an HTML5 MVC Report To attach a client event handler you have to set the proper `ClientEvents` widget method as shown below: -````HTML - -```` -````CSHTML -@(Html.TelerikReporting().ReportViewer() - .ClientEvents( - events => events - .RenderingBegin("onRenderingBegin") - .RenderingEnd("onRenderingEnd") - ) -) -```` - - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\MvcViewerClientEvents.html region=MvcViewerRenderingEvents}} +{{source=CodeSnippets\MvcCS\Views\Home\ClientEvents.cshtml region=ClientEventsExample}} The following table list the available client events: | __Event__ | __Description__ | diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/how-to-change-parameter-editors-type.md b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/how-to-change-parameter-editors-type.md index 5baeb1ef9..d24f2910e 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/how-to-change-parameter-editors-type.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/how-to-change-parameter-editors-type.md @@ -18,16 +18,7 @@ The parameters editors types are defined through the Parameters method when crea The following example illustrates how to set the Parameters method to the Telerik Report Viewer widget. -```CSHTML -@(Html.TelerikReporting().ReportViewer() - .Parameters(new Parameters { - Editors = new Editors { - SingleSelect = EditorTypes.ComboBox, - MultiSelect = EditorTypes.ComboBox - } - } - )) -``` +{{source=CodeSnippets\MvcCS\Views\Home\ParameterEditorsType.cshtml region=ParameterEditorsTypeExample}} > The `.Parameters` method is optional. If not used, the Telerik Report Viewer will fall back to the [default values](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/api-reference/report-viewer-initialization). diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/how-to-create-a-custom-parameter-editor.md b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/how-to-create-a-custom-parameter-editor.md index 1ec623d19..cc1321f71 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/how-to-create-a-custom-parameter-editor.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/how-to-create-a-custom-parameter-editor.md @@ -67,16 +67,7 @@ function createSingleSelectEditor(placeholder, options) { }; } ```` -````CSHTML -@(Html.TelerikReporting().ReportViewer() - .Id("reportViewer1") - .ParameterEditors( - editors => editors - .SingleSelectEditor("createSingleSelectEditor") - ) -) -```` - +{{source=CodeSnippets\MvcCS\Views\Home\CustomParameterEditors.cshtml region=SingleSelectEditorExample}} If the predefined parameter types are not covering your scenario you can define a CustomParameterEditor. Each custom editor requires two JavaScript functions provided as attributes: `MatchFunction` and `CreateEditorFunction`. @@ -138,20 +129,7 @@ function createCustomEditor(placeholder, options) { Passing the parameter editor to the viewer: -````CSHTML -@(Html.TelerikReporting().ReportViewer() - .Id("reportViewer1") - .ParameterEditors( - editors => editors - .CustomEditors(new CustomParameterEditor - { - MatchFunction = "customMatch", - CreateEditorFunction = "createCustomEditor" - }) - ) -) -```` - +{{source=CodeSnippets\MvcCS\Views\Home\CustomParameterEditors.cshtml region=CustomEditorExample}} > You can use any other custom UI covering the requirements of the `createEditor` method. diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/how-to-pass-values-to-report-parameters.md b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/how-to-pass-values-to-report-parameters.md index 764a67660..546076503 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/how-to-pass-values-to-report-parameters.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/how-to-pass-values-to-report-parameters.md @@ -20,84 +20,61 @@ To give an example we will use the Invoice report from our local examples and wi > All path references in the described steps should be adapted according to your project setup. For more information please refer to the MSDN article [ASP.NET Web Project Paths](). -1. We are going to use one of our demo Visual Studio reports. For this purpose, the demo ReportLibrary project should be built beforehand (see below). Create a new `ASP.NET MVC 4+ Empty Project` and add reference to `[TelerikReporting_InstallDir]\Examples\CSharp|VB\ReportLibrary\bin\[configuration directory]\CSharp|VB.ReportLibrary.dll`. The exact _[configuration directory]_ name depends on the project `Build` configuration. It could be `Debug`, `Release`, etc. - -1. Use the [HTML5 MVC Report Viewer Item Template](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/how-to-use-html5-asp.net-mvc-report-viewer-with-rest-service). - Name the view with the viewer `InvoiceParameters.cshtml|vbhtml`. On **'Configure report source'** step select **'Existing report definition'**, then select **'Select type report definition created in Visual Studio'** and browse _Invoice_ report class. Finish the wizard. - -1. Add MVC Controller item under the project's **Controller** folder and name it `HomeController.cs|vb`, and add an `ActionResult` method named **InvoiceParameters**. Move the `InvoiceParameters.cshtml|vbhtml` file under the newly added **Views\Home** folder. Add a connectiongStrings entry with name `Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString` in the project's `web.config` file. For example: - - ```XML - - - - ``` - - At this point you have a running MVC application that displays a report in the HTML5 MVC Viewer at **[host]/Home/InvoiceParameters** without any modifications. - -1. These are the model and the view model that we will use for our view: - - {{source=CodeSnippets\MvcCS\Models\InvoiceViewModel.cs region=InvoiceViewModel}} - {{source=CodeSnippets\MvcVB\Models\InvoiceViewModel.vb region=InvoiceViewModel}} - - Create new `Invoice.cs|vb` and `InvoiceViewModel.cs|vb` files under **Models** folder and copy the above code snippets. - -1. And this is how we will fill with data our view model before displaying the view with the viewer. For the purpose, open the `HomeController.cs|vb` file and update the _InvoiceParameters_ method as follows: - - {{source=CodeSnippets\MvcCS\Controllers\HomeController.cs region=InvoiceViewModelData}} - {{source=CodeSnippets\MvcVB\Controllers\HomeController.vb region=InvoiceViewModelData}} - -1. Add a custom parameter UI - a dropdown selector with a few values. For the purpose, open the `Views/Home/InvoiceParameters.cshtml|vbhtml` file and add the following lines in the `BODY` element, above the HTML5 Viewer: - - ```CSHTML - @model MyMVCProject.Models.InvoiceViewModel - -
- @Html.LabelFor(m => m.SelectedInvoiceId) - @Html.DropDownListFor( - m => m.SelectedInvoiceId, Model.InvoiceItems, - new { id = "invoiceId", title = "Select the Invoice ID" }) -
- ``` - ```VBHTML - @ModelType MyMVCProject.InvoiceViewModel - -
- @Html.LabelFor( Function(m) m.SelectedInvoiceId) - @Html.DropDownListFor( - Function(m) m.SelectedInvoiceId, - Model.InvoiceItems, - New With { - Key.id = "invoiceId", - Key.title = "Select the Invoice ID" - } - ) -
- ``` - -1. Now, initialize the report viewer. We will use the minimal set of all [possible options](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/api-reference/report-viewer-initialization). Please note how the value from the custom UI is used to set the **OrderNumber** report parameter initially: - - {{source=CodeSnippets\MvcCS\Views\Home\InvoiceParameters.cshtml region=ParametersExample}} - {{source=CodeSnippets\MvcVB\Views\Home\InvoiceParameters.vbhtml region=ParametersExample}} - -1. Add code that updates the ReportSource parameters collection with the selected **Invoice Id** from the dropdown box: - - ```JavaScript - $('#invoiceId').change(function () { - var viewer = $("#reportViewer1").data("telerik_ReportViewer"); - viewer.reportSource({ - report: viewer.reportSource().report, - parameters: { OrderNumber: $("#invoiceId :selected").text() } - }); - //setting the HTML5 Viewer's reportSource, causes a refresh automatically - //if you need to force a refresh for other case, use: - //viewer.refreshReport(); - }); - ``` - -1. Run the project and verify that the **Invoice Id** selection really updates the report. +1. We are going to use one of our demo Visual Studio reports. For this purpose, the demo ReportLibrary project should be built beforehand (see below). Create a new `ASP.NET MVC 4+ Empty Project` and add reference to `[TelerikReporting_InstallDir]\Examples\CSharp|VB\ReportLibrary\bin\[configuration directory]\CSharp|VB.ReportLibrary.dll`. The exact _[configuration directory]_ name depends on the project `Build` configuration. It could be `Debug`, `Release`, etc. + +1. Use the [HTML5 MVC Report Viewer Item Template](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/how-to-use-html5-asp.net-mvc-report-viewer-with-rest-service). + Name the view with the viewer `InvoiceParameters.cshtml|vbhtml`. On **'Configure report source'** step select **'Existing report definition'**, then select **'Select type report definition created in Visual Studio'** and browse _Invoice_ report class. Finish the wizard. + +1. Add MVC Controller item under the project's **Controller** folder and name it `HomeController.cs|vb`, and add an `ActionResult` method named **InvoiceParameters**. Move the `InvoiceParameters.cshtml|vbhtml` file under the newly added **Views\Home** folder. Add a connectiongStrings entry with name `Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString` in the project's `web.config` file. For example: + + ```XML + + + + ``` + + At this point you have a running MVC application that displays a report in the HTML5 MVC Viewer at **[host]/Home/InvoiceParameters** without any modifications. + +1. These are the model and the view model that we will use for our view: + + {{source=CodeSnippets\MvcCS\Models\InvoiceViewModel.cs region=InvoiceViewModel}} + {{source=CodeSnippets\MvcVB\Models\InvoiceViewModel.vb region=InvoiceViewModel}} + + Create new `Invoice.cs|vb` and `InvoiceViewModel.cs|vb` files under **Models** folder and copy the above code snippets. + +1. And this is how we will fill with data our view model before displaying the view with the viewer. For the purpose, open the `HomeController.cs|vb` file and update the _InvoiceParameters_ method as follows: + + {{source=CodeSnippets\MvcCS\Controllers\HomeController.cs region=InvoiceViewModelData}} + {{source=CodeSnippets\MvcVB\Controllers\HomeController.vb region=InvoiceViewModelData}} + +1. Add a custom parameter UI - a dropdown selector with a few values. For the purpose, open the `Views/Home/InvoiceParameters.cshtml|vbhtml` file and add the following lines in the `BODY` element, above the HTML5 Viewer: + + {{source=CodeSnippets\MvcCS\Views\Home\InvoiceParameters.cshtml region=InvoiceParameterSelectorExample}} + {{source=CodeSnippets\MvcVB\Views\Home\InvoiceParameterSelector.vbhtml region=InvoiceParameterSelectorExample}} + +1. Now, initialize the report viewer. We will use the minimal set of all [possible options](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/api-reference/report-viewer-initialization). Please note how the value from the custom UI is used to set the **OrderNumber** report parameter initially: + + {{source=CodeSnippets\MvcCS\Views\Home\InvoiceParameters.cshtml region=ParametersExample}} + {{source=CodeSnippets\MvcVB\Views\Home\InvoiceParameters.vbhtml region=ParametersExample}} + +1. Add code that updates the ReportSource parameters collection with the selected **Invoice Id** from the dropdown box: + + ```JavaScript + $('#invoiceId').change(function () { + var viewer = $("#reportViewer1").data("telerik_ReportViewer"); + viewer.reportSource({ + report: viewer.reportSource().report, + parameters: { OrderNumber: $("#invoiceId :selected").text() } + }); + //setting the HTML5 Viewer's reportSource, causes a refresh automatically + //if you need to force a refresh for other case, use: + //viewer.refreshReport(); + }); + ``` + +1. Run the project and verify that the **Invoice Id** selection really updates the report. ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/manual-setup.md b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/manual-setup.md index 6dee85419..6ed0b12ec 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/manual-setup.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/manual-setup.md @@ -21,13 +21,13 @@ This tutorial shows how to use HTML5 Report Viewer's ASP.NET MVC wrapper in `ASP - Copy of the "Product Catalog.trdp" report file from `C:\Program Files (x86)\Progress\Telerik Reporting {{site.suiteversion}}\Report Designer\Examples` placed in the folder used by the [UriReportSourceResolver](/api/telerik.reporting.services.urireportsourceresolver) in the Reporting REST service implementation. - Entry with the default connection string used by Telerik Reporting sample reports in the `web.config` file of the project hosting the Reporting REST service: - ```XML - - - - ``` + ```XML + + + + ``` * [Kendo UI for jQuery](https://www.telerik.com/kendo-jquery-ui) custom distribution for Telerik Reporting (located in `C:\Program Files (x86)\Progress\Telerik Reporting {{site.suiteversion}}\Html5\ReportViewer\js`) or [Kendo UI for jQuery](https://www.telerik.com/kendo-jquery-ui) mainstream distribution downloaded locally or via the [Reporting CDN service](slug:telerikreporting/getting-started/installation/cdn-assets). You must load only one version of Kendo UI styles and scripts on the page. For more information, see [Kendo Widgets Requirements](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/requirements-and-browser-support#kendo-widgets-requirements). @@ -47,190 +47,89 @@ The following steps produce a view with settings similar to these of the local ` 1. To ensure that the browser will start in the latest rendering mode verify the view's layout page is using the following `DOCTYPE` directive: - ```HTML - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\MvcViewerManualSetup.html region=MvcViewerUsingHtml5AspnetMvcReportViewer}} - > The above `DOCTYPE` directive should be considered with your custom requirements. More details about the one used in the tutorial settings for the page can be found in the [Defining document compatibility]() MSDN article. + > The above `DOCTYPE` directive should be considered with your custom requirements. More details about the one used in the tutorial settings for the page can be found in the [Defining document compatibility]() MSDN article. 1. Initialize the browser’s viewport in the `` element: - ```HTML - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerStyling.html region=Html5ViewerViewportMeta}} - The viewport `META` tag is used to control layout on mobile browsers. + The viewport `META` tag is used to control layout on mobile browsers. 1. The default viewer implementation depends externally on **jQuery**. Create a section named **scripts** and add link to jQuery in the view: - ```CSHTML - @section scripts - { - - } - ``` + {{source=CodeSnippets\MvcCS\Views\Home\LayoutRenderSections_2.cshtml region=JQuerySectionExample}} - > jQuery must be loaded only once on the page. Before adding jQuery, verify that it is not already loaded from elsewhere in the application (layout page, section or bundle). + > jQuery must be loaded only once on the page. Before adding jQuery, verify that it is not already loaded from elsewhere in the application (layout page, section or bundle). 1. Add a reference to a [Telerik Kendo UI SASS-Based Theme](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) in the `` element: - ```HTML - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerStyling.html region=Html5ViewerKendoThemeCss}} 1. Add references to the following assemblies and set their **Copy Local** properties to **true** in Visual Studio: - - `Telerik.Reporting` - - `Telerik.ReportViewer.Mvc` - - `Newtonsoft.Json, Version 13.0.0.0 or higher` + - `Telerik.Reporting` + - `Telerik.ReportViewer.Mvc` + - `Newtonsoft.Json, Version 13.0.0.0 or higher` - The Telerik Reporting assemblies are available by default in the folder `C:\Program Files (x86)\Progress\Telerik Reporting {{site.suiteversion}}\Bin`. + The Telerik Reporting assemblies are available by default in the folder `C:\Program Files (x86)\Progress\Telerik Reporting {{site.suiteversion}}\Bin`. - > Without setting Telerik Reporting references' `Copy Local` to `true`, the assemblies may not be loaded correctly on running the application. + > Without setting Telerik Reporting references' `Copy Local` to `true`, the assemblies may not be loaded correctly on running the application. 1. Update the `web.config` file in the **Views** folder to include the `Telerik.Reporting` and `Telerik.ReportViewer.Mvc` namespaces: - ```XML - - - - - - - - - ``` + ```XML + + + + + + + + + ``` - > Without registering the `Telerik.Reporting` and `Telerik.ReportViewer.Mvc` namespaces you will need to use [using Directive](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-directive) in the view. + > Without registering the `Telerik.Reporting` and `Telerik.ReportViewer.Mvc` namespaces you will need to use [using Directive](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-directive) in the view. 1. Add references to the HTML5 Report Viewer’s JavaScript file in the view: - ```HTML - - ``` - - The report viewer JavaScript should be referenced after any other Kendo widgets or bundles. If no Kendo widgets are utilized on the page, the report viewer will register a custom Kendo subset to enable the required Kendo widgets. The subset is served from the report service. If Kendo is used on the page or the CDN is prefered, please make sure the following widgets are referenced: - - ```HTML - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\MvcViewerManualSetup.html region=MvcViewerUsingHtml5AspnetMvcReportViewer2}} + + The report viewer JavaScript should be referenced after any other Kendo widgets or bundles. If no Kendo widgets are utilized on the page, the report viewer will register a custom Kendo subset to enable the required Kendo widgets. The subset is served from the report service. If Kendo is used on the page or the CDN is prefered, please make sure the following widgets are referenced: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\MvcViewerManualSetup.html region=MvcViewerUsingHtml5AspnetMvcReportViewer3}} 1. Add the HTML5 ASP.NET MVC Report Viewer to the same view: - {{source=CodeSnippets\MvcCS\Views\Home\Index.cshtml region=RazorExample}} - {{source=CodeSnippets\MvcVB\Views\Home\Index.vbhtml region=RazorExample}} + {{source=CodeSnippets\MvcCS\Views\Home\Index.cshtml region=RazorExample}} + {{source=CodeSnippets\MvcVB\Views\Home\Index.vbhtml region=RazorExample}} - > note The above example uses deferred loading of the viewer to allow scripts to be handled properly, in case jQuery is not yet loaded on the page at the time the view is created. The used relative paths must be considered with the project's structure. + > note The above example uses deferred loading of the viewer to allow scripts to be handled properly, in case jQuery is not yet loaded on the page at the time the view is created. The used relative paths must be considered with the project's structure. - > The viewer's `ReportSource` has four overloads allowing to specify report declaratively in code. The generated report's string description is sent and handled on the server by the [report source resolver used in the Reporting REST service](slug:telerikreporting/using-reports-in-applications/host-the-report-engine-remotely/telerik-reporting-rest-services/rest-service-report-source-resolver/overview). The above example uses `UriReportSource` and a path to TRDP file (report created in the Standalone Report Designer). This string description will be handled automatically by the [UriReportSourceResolver](/api/telerik.reporting.services.urireportsourceresolver). + > The viewer's `ReportSource` has four overloads allowing to specify report declaratively in code. The generated report's string description is sent and handled on the server by the [report source resolver used in the Reporting REST service](slug:telerikreporting/using-reports-in-applications/host-the-report-engine-remotely/telerik-reporting-rest-services/rest-service-report-source-resolver/overview). The above example uses `UriReportSource` and a path to TRDP file (report created in the Standalone Report Designer). This string description will be handled automatically by the [UriReportSourceResolver](/api/telerik.reporting.services.urireportsourceresolver). 1. Render the deferred initialization statement for the Report Viewer scripts (remember that they must be rendered after jQuery): In case that you do not need the script tag to be rendered just set to false the default argument. - {{source=CodeSnippets\MvcCS\Views\Home\Index.cshtml region=DeferredScriptsExample}} - {{source=CodeSnippets\MvcVB\Views\Home\Index.vbhtml region=DeferredScriptsExample}} + {{source=CodeSnippets\MvcCS\Views\Home\Index.cshtml region=DeferredScriptsExample}} + {{source=CodeSnippets\MvcVB\Views\Home\Index.vbhtml region=DeferredScriptsExample}} 1. Make the viewer fill the entire browser window. Add the following style in the correspondingly named section in the view: - ```HTML - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\MvcViewerManualSetup.html region=MvcViewerUsingHtml5AspnetMvcReportViewer4}} - > The above CSS rule will be applied on the `
` element holding the viewer object. The HTML elements building the viewer object will be sized based on the size of this container `
` element. To make the viewer fit in other container use relative position, and provide witdh and height values. + > The above CSS rule will be applied on the `
` element holding the viewer object. The HTML elements building the viewer object will be sized based on the size of this container `
` element. To make the viewer fit in other container use relative position, and provide witdh and height values. 1. Open the layout page and call the `RenderSection` helper method in the `` element. The method must be called for each named section in the view with the viewer - _scripts section_ and _styles section_. - ```CSHTML - @RenderSection("styles", required: false) - @RenderSection("scripts", required: false) - ``` + {{source=CodeSnippets\MvcCS\Views\Home\LayoutRenderSections_1.cshtml region=RenderSectionsExample}} 1. Finally the layout page should look like this: - ```CSHTML - - - - Demo - - - @RenderSection("styles", required: false) - @RenderSection("scripts", required: false) - - - @RenderBody() - - - ``` - - The page with the HTML5 ASP.NET MVC Report Viewer should look like this: - - ```CSHTML - @section styles - { - - - - } - - @section scripts - { - - - @(Html.TelerikReporting().DeferredScripts()) - } - @(Html.TelerikReporting().ReportViewer() - .Id("reportViewer1") - .ServiceUrl("/api/reports/") - .ReportSource(new UriReportSource() { Uri = "Product Catalog.trdp" }) - .Deferred() - ) - ``` + {{source=CodeSnippets\MvcCS\Views\Home\LayoutRenderSections.cshtml region=LayoutPageExample}} + + The page with the HTML5 ASP.NET MVC Report Viewer should look like this: + + {{source=CodeSnippets\MvcCS\Views\Home\MvcViewerFullPage.cshtml region=MvcViewerFullPageExample}} 1. Run the project and navigate to the view with the HTML5 ASP.NET MVC Report Viewer that we have just created. diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/reportsource-model-binding.md b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/reportsource-model-binding.md index 38749237c..9c78322e3 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/reportsource-model-binding.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/reportsource-model-binding.md @@ -20,13 +20,8 @@ The HTML5 Report Viewer comes with an MVC wrapper that does the JavaScript confi In case all you need is a report viewer that is used to display various reports, you can have a simple model to create a strongly typed view - you need to use a [client-side report source](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/how-to-set-reportsource-for-report-viewers), like this ([`TypeReportSource`](/api/telerik.reporting.typereportsource) or [`UriReportSource`](/api/telerik.reporting.urireportsource)): -````C# -@model Telerik.Reporting.UriReportSource -```` -````VB -@ModelType Telerik.Reporting.UriReportSource -```` - +{{source=CodeSnippets\MvcCS\Views\Home\SimpleModelBinding.cshtml region=modelUriReportSource}} +{{source=CodeSnippets\MvcVB\Views\Home\SimpleModelBinding.vbhtml region=modelUriReportSource}} Then you can use it directly when you are initializing the report viewer: diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/client-events.md b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/client-events.md index 49add6474..80740d3b7 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/client-events.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/client-events.md @@ -25,11 +25,7 @@ This article explains how to attach client event handlers to an `WebForms` wrapp To attach a client event handler you have to set the proper `ClientEvents` tag as shown below: -````HTML - - - -```` +{{source=CodeSnippets\MvcCS\Views\WebForms\WebFormsViewerMarkup.aspx region=WebFormsViewerClientEvents}} ````JavaScript function onRenderingBegin() { console.log("rendering begin!"); diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/how-to-change-parameter-editors-type.md b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/how-to-change-parameter-editors-type.md index fcb05dffa..0d50ae933 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/how-to-change-parameter-editors-type.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/how-to-change-parameter-editors-type.md @@ -18,13 +18,7 @@ The parameters editors types are defined through the Parameters element when cre The following example illustrates how to set the Parameters method to the Telerik Report Viewer widget. -```HTML - - - - - -``` +{{source=CodeSnippets\MvcCS\Views\WebForms\WebFormsViewerMarkup.aspx region=WebFormsViewerParameterEditorsType}} > The Telerik Report Viewer `Parameters` element is optional. If not used, the Telerik Report Viewer will fall back to the default values. diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/how-to-create-a-custom-parameter-editor.md b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/how-to-create-a-custom-parameter-editor.md index d0c223d08..e636e8fa9 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/how-to-create-a-custom-parameter-editor.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/how-to-create-a-custom-parameter-editor.md @@ -67,19 +67,11 @@ function createSingleSelectEditor(placeholder, options) { }; } ``` -```HTML - - - -``` +{{source=CodeSnippets\MvcCS\Views\WebForms\WebFormsViewerMarkup.aspx region=WebFormsViewerSingleSelectEditor}} The viewer is using a special Kendo subset that contains only the required widgets and the [DropDownList](https://demos.telerik.com/kendo-ui/dropdownlist/index) widget is not part of the subset, additionally the viewer adds jQuery but this happens late in the viewer initialization. Thus, add the following tags to the web page head element as shown in the following code snippet: -```HTML - - - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\WebFormsViewerMarkup.html region=WebFormsViewerKendoDependencies}} If the predefined parameter types are not covering your scenario you can define a CustomParameterEditor. Each custom editor requires two JavaScript functions provided as attributes: **MatchFunction** and **CreateEditorFunction**. @@ -140,14 +132,6 @@ function createCustomEditor(placeholder, options) { Passing the parameter editor to the viewer: -```HTML - - - - - - - -``` +{{source=CodeSnippets\MvcCS\Views\WebForms\WebFormsViewerMarkup.aspx region=WebFormsViewerCustomEditorRegistration}} > You can use any other custom UI covering the requirements of the _CreateEditorFunction_ method. diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/how-to-pass-values-to-report-parameters.md b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/how-to-pass-values-to-report-parameters.md index bea2c50c7..2d951d90c 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/how-to-pass-values-to-report-parameters.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/how-to-pass-values-to-report-parameters.md @@ -38,192 +38,52 @@ To give an example, we will use the Invoice report from our examples and will up 1. Add a connectionStrings entry with name __Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString__ in the project's `web.config` file. For example: - ```XML - - - - ``` - - At this point you have a running Web Forms application that displays a report in the HTML5 Web Forms Report Viewer at **[host]/InvoiceParameters.aspx** without any modifications. - -1. Add code for updating the `ReportSource.Parameters` collection in the code behind: - - ```C# - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - this.reportViewer1.ReportSource.Parameters.Add("OrderNumber", this.invoiceId.Value); - } - } - ``` - {{source=CodeSnippets\MvcVB\Views\WebForms\Html5WebFormsViewer.aspx.vb region=PageLoadPassReportParameters}} - -1. Add the required scripts and stylesheets: - - ```HTML - - - - Telerik HTML5 Web Forms Report Viewer Form - - - - - - ``` - -1. Add the custom parameter UI - a dropdown selector with a few values: - - ```HTML -
- - -
- ``` - -1. Now, initialize the report viewer. We will use the minimal set of all [possible options](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/api-reference/report-viewer-initialization). - - ```HTML - - - - - ``` - -1. Add code that updates the ReportSource parameters collection with the selected **Invoice Id** from the dropdown box: - - ````HTML - - - - - ```` - -1. The HTML page that we have just created should looks like this: - - ```HTML - <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InvoiceParameters.aspx.cs" Inherits="WebFormsDocumentation.InvoiceParameters" %> - //for VB <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="InvoiceParameters.aspx.vb" Inherits="WebFormsDocVB._InvoiceParameters" %> - <%@ Register TagPrefix="telerik" Assembly="Telerik.ReportViewer.Html5.WebForms" Namespace="Telerik.ReportViewer.Html5.WebForms" %> - - - - - Telerik HTML5 Web Forms Report Viewer Form - - - - - - -
-
- - -
- - - - -
- - - - ``` + ```XML + + + + ``` + + At this point you have a running Web Forms application that displays a report in the HTML5 Web Forms Report Viewer at **[host]/InvoiceParameters.aspx** without any modifications. + +1. Add code for updating the `ReportSource.Parameters` collection in the code behind: + + ```C# + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.reportViewer1.ReportSource.Parameters.Add("OrderNumber", this.invoiceId.Value); + } + } + ``` + {{source=CodeSnippets\MvcVB\Views\WebForms\Html5WebFormsViewer.aspx.vb region=PageLoadPassReportParameters}} + +1. Add the required scripts and stylesheets: + + {{source=CodeSnippets\MvcCS\Views\WebForms\WebFormsViewerPassValuesToReportParameters.aspx region=WebFormsViewerPassValuesToReportParameters}} + +1. Add the custom parameter UI - a dropdown selector with a few values: + + {{source=CodeSnippets\MvcCS\Views\WebForms\WebFormsViewerPassValuesToReportParameters.aspx region=WebFormsViewerPassValuesToReportParameters2}} + +1. Now, initialize the report viewer. We will use the minimal set of all [possible options](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/api-reference/report-viewer-initialization). + + {{source=CodeSnippets\MvcCS\Views\WebForms\WebFormsViewerPassValuesToReportParameters.aspx region=WebFormsViewerPassValuesToReportParameters3}} + +1. Add code that updates the ReportSource parameters collection with the selected **Invoice Id** from the dropdown box: + + {{source=CodeSnippets\MvcCS\Views\WebForms\WebFormsViewerPassValuesToReportParameters.aspx region=WebFormsViewerPassValuesToReportParameters4}} + +1. The HTML page that we have just created should looks like this: + + {{source=CodeSnippets\MvcCS\Views\WebForms\WebFormsViewerPassValuesToReportParameters_01.aspx region=WebFormsViewerPassValuesToReportParameters5}} 1. The HTML page that we have just created should look like this: - ````HTML - <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InvoiceParameters.aspx.cs" Inherits="WebFormsDocumentation.InvoiceParameters" %> - //for VB <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="InvoiceParameters.aspx.vb" Inherits="WebFormsDocVB._InvoiceParameters" %> - <%@ Register TagPrefix="telerik" Assembly="Telerik.ReportViewer.Html5.WebForms" Namespace="Telerik.ReportViewer.Html5.WebForms" %> - - - - - Telerik HTML5 Web Forms Report Viewer Form - - - - - - -
-
- - -
- - - > - -
- - - - ```` + {{source=CodeSnippets\MvcCS\Views\WebForms\WebFormsViewerPassValuesToReportParameters_02.aspx region=WebFormsViewerPassValuesToReportParameters6}} 1. Run the project and verify that the __Invoice Id__ selection really updates the report. diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/styling-and-appearance.md b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/styling-and-appearance.md index 787372141..7bfbf8fdd 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/styling-and-appearance.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/styling-and-appearance.md @@ -18,20 +18,7 @@ The required stylesheets are provided automatically through a `HTTPHandler` via Below is an example of how to do that: -```HTML - - - - - - - - - - - - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\WebFormsViewerStyling.html region=WebFormsViewerKendoResources}} The HTML5 Web Forms Report Viewer is using the default viewer template. In order to use your own template, you have to provide path to your customized one to the [TemplateUrl](/api/Telerik.ReportViewer.Html5.WebForms.ReportViewer#Telerik_ReportViewer_Html5_WebForms_ReportViewer_TemplateUrl) property. diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/manual-setup.md b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/manual-setup.md index 6a380dd90..574332e76 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/manual-setup.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/manual-setup.md @@ -18,13 +18,13 @@ previous_url: /html5-webforms-report-viewer-manual-setup - Copy of the "Product Catalog.trdp" report file from `C:\Program Files (x86)\Progress\Telerik Reporting {{site.suiteversion}}\Report Designer\Examples` placed in the folder used by the [UriReportSourceResolver](/api/telerik.reporting.services.urireportsourceresolver) in the Reporting REST service implementation. - Entry with the default connection string used by Telerik Reporting sample reports in the **web.config** file of the project hosting the Reporting REST service: - ```XML - - - - ``` + ```XML + + + + ``` * (Optional) [Kendo UI for jQuery](https://www.telerik.com/kendo-jquery-ui) custom distribution for Telerik Reporting (located in `C:\Program Files (x86)\Progress\Telerik Reporting {{site.suiteversion}}\Html5\ReportViewer\js`) or [Kendo UI for jQuery](https://www.telerik.com/kendo-jquery-ui) mainstream distribution downloaded locally or via the [Reporting CDN service](slug:telerikreporting/getting-started/installation/cdn-assets). You must load only one version of Kendo UI styles and scripts on the page. For more information, see [Kendo Widgets Requirements](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/requirements-and-browser-support#kendo-widgets-requirements). @@ -38,138 +38,54 @@ The following steps produce a view with settings similar to these of the local ` 1. Add new `WebForm` that does not use a `Master` page. 1. Add references to the following assemblies and set their **Copy Local** properties to `true` in Visual Studio: - - **Telerik.Reporting** - - **Telerik.ReportViewer.Html5.WebForms** - - **Newtonsoft.Json, Version 13.0.0.0 or higher** - - The Telerik Reporting assemblies are available by default in the folder `C:\Program Files (x86)\Progress\Telerik Reporting {{site.suiteversion}}\Bin`. - - > Without setting Telerik Reporting references' Copy Local to true the assemblies may not be loaded correctly on running the application. + - **Telerik.Reporting** + - **Telerik.ReportViewer.Html5.WebForms** + - **Newtonsoft.Json, Version 13.0.0.0 or higher** + + The Telerik Reporting assemblies are available by default in the folder `C:\Program Files (x86)\Progress\Telerik Reporting {{site.suiteversion}}\Bin`. + + > Without setting Telerik Reporting references' Copy Local to true the assemblies may not be loaded correctly on running the application. 1. To ensure that the browser will start in the latest rendering mode verify the page is using the following `DOCTYPE` directive: - ```HTML - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\MvcViewerManualSetup.html region=MvcViewerUsingHtml5AspnetMvcReportViewer}} - > The above DOCTYPE directive should be considered with your custom requirements. More details about the used in the tutorial settings for the page can be found in the [Defining document compatibility]() Microsoft article. + > The above DOCTYPE directive should be considered with your custom requirements. More details about the used in the tutorial settings for the page can be found in the [Defining document compatibility]() Microsoft article. 1. Initialize the browser’s viewport in the `` element: - ```HTML - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerStyling.html region=Html5ViewerViewportMeta}} - The viewport META tag is used to control layout on mobile browsers. + The viewport META tag is used to control layout on mobile browsers. 1. (Optional) The default viewer implementation depends externally on **jQuery**. Add link to jQuery in the `` element: - ```HTML - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\WebFormsViewerManualSetup.html region=WebFormsViewerUsingHtml5AspnetWebFormsReportViewerInAWebApplicat}} - > jQuery must be loaded only once on the page. Before adding jQuery, verify that it is not already loaded. + > jQuery must be loaded only once on the page. Before adding jQuery, verify that it is not already loaded. 1. Add a reference to a [Telerik Kendo UI SASS-Based Theme](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) in the `` element: - ```HTML - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerStyling.html region=Html5ViewerKendoThemeCss}} 1. (Optional) Add references to the [Kendo UI for jQuery](https://www.telerik.com/kendo-jquery-ui) scripts in the `` element: - ```HTML - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\WebFormsViewerManualSetup.html region=WebFormsViewerUsingHtml5AspnetWebFormsReportViewerInAWebApplicat2}} 1. Switch to the `Design` view of the Web Form and drag the viewer from Visual Studio Toolbox onto the designer surface. The [ReportsController](slug:telerikreporting/using-reports-in-applications/host-the-report-engine-remotely/telerik-reporting-rest-services/asp.net-web-api-implementation/how-to-implement-the-reportscontroller-in-an-application) will be automatically added to your project, along with references to the required **Telerik Reporting** assemblies. 1. Configure the HTML5 ASP.NET Web Forms Report Viewer's `ReportSource` using Visual Studio Property Grid. For this, you can use the "Product Catalog.trdp" report file. - > If you use an `UriReportSource`, the `Identifier` must point to a TRDP/TRDX file's path that will be mapped to the folder used by the [UriReportSourceResolver](/api/Telerik.Reporting.Services.UriReportSourceResolver) in the Reporting REST service implementation. + > If you use an `UriReportSource`, the `Identifier` must point to a TRDP/TRDX file's path that will be mapped to the folder used by the [UriReportSourceResolver](/api/Telerik.Reporting.Services.UriReportSourceResolver) in the Reporting REST service implementation. - > note Verify the modified settings are written in the markup. If not, the viewer will use the default settings visible in Visual Studio Property Grid. + > note Verify the modified settings are written in the markup. If not, the viewer will use the default settings visible in Visual Studio Property Grid. 1. Set the report viewer `Width` and `Height`. 1. (Optional) If you set the viewer's **Deferred** to **true**, render the deferred initialization statement for the Report Viewer (remember that they must be rendered after jQuery): - ```XML - - ``` + ```XML + + ``` 1. Finally, the `WebForm` may look like the following: - ```HTML - <%@ Register TagPrefix="telerik" Assembly="Telerik.ReportViewer.Html5.WebForms" Namespace="Telerik.ReportViewer.Html5.WebForms" %> - - - - Telerik HTML5 Web Forms Report Viewer Demo - - - > - - - - -
- - - - - - - - -
- - - ``` + {{source=CodeSnippets\MvcCS\Views\WebForms\WebFormsViewerManualSetup.aspx region=WebFormsViewerUsingHtml5AspnetWebFormsReportViewerInAWebApplicat3}} diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/api-reference/data-attributes.md b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/api-reference/data-attributes.md index ab9a803b8..992182090 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/api-reference/data-attributes.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/api-reference/data-attributes.md @@ -25,9 +25,7 @@ Behavior can be added to HTML DOM elements either with `data-` attributes or thr The `data-` attributes allow for adding flexibility to the application since commands can be attached to HTML elements only by adding a `data-command` attribute along with a `data-target-report-viewer` to target the specific report viewer (since there can exist multiple report viewers on a single page): -````HTML - -```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerApi.html region=Html5ViewerDataCommandButton}} When initializing the report viewer, the selector used in `data-target-report-viewer` has to be explicitly provided as an option: diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/api-reference/reportviewer/methods/clearreportsource().md b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/api-reference/reportviewer/methods/clearreportsource().md index 9e723d56b..5e280ca5b 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/api-reference/reportviewer/methods/clearreportsource().md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/api-reference/reportviewer/methods/clearreportsource().md @@ -16,9 +16,7 @@ Clears the current reportSource from the viewer's internal state and its persist Returns: a reference for the reportViewer object. -````HTML - -```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerApi.html region=Html5ViewerClearReportSourceButton}} ````JavaScript $(document).ready(function () { $("#buttonChangeReportSource").on("click", function () { diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/how-to-pass-values-to-report-parameters.md b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/how-to-pass-values-to-report-parameters.md index 7321cc6b8..bf58f83ee 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/how-to-pass-values-to-report-parameters.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/how-to-pass-values-to-report-parameters.md @@ -22,49 +22,15 @@ To give an example we will use the [Invoice](https://demos.telerik.com/reporting 1. Setup the HTML5 Report Viewer dependencies on the page: - ```HTML - - - - Telerik HTML5 Report Viewer - - - - - - - - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerPassValuesToReportParameters.html region=Html5ViewerPassValuesToReportParameters}} 1. Display the custom parameter UI with a selector such as the [select element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/select) with a few values : - ```HTML -
- - - -
- ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerPassValuesToReportParameters.html region=Html5ViewerPassValuesToReportParameters2}} 1. Add the ReportViewer placeholder element: - ```HTML -
- loading... -
- ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerPassValuesToReportParameters.html region=Html5ViewerPassValuesToReportParameters3}} 1. Now, initialize the HTML5 Report Viewer widget. We will use the minimal set of all [possible options](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/api-reference/report-viewer-initialization). Note that the value from the custom UI is used to set the **OrderNumber** report parameter initially: @@ -96,64 +62,7 @@ To give an example we will use the [Invoice](https://demos.telerik.com/reporting 1. The HTML page that we have just created should look like this: - ```HTML - - - - Telerik HTML5 Report Viewer Demo With Custom Parameter - - - - - - - - - - -
- - - -
- -
- loading... -
- - - - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerPassValuesToReportParameters_01.html region=Html5ViewerPassValuesToReportParameters4}} ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/localization.md b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/localization.md index b5179b312..fbd5cb9c3 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/localization.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/localization.md @@ -50,10 +50,7 @@ The article elaborates on how to localize the messages displayed by the HTML5 Re 4. Translate the texts for the specified culture 5. Load the `JS` file with the translated text before loading the report viewer: - ```HTML - - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerLocalization.html region=Html5ViewerSetup}} > To modify the HTML5 Viewer's HTML template that contains the toolbar, preview, parameters, and document map areas, and so on, you will need to create a custom template, which you can provide to the viewer through its `templateUrl` property. >
diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/overview.md b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/overview.md index c8ff3be52..ff5589984 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/overview.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/overview.md @@ -25,22 +25,18 @@ For reference, you can use the templates located in **%programfiles(x86)%\Progre $("#reportViewer1") .telerik_ReportViewer({ serviceUrl: "/api/reports/", - templateUrl: "/custom-templates-directory/templates/telerikReportViewerTemplate-{{buildversion}}.html" + templateUrl: "/custom-templates-directory/templates/telerikReportViewerTemplate-{{site.buildversion}}.html" }); ``` The template relies on the [Kendo UI SASS Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) to provide layout settings and the color schema for the HTML5 Report Viewer: -```HTML - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerStyling.html region=Html5ViewerKendoThemeCss}} The default report viewer template and stylesheet depend on CSS media queries to adapt its layout according to the device and display. For the media queries to be activated properly, the browser’s viewport needs to be configured as follows: -```HTML - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerStyling.html region=Html5ViewerViewportMeta}} ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/providing-custom-templates.md b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/providing-custom-templates.md index eab956ec2..6ec848be8 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/providing-custom-templates.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/providing-custom-templates.md @@ -28,20 +28,7 @@ $("#reportViewer1").telerik_ReportViewer({ The HTML template file is essentially a page that includes HTML document fragments nested inside __template__ tags. For example, this is what the report parameter template looks like: -````HTML - -```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerTemplates.html region=Html5ViewerParameterTemplate}} The templates are loaded during the initialization of the __telerik_ReportViewer__ widget. Since this is an asynchronous network operation(the template HTML is loaded with an `HTTP GET` request) that takes an unpredictable amount of time, the widget is not functional until the template is loaded successfully. diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/templates-overview.md b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/templates-overview.md index b9dc0d85c..8ef35cd60 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/templates-overview.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/templates-overview.md @@ -26,9 +26,7 @@ All these elements of the HTML5 Report Viewer are provided through the __trv-rep While loading the template content, the widget looks for elements marked with the data-role attribute and maps its value to a [jQuery plugin function](https://plugins.jquery.com/) that provides the element behavior. For example: -````HTML -
-```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerTemplates.html region=Html5ViewerTemplateDataRole}} is mapped to: diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/how-to-use-html5-report-viewer-in-an-asp.net-core-in-.net-5-application.md b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/how-to-use-html5-report-viewer-in-an-asp.net-core-in-.net-5-application.md index d0e94b0da..fc84c4663 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/how-to-use-html5-report-viewer-in-an-asp.net-core-in-.net-5-application.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/how-to-use-html5-report-viewer-in-an-asp.net-core-in-.net-5-application.md @@ -39,68 +39,23 @@ If you wish to connect the Report Viewer to a Report Server instance, refer to t ## Manual Configuration of the HTML5 Report Viewer -1. This tutorial uses the `Barcodes Report.trdp` report definitions file that must be located in a `Reports` folder inside the project. -1. Make sure that the app configuration inside the `Configure` method of the `Startup.cs` can serve static files: - - ```C# - app.UseStaticFiles(); - ``` - -1. Add an HTML Page for the HTML5 Report Viewer by right-clicking on _wwwroot_ and **Add > New Item... > HTML Page**. Name the file **index.html** and add the HTML5 Report Viewer's initialization. - - For a detailed explanation, check the HTML5 Report Viewer [Manual Setup](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/manual-setup) help article. The required references to jQuery and Telerik Kendo UI CSS and JS files are listed in the example below. - - By default, the necessary Report Viewer scripts and styles are served by the REST Service. The complete report viewer page should look like this: - - ```HTML - - - - Telerik HTML5 Report Viewer Demo in ASP.NET Core in .NET {{site.mindotnetversion}}+ - - - - - - - - - - - -
- loading... -
- - - - ``` - -1. Set the _launchSettings.json_ `launchUrl` to the new HTML page. -1. Finally, run the project to see the report. +1. This tutorial uses the `Barcodes Report.trdp` report definitions file that must be located in a `Reports` folder inside the project. +1. Make sure that the app configuration inside the `Configure` method of the `Startup.cs` can serve static files: + + ```C# + app.UseStaticFiles(); + ``` + +1. Add an HTML Page for the HTML5 Report Viewer by right-clicking on _wwwroot_ and **Add > New Item... > HTML Page**. Name the file **index.html** and add the HTML5 Report Viewer's initialization. + + For a detailed explanation, check the HTML5 Report Viewer [Manual Setup](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/manual-setup) help article. The required references to jQuery and Telerik Kendo UI CSS and JS files are listed in the example below. + + By default, the necessary Report Viewer scripts and styles are served by the REST Service. The complete report viewer page should look like this: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerUseHtml5ReportViewerInAnAspnetCoreInNet5Application.html region=Html5ViewerManualConfigurationOfTheHtml5ReportViewer}} + +1. Set the _launchSettings.json_ `launchUrl` to the new HTML page. +1. Finally, run the project to see the report. ## Demo project diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/how-to-use-html5-report-viewer-with-report-server.md b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/how-to-use-html5-report-viewer-with-report-server.md index 234949262..df476000e 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/how-to-use-html5-report-viewer-with-report-server.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/how-to-use-html5-report-viewer-with-report-server.md @@ -63,7 +63,7 @@ Although the fastest and most convenient way to get a working HTML5 viewer in yo $("#reportViewer1") .telerik_ReportViewer({ serviceUrl: "/api/reports/", - templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate-{{buildversion}}.html', + templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate-{{site.buildversion}}.html', reportSource: { report: "Telerik.Reporting.Examples.CSharp.ProductCatalog, CSharp.ReportLibrary", parameters: { @@ -97,7 +97,7 @@ Although the fastest and most convenient way to get a working HTML5 viewer in yo username: null, password: null }, - //templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate-{{buildversion}}.html', + //templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate-{{site.buildversion}}.html', reportSource: { // The report value should contain the Category and ReportName in the following format // {Category/ReportName} diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/html5-report-viewer-with-report-server-net.md b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/html5-report-viewer-with-report-server-net.md index 75dfb89f5..601d0a4b5 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/html5-report-viewer-with-report-server-net.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/html5-report-viewer-with-report-server-net.md @@ -26,77 +26,77 @@ Follow the steps below to set up your HTML5 Report Viewer to work with the Teler 1. Use the following code instead of `serviceUrl: "/api/reports/",` to connect to the Report Server for .NET rather than to a Reporting REST Service: - ```JavaScript - reportServer: { - url: "https://yourReportServerUrl:port", - getPersonalAccessToken: function() { - return Promise.resolve(""); - } - }, - ``` - - > caution The `serviceUrl` option shouldn't be present, or the viewer would default to no authentication scheme utilizing the Report Server for .NET as a regular Reporting REST Service. - - Substitute the `https://yourReportServerUrl:port` with the actual url of your Report Server for .NET instance, along with the port if needed. - - To authenticate against the Report Server for .NET you have the following options: - - - (**recommended**) The `reportServer.getPersonalAccessToken` option should be set to a function returning the Token of the user who is logging in to the Report Server for .NET wrapped in a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). Here is a sample implementation that relies on a dedicated secure endpoint '/rs-token' to return the token: - - ```JavaScript - reportServer: { - url: "https://yourReportServerUrl:port", - getPersonalAccessToken: function() { - return fetch('/rs-token') - .then(response => response.text()) - } - }, - ``` - - Server-side, you may configure the endpoint, as shown below, after ensuring the EnvironmentVariable 'RS_NET_TOKEN' is set up correctly. We strongly recommend securing the endpoint: - - ```C# - app.MapGet("/rs-token", (HttpContext context) => - { - return Environment.GetEnvironmentVariable("RS_NET_TOKEN") ?? string.Empty; - }) - .RequireAuthorization(); - ``` - - - (_not recommended_) Alternatively, you may use a hardcoded _username_ and _password_ instead of Token authentication. We do not recommend this for security reasons: - - ```JavaScript - reportServer: { - url: "https://yourReportServerUrl:port", - username: "", - password: "" - }, - ``` - - > caution The Guest User may connect to the Report Server for .NET only with a Token. It doesn't have a password and cannot connect to the Report Server for .NET with Null credentials, as the Report Server for .NET Framework 4.6.2. + ```JavaScript + reportServer: { + url: "https://yourReportServerUrl:port", + getPersonalAccessToken: function() { + return Promise.resolve(""); + } + }, + ``` + + > caution The `serviceUrl` option shouldn't be present, or the viewer would default to no authentication scheme utilizing the Report Server for .NET as a regular Reporting REST Service. + + Substitute the `https://yourReportServerUrl:port` with the actual url of your Report Server for .NET instance, along with the port if needed. + + To authenticate against the Report Server for .NET you have the following options: + + - (**recommended**) The `reportServer.getPersonalAccessToken` option should be set to a function returning the Token of the user who is logging in to the Report Server for .NET wrapped in a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). Here is a sample implementation that relies on a dedicated secure endpoint '/rs-token' to return the token: + + ```JavaScript + reportServer: { + url: "https://yourReportServerUrl:port", + getPersonalAccessToken: function() { + return fetch('/rs-token') + .then(response => response.text()) + } + }, + ``` + + Server-side, you may configure the endpoint, as shown below, after ensuring the EnvironmentVariable 'RS_NET_TOKEN' is set up correctly. We strongly recommend securing the endpoint: + + ```C# + app.MapGet("/rs-token", (HttpContext context) => + { + return Environment.GetEnvironmentVariable("RS_NET_TOKEN") ?? string.Empty; + }) + .RequireAuthorization(); + ``` + + - (_not recommended_) Alternatively, you may use a hardcoded _username_ and _password_ instead of Token authentication. We do not recommend this for security reasons: + + ```JavaScript + reportServer: { + url: "https://yourReportServerUrl:port", + username: "", + password: "" + }, + ``` + + > caution The Guest User may connect to the Report Server for .NET only with a Token. It doesn't have a password and cannot connect to the Report Server for .NET with Null credentials, as the Report Server for .NET Framework 4.6.2. 1. Locate the lines that set the report source's report definition (it should start with `report: "...`). Replace them with the following line: `report: "{Category}/{ReportName}"`, where `{Category}` and `{ReportName}` are the actual names of the category and report that can be accessed by the User you have provided Token or login credentials for. Set up the report parameters if needed. 1. The initialization should look like the following: - ```JavaScript - $("#reportViewer1") - .telerik_ReportViewer({ - reportServer: { - url: "https://yourReportServerUrl:port", - getPersonalAccessToken: function() { - return Promise.resolve(""); - } - }, - reportSource: { - // The report value should contain the Category and ReportName in the following format - // {Category/ReportName} - report: "Samples/Dashboard", - parameters: { - ReportYear: 2004 - } - } - }); - ``` + ```JavaScript + $("#reportViewer1") + .telerik_ReportViewer({ + reportServer: { + url: "https://yourReportServerUrl:port", + getPersonalAccessToken: function() { + return Promise.resolve(""); + } + }, + reportSource: { + // The report value should contain the Category and ReportName in the following format + // {Category/ReportName} + report: "Samples/Dashboard", + parameters: { + ReportYear: 2004 + } + } + }); + ``` 1. Run the project, and you should see the report configured in the previous step appearing in the Report Viewer. @@ -104,5 +104,4 @@ Follow the steps below to set up your HTML5 Report Viewer to work with the Teler - [HTML5 Report Viewer](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/overview) - [How To: Use HTML5 Report Viewer With REST Service](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/how-to-use-html5-report-viewer-with-rest-service) -- [Telerik Report Server for .NET](https://docs.telerik.com/report-server/dotnet-docs/overview) -- [Tokens Authentication in Report Server for .NET](https://docs.telerik.com/report-server/dotnet-docs/token-authentication) +- [Telerik Report Server for .NET](https://docs.telerik.com/report-server/dotnet-docs/overview)- [Tokens Authentication in Report Server for .NET](https://docs.telerik.com/report-server/dotnet-docs/token-authentication) diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/manual-setup.md b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/manual-setup.md index 42cc33dae..31a51a489 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/manual-setup.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/manual-setup.md @@ -25,177 +25,65 @@ Before you continue, make sure that the following prerequisites are met: 1. A script with the custom [Kendo UI for jQuery](https://www.telerik.com/kendo-jquery-ui) distribution for Telerik Reporting (located in the **[TelerikReporting_InstallDir]\Html5\ReportViewer\js** folder) or with the mainstream Kendo UI distribution downloaded locally or via the [Kendo UI CDN service](https://docs.telerik.com/kendo-ui/intro/installation/cdn-service). 1. (Optional) If [programmatic type reports](slug:telerikreporting/designing-reports/overview#programmatic-types) are used, add a reference from the project that hosts the Reporting REST service to the `Reports Library` project with the reports. - > You must load only one version of [Kendo UI for jQuery](https://www.telerik.com/kendo-jquery-ui) styles and scripts on the page - [Kendo Widgets Requirements](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/requirements-and-browser-support#KendoWidgetsRequirements). + > You must load only one version of [Kendo UI for jQuery](https://www.telerik.com/kendo-jquery-ui) styles and scripts on the page - [Kendo Widgets Requirements](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/requirements-and-browser-support#KendoWidgetsRequirements). ## Utilizing the HTML5 Report Viewer The following steps produce an HTML page with settings similar to these in the integration demo projects installed by default under `C:\Program Files (x86)\Progress\Telerik Reporting {{site.suiteversion}}\Examples\CSharp\`: -1. Create an HTML5 page: - - ```HTML - - - - Telerik HTML5 Report Viewer - - - - - ``` - -1. Initialize the browser’s viewport in the `` element: - - ```HTML - - ``` - - The viewport `META` tag is used to control the layout on mobile browsers. - -1. Add a reference to jQuery in the `` element: - - ```HTML - - ``` - - > jQuery must be loaded before creating the viewer object.jQuery must be loaded only once on the page. - - > jQuery must be loaded before creating the viewer object.jQuery must be loaded only once on the page. - -1. Add references to the Kendo UI Sass styles in the `` element: - - ```HTML - - ``` - -1. Add references to the HTML5 Report Viewer JavaScript file in the `` element: - - ```HTML - - ``` - - > The report viewer JavaScript must be referenced after any other Kendo UI for jQuery widgets or bundles. - - If no **Kendo** widgets are utilized on the page, the report viewer will register a custom Kendo subset to enable the required Kendo widgets. The subset is served from the report service. If Kendo is used on the page or the CDN is preferred, make sure the following widgets are referenced: - - ```HTML - - ``` - -1. Add a `
` element to the `` element that will serve as a placeholder for the viewer’s widget. The `
` element's ID attribute serves as a key(Id) for the viewer object. Its content (_loading..._) will be displayed while the viewer’s content is being loaded (from the template): - - ```HTML -
- loading... -
- ``` - -1. Add the following script element at the bottom of the `` element and initialize the HTML5 Report Viewer widget through the reportViewer1 `
` element that we added above: - - ```HTML - - ``` - - > The viewer's **reportSource** consists of report and parameters attributes, where **report** is the string description of the report that will be displayed, and **parameters** is a collection of parameter keys and values that will be sent to the report. The report's string description is handled on the server by the [report source resolver used in the Reporting REST service](slug:telerikreporting/using-reports-in-applications/host-the-report-engine-remotely/telerik-reporting-rest-services/rest-service-report-source-resolver/overview). - -1. Make the viewer fill the entire browser window. Add the following style to the `` element: - - ```HTML - - ``` - - > The above CSS rule will be applied on the `
` element holding the viewer object. The HTML elements building the viewer object will be sized based on the size of this container `
` element. To make the viewer fit in another container, use _position:relative_ and provide width and height values. - - > The above CSS rule will be applied to the `
` element holding the viewer object. The HTML elements building the viewer object will be sized based on the size of this container `
` element. To make the viewer fit in another container, use _position:relative_ and provide width and height values. - - ```HTML - - - - Telerik HTML5 Report Viewer - - - - - - - -
- loading... -
- - - - ``` - -1. Run the project and navigate to the page with the HTML5 Report Viewer that we have just created. +1. Create an HTML5 page: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerManualSetup.html region=Html5ViewerUtilizingTheHtml5ReportViewer}} + +1. Initialize the browser’s viewport in the `` element: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerStyling.html region=Html5ViewerViewportMeta}} + + The viewport `META` tag is used to control the layout on mobile browsers. + +1. Add a reference to jQuery in the `` element: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\WebFormsViewerManualSetup.html region=WebFormsViewerUsingHtml5AspnetWebFormsReportViewerInAWebApplicat}} + + > jQuery must be loaded before creating the viewer object.jQuery must be loaded only once on the page. + + > jQuery must be loaded before creating the viewer object.jQuery must be loaded only once on the page. + +1. Add references to the Kendo UI Sass styles in the `` element: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerStyling.html region=Html5ViewerKendoThemeCss}} + +1. Add references to the HTML5 Report Viewer JavaScript file in the `` element: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerManualSetup_01.html region=Html5ViewerUtilizingTheHtml5ReportViewer2}} + + > The report viewer JavaScript must be referenced after any other Kendo UI for jQuery widgets or bundles. + + If no **Kendo** widgets are utilized on the page, the report viewer will register a custom Kendo subset to enable the required Kendo widgets. The subset is served from the report service. If Kendo is used on the page or the CDN is preferred, make sure the following widgets are referenced: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerManualSetup_01.html region=Html5ViewerUtilizingTheHtml5ReportViewer3}} + +1. Add a `
` element to the `` element that will serve as a placeholder for the viewer’s widget. The `
` element's ID attribute serves as a key(Id) for the viewer object. Its content (_loading..._) will be displayed while the viewer’s content is being loaded (from the template): + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerPassValuesToReportParameters.html region=Html5ViewerPassValuesToReportParameters3}} + +1. Add the following script element at the bottom of the `` element and initialize the HTML5 Report Viewer widget through the reportViewer1 `
` element that we added above: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerManualSetup_01.html region=Html5ViewerUtilizingTheHtml5ReportViewer4}} + + > The viewer's **reportSource** consists of report and parameters attributes, where **report** is the string description of the report that will be displayed, and **parameters** is a collection of parameter keys and values that will be sent to the report. The report's string description is handled on the server by the [report source resolver used in the Reporting REST service](slug:telerikreporting/using-reports-in-applications/host-the-report-engine-remotely/telerik-reporting-rest-services/rest-service-report-source-resolver/overview). + +1. Make the viewer fill the entire browser window. Add the following style to the `` element: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerManualSetup_01.html region=Html5ViewerUtilizingTheHtml5ReportViewer5}} + + > The above CSS rule will be applied on the `
` element holding the viewer object. The HTML elements building the viewer object will be sized based on the size of this container `
` element. To make the viewer fit in another container, use _position:relative_ and provide width and height values. + + > The above CSS rule will be applied to the `
` element holding the viewer object. The HTML elements building the viewer object will be sized based on the size of this container `
` element. To make the viewer fit in another container, use _position:relative_ and provide width and height values. + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerManualSetup_02.html region=Html5ViewerUtilizingTheHtml5ReportViewer6}} + +1. Run the project and navigate to the page with the HTML5 Report Viewer that we have just created. ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/using-in-razor-pages-app.md b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/using-in-razor-pages-app.md index c248b3530..2d4127c2d 100644 --- a/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/using-in-razor-pages-app.md +++ b/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/using-in-razor-pages-app.md @@ -33,101 +33,51 @@ If you wish to connect the Report Viewer to a Report Server instance, refer to t ## Manual Configuration in Razor Pages Apps -1. This tutorial relies on having already created an **ASP.NET Core Razor Pages** application. If such is not present, follow the [Get started with Razor Pages in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/razor-pages-start) as the first step. -1. Make sure that the app configuration inside the `Configure` method of the `Startup.cs` can serve static files: - - ```C# - app.UseStaticFiles(); - ``` - -1. Add a new razor page to the **Pages** directory of the _Razor Pages_ application, and create a `ReportSourceModel` class in the `.cshtml.cs` file, which will be used to provide the report name and parameters. - - ```C# - public class ReportSourceModel : PageModel - { - private static readonly JsonSerializerOptions serializerOptions = new JsonSerializerOptions() - { - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, - PropertyNamingPolicy = JsonNamingPolicy.CamelCase - }; - - private readonly ILogger _logger; - - public required string Report { get; set; } - - public Dictionary Parameters { get; } = new Dictionary(); - - public string Serialize() - { - return JsonSerializer.Serialize(new { this.Report, this.Parameters }, serializerOptions); - } - - public ReportSourceModel(ILogger logger) - { - this._logger = logger; - } - - public void OnGet() - { - } - } - ``` - -1. In the razor page's `.cshtml` file, initialize the HTML5 Report Viewer and pass the `ReportSourceModel` from the `@model`: - - ```CSHTML - @page - @model ReportSourceModel - @{ - ViewData["Title"] = "Telerik HTML5 Report Viewer Demo"; - Model.Report = "Barcodes Report.trdp"; - //Model.Parameters.Add("ParameterName", ParameterValue); - } - @section Scripts { - - Teleirk HTML5 Report Viewer in ASP.NET Core Razor Pages App - - - - - - -
- loading... -
- @{ - var reportSourceModel = Html.Raw(Model.Serialize()); - } - - - } - ``` - -1. Run the application and navigate to the razor page with the [HTML5 Report Viewer](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/overview) to verify that it loads successfully. +1. This tutorial relies on having already created an **ASP.NET Core Razor Pages** application. If such is not present, follow the [Get started with Razor Pages in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/razor-pages-start) as the first step. +1. Make sure that the app configuration inside the `Configure` method of the `Startup.cs` can serve static files: + + ```C# + app.UseStaticFiles(); + ``` + +1. Add a new razor page to the **Pages** directory of the _Razor Pages_ application, and create a `ReportSourceModel` class in the `.cshtml.cs` file, which will be used to provide the report name and parameters. + + ```C# + public class ReportSourceModel : PageModel + { + private static readonly JsonSerializerOptions serializerOptions = new JsonSerializerOptions() + { + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + PropertyNamingPolicy = JsonNamingPolicy.CamelCase + }; + + private readonly ILogger _logger; + + public required string Report { get; set; } + + public Dictionary Parameters { get; } = new Dictionary(); + + public string Serialize() + { + return JsonSerializer.Serialize(new { this.Report, this.Parameters }, serializerOptions); + } + + public ReportSourceModel(ILogger logger) + { + this._logger = logger; + } + + public void OnGet() + { + } + } + ``` + +1. In the razor page's `.cshtml` file, initialize the HTML5 Report Viewer and pass the `ReportSourceModel` from the `@model`: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\RazorPagesReportViewer.cshtml region=RazorPagesReportViewerExample}} + +1. Run the application and navigate to the razor page with the [HTML5 Report Viewer](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/overview) to verify that it loads successfully. ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/api-reference/commands.md b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/api-reference/commands.md index e20681b12..64a3ce28c 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/api-reference/commands.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/api-reference/commands.md @@ -29,90 +29,8 @@ The Native Angular Report Viewer exposes the ability to trigger various commands The following example illustrates a list of all the available commands in the viewer, and how they may be invoked: -````HTML - - - -
- -
-```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { ReportSourceOptions } from '@progress/telerik-common-report-viewer' - -interface commandButtons { - name: string; - commandName: string; - commandValue?: any -} - -@Component({ - selector: 'app-root', - styles: [`.func-btn-wrapper { - display: flex; - flex-direction: row; - flex-wrap: wrap; - gap: 1rem; - padding: 2rem; - padding-top: 0.5rem; - margin-top: 2rem; - justify-content: center; - align-items: center; - border-top: 1px solid #7e7d7d; - }`], - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] -}) - -export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - reportSource: ReportSourceOptions = { report: "Dashboard.trdx", parameters: { ReportYear: 2004 } }; - serviceUrl: string = "https://demos.telerik.com/reporting/api/reports"; - - public buttons: Array = [ - { name: 'navigateBackward', commandName: 'navigateBackward' }, - { name: 'navigateForward', commandName: 'navigateForward' }, - { name: 'stopRendering', commandName: 'stopRendering' }, - { name: 'refreshReport', commandName: 'refreshReport' }, - { name: 'navigateToFirstPage', commandName: 'navigateToFirstPage' }, - { name: 'navigateToPrevPage', commandName: 'navigateToPrevPage' }, - { name: 'navigateToNextPage', commandName: 'navigateToNextPage' }, - { name: 'navigateToLastPage', commandName: 'navigateToLastPage' }, - { name: 'toggleDocumentMap', commandName: 'toggleDocumentMap' }, - { name: 'toggleParametersSection', commandName: 'toggleParametersSection' }, - { name: 'setViewMode', commandName: 'setViewMode' }, - { name: 'zoomIn', commandName: 'zoomIn' }, - { name: 'zoomOut', commandName: 'zoomOut' }, - { name: 'setScaleMode', commandName: 'setScaleMode', commandValue: { scale: 3, scaleMode: 'Specific' } }, - { name: 'setReportSource', commandName: 'setReportSource', commandValue: { report: 'Invoice.trdx', parameters: { OrderNumber: 'SO51088' }}}, - { name: 'exportReport', commandName: 'exportReport', commandValue: 'csv' }, - { name: 'setAuthenticationToken', commandName: 'setAuthenticationToken', commandValue: 'Sample Authentication Token' }, - { name: 'printReport', commandName: 'printReport' }, - { name: 'toggleSearchWindow', commandName: 'toggleSearchWindow' }, - { name: 'toggleAiPromptWindow', commandName: 'toggleAiPromptWindow' }, - ] - - public execute(commandName: string, commandValue?: any): void { - this.viewer.executeCommand(commandName, commandValue); - } -} -```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerCommands.html region=NativeAngularViewerCommandButtons}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerCommands.ts region=NativeAngularViewerCommands}} ## Commands List diff --git a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/api-reference/events.md b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/api-reference/events.md index 5063d42b0..a718ded9c 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/api-reference/events.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/api-reference/events.md @@ -28,880 +28,152 @@ In this article, we will go over each of the currently available events, showcas The `updateUI` event will be emitted when the state of the viewer changes. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - updateUI() { - console.log("This event handler will be called when the state of the viewer changes."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerUpdateUIEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_updateUI.ts region=NativeAngularViewerEvents_updateUI}} ### printStarted The `printStarted` event will be emitted when the printing starts. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { PrintStartedEventArgs } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - printStarted(printStartedEventArgs: PrintStartedEventArgs) { - console.log("This event will be emitted when the printing starts.", printStartedEventArgs); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerPrintStartedEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_printStarted.ts region=NativeAngularViewerEvents_printStarted}} ### printDocumentReady The `printDocumentReady` event will be emitted after the viewer finishes printing the report. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { PrintDocumentReadyEventArgs } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - printDocumentReady(printDocumentReadyEventArgs: PrintDocumentReadyEventArgs) { - console.log("This event will be emitted after the viewer finishes printing the report.", printDocumentReadyEventArgs); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerPrintDocumentReadyEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_printDocumentReady.ts region=NativeAngularViewerEvents_printDocumentReady}} ### exportStarted The `exportStarted` event will be emitted when an export operation is triggered. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { ExportStartedEventArgs } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - exportStarted(exportStartedEventArgs: ExportStartedEventArgs) { - console.log("This event will be emitted when an export operation is triggered.", exportStartedEventArgs); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerExportStartedEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_exportStarted.ts region=NativeAngularViewerEvents_exportStarted}} ### exportDocumentReady The `exportDocumentReady` event will be emitted after the viewer finishes exporting the report. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { ExportDocumentReadyEventArgs } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - exportDocumentReady(exportDocumentReadyEventArgs: ExportDocumentReadyEventArgs) { - console.log("This event will be emitted after the viewer finishes exporting the report.", exportDocumentReadyEventArgs); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerExportDocumentReadyEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_exportDocumentReady.ts region=NativeAngularViewerEvents_exportDocumentReady}} ### beforeLoadReport The `beforeLoadReport` event will be emitted before the rendering of a report begins. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - beforeLoadReport() { - console.log("This event will be emitted before the rendering of a report begins."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerBeforeLoadReportEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_beforeLoadReport.ts region=NativeAngularViewerEvents_beforeLoadReport}} ### beginLoadReport The `beginLoadReport` event will be emitted after the rendering of a report begins. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - beginLoadReport() { - console.log("This event will be emitted after the rendering of a report begins."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerBeginLoadReportEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_beginLoadReport.ts region=NativeAngularViewerEvents_beginLoadReport}} ### reportLoadProgress The `reportLoadProgress` event will be emitted after each successful [`Get Document Info`](slug:telerikreporting/using-reports-in-applications/host-the-report-engine-remotely/telerik-reporting-rest-services/rest-api-reference/documents-api/get-document-info) request until the report rendering is complete. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { DocumentInfo } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - reportLoadProgress(e: DocumentInfo) { - console.log("The e parameter will contain the current information for the report rendering progress.", e); - console.log("This event will be emitted after each successful Get Document Info request until the report rendering is complete."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerReportLoadProgressEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_reportLoadProgress.ts region=NativeAngularViewerEvents_reportLoadProgress}} ### reportLoadComplete The `reportLoadComplete` event will be emitted after the rendering of a report ends. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { DocumentInfo } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - reportLoadComplete(e: DocumentInfo) { - console.log("The document information such as the page count, where it has document map, etc. will ve sent via the e object.", e); - console.log("This event will be emitted after the rendering of a report ends."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerReportLoadCompleteEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_reportLoadComplete.ts region=NativeAngularViewerEvents_reportLoadComplete}} ### renderingStopped The `renderingStopped` event will be emitted when report rendering is cancelled. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - renderingStopped() { - console.log("This event will be emitted when report rendering is cancelled."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerRenderingStoppedEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_renderingStopped.ts region=NativeAngularViewerEvents_renderingStopped}} ### error The `error` event will be emitted when viewer encounters an error. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - error(e: string) { - console.log("This event will be emitted when viewer encounters an error."); - console.log("The error message", e); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerErrorEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_error.ts region=NativeAngularViewerEvents_error}} ### loadedReportChange The `loadedReportChange` event will be emitted when the previewed report is __changed__ or __refreshed__. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - loadedReportChange() { - console.log("This event will be emitted when the loaded report is changed."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerLoadedReportChangeEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_loadedReportChange.ts region=NativeAngularViewerEvents_loadedReportChange}} ### pageReady The `pageReady` event will be emitted when the viewer content has been loaded from the template and is ready to display reports or perform any other operations on it. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { PageInfo } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - pageReady(e: PageInfo) { - console.log("The current page information such as the page number, the page content, etc.", e) - console.log("This event will be emitted when the viewer content has been loaded from the template and is ready to display reports or perform any other operations on it."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerPageReadyEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_pageReady.ts region=NativeAngularViewerEvents_pageReady}} ### navigateToReport The `navigateToReport` event will be emitted when the viewer navigates to a new report through the [`Drillthrough/Navigate To Report Action`](slug:telerikreporting/designing-reports/adding-interactivity-to-reports/actions/drillthrough-report-action). -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - navigateToReport(e: any) { - console.log("The report source object of the newly loaded report", e) - console.log("This event will be emitted when the viewer navigates to a new report through the Drillthrough/Navigate To Report action."); - }; - } -```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerNavigateToReportEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_navigateToReport.ts region=NativeAngularViewerEvents_navigateToReport}} ### currentPageChanged The `currentPageChanged` event will be emitted when the viewer changes its currently displayed page. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { CurrentPageChangedEventArgs } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - currentPageChanged(currentPageChangedEventArgs: CurrentPageChangedEventArgs) { - console.log("The page number and document id.", currentPageChangedEventArgs); - console.log("This event will be emitted when the viewer changes its currently displayed page."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerCurrentPageChangedEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_currentPageChanged.ts region=NativeAngularViewerEvents_currentPageChanged}} ### interactiveActionEnter The `interactiveActionEnter` event will be emitted when the cursor hovers over an interactive action. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { PageActionEventArgs } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - interactiveActionEnter(interactiveActionArgs: PageActionEventArgs) { - console.log("The interactive action arguments.", interactiveActionArgs); - console.log("This event will be emitted when the cursor hovers over an interactive action."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerInteractiveActionEnterEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_interactiveActionEnter.ts region=NativeAngularViewerEvents_interactiveActionEnter}} ### interactiveActionExecuting The `interactiveActionExecuting` event will be emitted before an interactive action is executed. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { PageActionEventArgs } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - interactiveActionExecuting(pageActionEventArgs: PageActionEventArgs) { - console.log("This event will be emitted before an interactive action is executed.", pageActionEventArgs); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerInteractiveActionExecutingEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_interactiveActionExecuting.ts region=NativeAngularViewerEvents_interactiveActionExecuting}} ### interactiveActionLeave The `interactiveActionLeave` event will be emitted when the cursor leaves the interactive action area. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { PageActionEventArgs } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - interactiveActionLeave(interactiveActionArgs: PageActionEventArgs) { - console.log("The interactive action arguments.", interactiveActionArgs); - console.log("This event will be emitted when the cursor leaves the interactive action area."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerInteractiveActionLeaveEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_interactiveActionLeave.ts region=NativeAngularViewerEvents_interactiveActionLeave}} ### toolTipOpening The `toolTipOpening` event will be emitted when a tooltip is opened. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { TooltipEventArgs } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - toolTipOpening(tooltipEventArgs: TooltipEventArgs) { - console.log("The tooltip arguments.", tooltipEventArgs); - console.log("This event will be emitted when a tooltip is opened."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerToolTipOpeningEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_toolTipOpening.ts region=NativeAngularViewerEvents_toolTipOpening}} ### toolTipClosing The `toolTipClosing` event will be emitted when a tooltip is closed. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { TooltipEventArgs } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - toolTipClosing(tooltipEventArgs: TooltipEventArgs) { - console.log("The tooltip arguments.", tooltipEventArgs); - console.log("This event will be emitted when a tooltip is closed."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerToolTipClosingEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_toolTipClosing.ts region=NativeAngularViewerEvents_toolTipClosing}} ### reportVersionMismatch The `reportVersionMismatch` event will be emitted when there is a mismatch between the version of the viewer and the reporting service. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - reportVersionMismatch() { - console.log("This event will be emitted when there is mismatch between the version of the viewer and the reporting service."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerReportVersionMismatchEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_reportVersionMismatch.ts region=NativeAngularViewerEvents_reportVersionMismatch}} ### parametersLoaded The `parametersLoaded` event will be emitted after the [`Get Report Parameters `](slug:telerikreporting/using-reports-in-applications/host-the-report-engine-remotely/telerik-reporting-rest-services/rest-api-reference/report-parameters-api/get-report-parameters) is made. -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { ReportParameterInfo } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - parametersLoaded(e: ReportParameterInfo[]) { - console.log("An array of the parameter values is sent via the event object.", e); - console.log("This event will be emitted after the Get Report Parameters request is made."); - }; - } -```` - +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerEvents.html region=NativeAngularViewerParametersLoadedEvent}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerEvents_parametersLoaded.ts region=NativeAngularViewerEvents_parametersLoaded}} diff --git a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/api-reference/options.md b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/api-reference/options.md index 29a01a668..b1ebb150f 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/api-reference/options.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/api-reference/options.md @@ -34,35 +34,8 @@ Below is the list of all options available during initialization for the Native The options can be set from the `.HTML`/`.TS` component file or both(combined): -````HTML - - -```` -````TypeScript -import { Component, ViewChild } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { ReportSourceOptions } from '@progress/telerik-common-report-viewer' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - reportSource: ReportSourceOptions = { report: "Dashboard.trdx", parameters: { ReportYear: 2004 } }; - serviceUrl: string = "https://demos.telerik.com/reporting/api/reports"; - } -```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerOptions.html region=NativeAngularViewerOptionsInit}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerOptions.ts region=NativeAngularViewerOptions}} ## Options diff --git a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/customizing/passing-parameter-values.md b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/customizing/passing-parameter-values.md index 6ac40468a..d774b26f4 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/customizing/passing-parameter-values.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/customizing/passing-parameter-values.md @@ -20,36 +20,8 @@ The report identifier and all required parameter values for it are packed in a ` The following example will demonstrate how a [select](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) control outside of the [Native Angular Report Viewer](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/native-angular-report-viewer/overview) can have its `selected` value passed to the report viewer's `reportSource`: -```HTML - - - - -``` -```TypeScript -export class AppComponent { - @ViewChild('report') public report: ReportingAngularViewerComponent; - - onChange(OrderNumber: string) { - this.report.executeCommand("setReportSource", { - report: "Invoice.trdx", - parameters: { - OrderNumber - } - }) - } -} -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerCustomizing.html region=NativeAngularViewerPassingParameters}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\CustomizeNativeAngularViewer.ts region=CustomizeNativeAngularViewer_PassingParameterValues}} ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/customizing/toolbar-icons.md b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/customizing/toolbar-icons.md index 5890edefb..ce6a5041f 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/customizing/toolbar-icons.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/customizing/toolbar-icons.md @@ -53,40 +53,8 @@ In the component with the report viewer, `import` the [`@progress/kendo-svg-icon In the below example, we will demonstrate how to change the 'Stop Rendering' button's default icon: -````HTML - - -```` -````TypeScript -import { Component, ViewChild, AfterViewInit } from '@angular/core'; -import { ReportingAngularViewerComponent } from '@progress/telerik-angular-native-report-viewer' -import { ReportSourceOptions } from '@progress/telerik-common-report-viewer' -import { xOutlineIcon } from '@progress/kendo-svg-icons' - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] - }) - - export class AppComponent implements AfterViewInit { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - - ngAfterViewInit(){ - this.viewer.xCircleIcon = xOutlineIcon; - } - } -```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerCustomizing.html region=NativeAngularViewerToolbarIcons}} +{{source=CodeSnippets\Blazor\Docs\TypeScript\CustomizeNativeAngularViewer.ts region=CustomizeNativeAngularViewer_ToolbarIcons}} ## Toolbar Icons List diff --git a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-report-server-net.md b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-report-server-net.md index 889cc460b..331a6c0e2 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-report-server-net.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-report-server-net.md @@ -26,94 +26,62 @@ The user account that will authenticate with the Report Server may be any User, 1. Install the Native Angular Report Viewer NPM package with the following command: - ```powershell - npm install @progress/telerik-angular-native-report-viewer - ``` + ```powershell + npm install @progress/telerik-angular-native-report-viewer + ``` - > If you receive a _403 Forbidden Error_, you need to register and log in at [npmjs.com](https://www.npmjs.com/) before performing this step. - > - > ```powershell - > npm login --registry=https://registry.npmjs.org --scope=@progress - > ``` + > If you receive a _403 Forbidden Error_, you need to register and log in at [npmjs.com](https://www.npmjs.com/) before performing this step. + > + > ```powershell + > npm login --registry=https://registry.npmjs.org --scope=@progress + > ``` 1. Once installed, import the `ReportingAngularViewerModule` in [your application root module](https://angular.io/guide/ngmodules#!#angular-modularity): - ```TypeScript - import { ReportingAngularViewerModule } from '@progress/telerik-angular-native-report-viewer'; - - @NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule, - BrowserAnimationsModule, - AppRoutingModule, - ReportingAngularViewerModule - ], - providers: [], - bootstrap: [AppComponent] - }) - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerWithReportServer.ts region=NativeAngularViewerImportModuleWithReportServer}} 1. Install the Angular `localize` package - [Add the localize package](https://angular.io/guide/i18n-common-add-package#add-the-localize-package) - ```powershell - ng add @angular/localize - ``` + ```powershell + ng add @angular/localize + ``` 1. Install one of the [Kendo UI for Angular themes](https://www.telerik.com/kendo-angular-ui/components/styling/), e.g. the [Default Theme](https://www.telerik.com/kendo-angular-ui/components/styling/theme-default/) - ```powershell - npm install --save @progress/kendo-theme-default - ``` + ```powershell + npm install --save @progress/kendo-theme-default + ``` 1. Reference the theme in the project using one of the supported approaches - [Compiling Themes from SCSS Source Files](https://www.telerik.com/kendo-angular-ui/components/styling/#toc-compiling-themes-from-scss-source-files). In this example, we will use the approach with the `angular.json` configuration, which consists of adding the desired theme inside the `styles` array - [Angular workspace configuration: Styles and scripts configuration](https://angular.io/guide/workspace-config#styles-and-scripts-configuration): - ```JSON - "styles": [ - "src/styles.scss", - "node_modules/@progress/kendo-theme-default/dist/default-ocean-blue.scss" - ], - ``` + ```JSON + "styles": [ + "src/styles.scss", + "node_modules/@progress/kendo-theme-default/dist/default-ocean-blue.scss" + ], + ``` 1. In the class of the component(e.g. `AppComponent`) where the viewer will be displayed, define a `reportSource` object property specifying the category and the name of the report that will be displayed. For example, if the category is **Samples** and the report is **Dashboard**, the syntax will look as follows: - ```TS - reportSource = { - report: 'Samples/Dashboard', - parameters: {} - } - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithReportServerNet_1.ts region=AngularViewerImportWithReportServerRestService}} 1. In the same component class, define a `reportServer` object property with a `url` string pointing to the Report Server for .NET, and a `getPersonalAccessToken` callback, which will be executed when the report viewer requests from the server to render the report. - ```TS - reportServer = { - url: 'http://dnikolovlap:81/', - getPersonalAccessToken: () => fetch('/rs-token').then(response => response.text()) - } - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\AngularViewerWithReportServerNet_1.ts region=AngularViewerImportWithReportServerReportServer}} - In this example, the `getPersonalAccessToken` callback makes a request to a _/rs-token_ endpoint that returns the token used to authorize access to using the Report Server for .NET REST API. + In this example, the `getPersonalAccessToken` callback makes a request to a _/rs-token_ endpoint that returns the token used to authorize access to using the Report Server for .NET REST API. - This is the **recommended** approach, but if an endpoint cannot be exposed, the token can be hardcoded in the callback: `getPersonalAccessToken: () => Promise.resolve('TOKEN_STRING')` + This is the **recommended** approach, but if an endpoint cannot be exposed, the token can be hardcoded in the callback: `getPersonalAccessToken: () => Promise.resolve('TOKEN_STRING')` 1. In the HTML template of the component, define the `` element, and pass the defined properties to their corresponding properties of the Native Angular Report Viewer: - ```HTML - - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerUseWithReportServerNet.html region=NativeAngularViewerSteps}} 1. Run the application: - ```powershell - ng serve - ``` + ```powershell + ng serve + ``` ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-report-server.md b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-report-server.md index bccc8761d..b1b72c2ac 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-report-server.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-report-server.md @@ -26,81 +26,50 @@ The following list describes the prerequisites for this tutorial: 1. Create a new Angular application using the [Angular CLI](https://angular.io/cli). 1. Install the Native Angular Report Viewer NPM package with the following command: - ```powershell - npm install @progress/telerik-angular-native-report-viewer - ``` + ```powershell + npm install @progress/telerik-angular-native-report-viewer + ``` - > If you receive a _403 Forbidden Error_, you need to register and log in at [npmjs.com](https://www.npmjs.com/) before performing this step. - > - > ```powershell - > npm login --registry=https://registry.npmjs.org --scope=@progress - > ``` + > If you receive a _403 Forbidden Error_, you need to register and log in at [npmjs.com](https://www.npmjs.com/) before performing this step. + > + > ```powershell + > npm login --registry=https://registry.npmjs.org --scope=@progress + > ``` 1. Once installed, import the `ReportingAngularViewerModule` in [your application root module](https://angular.io/guide/ngmodules#!#angular-modularity): - ```TypeScript - import { ReportingAngularViewerModule } from '@progress/telerik-angular-native-report-viewer'; - - @NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule, - BrowserAnimationsModule, - AppRoutingModule, - ReportingAngularViewerModule - ], - providers: [], - bootstrap: [AppComponent] - }) - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerWithReportServer.ts region=NativeAngularViewerImportModuleWithReportServer}} 1. Use the report viewer selector - `reporting-angular-viewer` in the component's template: - ```HTML - - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerUseWithReportServer.html region=NativeAngularViewerSteps2}} 1. Install the Angular `localize` package - [Add the localize package](https://angular.io/guide/i18n-common-add-package#add-the-localize-package). This is required for the report viewer's localization functionality - ```powershell - ng add @angular/localize - ``` + ```powershell + ng add @angular/localize + ``` 1. Install one of the [Kendo UI for Angular themes](https://www.telerik.com/kendo-angular-ui/components/styling/), e.g. the [Default Theme](https://www.telerik.com/kendo-angular-ui/components/styling/theme-default/) - ```powershell - npm install --save @progress/kendo-theme-default - ``` + ```powershell + npm install --save @progress/kendo-theme-default + ``` 1. Reference the theme in the project using one of the supported approaches - [Compiling Themes from SCSS Source Files](https://www.telerik.com/kendo-angular-ui/components/styling/#toc-compiling-themes-from-scss-source-files). In this example, we will use the approach with the `angular.json` configuration which consists of adding the desired theme inside the `styles` array - [Angular workspace configuration: Styles and scripts configuration](https://angular.io/guide/workspace-config#styles-and-scripts-configuration): - ```JSON - "styles": [ - "src/styles.scss", - "node_modules/@progress/kendo-theme-default/dist/default-ocean-blue.scss" - ], - ``` + ```JSON + "styles": [ + "src/styles.scss", + "node_modules/@progress/kendo-theme-default/dist/default-ocean-blue.scss" + ], + ``` 1. Run the application `start` script - ```powershell - npm run start - ``` + ```powershell + npm run start + ``` ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-reporting-service.md b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-reporting-service.md index c3d8cd31a..0162da64c 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-reporting-service.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-reporting-service.md @@ -23,80 +23,53 @@ The following list describes the prerequisites for completing the tutorial: ### Steps: -1. Create a new Angular application using the [Angular CLI](https://angular.io/cli). -1. Install the Native Angular Report Viewer NPM package with the following command: - - ```powershell - npm install @progress/telerik-angular-native-report-viewer - ``` - - > If you receive a _403 Forbidden Error_, you need to register and log in at [npmjs.com](https://www.npmjs.com/) before performing this step. - > - > ```powershell - > npm login --registry=https://registry.npmjs.org --scope=@progress - > ``` - -1. Once installed, import the `ReportingAngularViewerModule` in [your application root module](https://angular.io/guide/ngmodules#!#angular-modularity): - - ```TypeScript - import { ReportingAngularViewerModule } from '@progress/telerik-angular-native-report-viewer'; - - @NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule, - AppRoutingModule, - BrowserAnimationsModule, - ReportingAngularViewerModule - ], - providers: [], - bootstrap: [AppComponent] - }) - ``` - -1. Use the report viewer selector - `reporting-angular-viewer` in the component's template: - - ```HTML - - - ``` - -1. Install the Angular `localize` package - [Add the localize package](https://angular.io/guide/i18n-common-add-package#add-the-localize-package). This is required for the report viewer's localization functionality - - ```powershell - ng add @angular/localize - ``` - -1. Install one of the [Kendo UI for Angular themes](https://www.telerik.com/kendo-angular-ui/components/styling/), e.g. the [Default Theme](https://www.telerik.com/kendo-angular-ui/components/styling/theme-default/) - - ```powershell - npm install --save @progress/kendo-theme-default - ``` - -1. Reference the theme in the project using one of the supported approaches - [Compiling Themes from SCSS Source Files](https://www.telerik.com/kendo-angular-ui/components/styling/#toc-compiling-themes-from-scss-source-files). In this example, we will use the approach with the `angular.json` configuration which consists of adding the desired theme inside the `styles` array - [Angular workspace configuration: Styles and scripts configuration](https://angular.io/guide/workspace-config#styles-and-scripts-configuration): - - ```JSON - "styles": [ - "src/styles.scss", - "node_modules/@progress/kendo-theme-default/dist/default-ocean-blue.scss" - ], - ``` - -1. Run the application `start` script: - - ```powershell - npm run start - ``` +1. Create a new Angular application using the [Angular CLI](https://angular.io/cli). +1. Install the Native Angular Report Viewer NPM package with the following command: + + ```powershell + npm install @progress/telerik-angular-native-report-viewer + ``` + + > If you receive a _403 Forbidden Error_, you need to register and log in at [npmjs.com](https://www.npmjs.com/) before performing this step. + > + > ```powershell + > npm login --registry=https://registry.npmjs.org --scope=@progress + > ``` + +1. Once installed, import the `ReportingAngularViewerModule` in [your application root module](https://angular.io/guide/ngmodules#!#angular-modularity): + + {{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerWithReportingService.ts region=NativeAngularViewerImportModuleWithReportingService}} + +1. Use the report viewer selector - `reporting-angular-viewer` in the component's template: + + {{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerUseWithReportingService.html region=NativeAngularViewerSteps3}} + +1. Install the Angular `localize` package - [Add the localize package](https://angular.io/guide/i18n-common-add-package#add-the-localize-package). This is required for the report viewer's localization functionality + + ```powershell + ng add @angular/localize + ``` + +1. Install one of the [Kendo UI for Angular themes](https://www.telerik.com/kendo-angular-ui/components/styling/), e.g. the [Default Theme](https://www.telerik.com/kendo-angular-ui/components/styling/theme-default/) + + ```powershell + npm install --save @progress/kendo-theme-default + ``` + +1. Reference the theme in the project using one of the supported approaches - [Compiling Themes from SCSS Source Files](https://www.telerik.com/kendo-angular-ui/components/styling/#toc-compiling-themes-from-scss-source-files). In this example, we will use the approach with the `angular.json` configuration which consists of adding the desired theme inside the `styles` array - [Angular workspace configuration: Styles and scripts configuration](https://angular.io/guide/workspace-config#styles-and-scripts-configuration): + + ```JSON + "styles": [ + "src/styles.scss", + "node_modules/@progress/kendo-theme-default/dist/default-ocean-blue.scss" + ], + ``` + +1. Run the application `start` script: + + ```powershell + npm run start + ``` ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-standalone-components.md b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-standalone-components.md index 329906276..74779580c 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-standalone-components.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/how-to-use-with-standalone-components.md @@ -26,91 +26,54 @@ The following list describes the prerequisites for completing the tutorial: 1. Create a new Angular application using the [Angular CLI](https://angular.dev/tools/cli). 1. Enable Angular Animations in the project by following the [Enabling the animations module](https://angular.dev/guide/animations#enabling-the-animations-module) article. For example, the `provideAnimations` function can be invoked in the `bootstrapApplication` function call in `app.config.ts`: - ```TypeScript - import { ApplicationConfig } from '@angular/core'; - import { provideRouter } from '@angular/router'; - import { routes } from './app.routes'; - import { provideAnimations } from '@angular/platform-browser/animations'; - - export const appConfig: ApplicationConfig = { - providers: [provideRouter(routes), provideAnimations()] - }; - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerStandaloneAppConfig.ts region=NativeAngularViewerStandaloneAppConfig}} 1. Install the `Native Angular Report Viewer` NPM package with the following command: - ```powershell - npm install @progress/telerik-angular-native-report-viewer - ``` + ```powershell + npm install @progress/telerik-angular-native-report-viewer + ``` - > If you receive a _403 Forbidden Error_, you need to register and log in at [npmjs.com](https://www.npmjs.com/) before performing this step. - > - > ```powershell - > npm login --registry=https://registry.npmjs.org --scope=@progress - > ``` + > If you receive a _403 Forbidden Error_, you need to register and log in at [npmjs.com](https://www.npmjs.com/) before performing this step. + > + > ```powershell + > npm login --registry=https://registry.npmjs.org --scope=@progress + > ``` 1. Once installed, `import` the `ReportingAngularViewerModule` in one of your standalone components of choice - [Importing in Standalone components](https://angular.dev/guide/components/importing#standalone-components): - ```TypeScript - import { Component, ViewChild } from '@angular/core'; - import { RouterOutlet } from '@angular/router'; - import { ReportingAngularViewerComponent, ReportingAngularViewerModule } from '@progress/telerik-angular-native-report-viewer' - - @Component({ - selector: 'app-root', - standalone: true, - imports: [RouterOutlet, ReportingAngularViewerModule], - templateUrl: './app.component.html', - styleUrl: './app.component.scss' - }) - export class AppComponent { - title = 'Native Angular Report Viewer Demo'; - - @ViewChild('viewer') public viewer!: ReportingAngularViewerComponent; - } - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerStandaloneAppComponent.ts region=NativeAngularViewerStandaloneAppComponent}} 1. Use the report viewer selector - `reporting-angular-viewer` in the component's template: - ```HTML - - - ``` + {{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeAngularViewerUseWithStandaloneComponents.html region=NativeAngularViewerSteps4}} 1. Install the Angular `localize` package - [Add the localize package](https://angular.io/guide/i18n-common-add-package#add-the-localize-package). This is required for the report viewer's localization functionality - ```powershell - ng add @angular/localize - ``` + ```powershell + ng add @angular/localize + ``` 1. Install one of the [Kendo UI for Angular themes](https://www.telerik.com/kendo-angular-ui/components/styling/), e.g. the [Default Theme](https://www.telerik.com/kendo-angular-ui/components/styling/theme-default/) - ```powershell - npm install --save @progress/kendo-theme-default - ``` + ```powershell + npm install --save @progress/kendo-theme-default + ``` 1. Reference the theme in the project using one of the supported approaches - [Compiling Themes from SCSS Source Files](https://www.telerik.com/kendo-angular-ui/components/styling/#toc-compiling-themes-from-scss-source-files). In this example, we will use the approach with the `angular.json` configuration which consists of adding the desired theme inside the `styles` array - [Angular workspace configuration: Styles and scripts configuration](https://angular.io/guide/workspace-config#styles-and-scripts-configuration): - ```JSON - "styles": [ - "src/styles.scss", - "node_modules/@progress/kendo-theme-default/dist/default-ocean-blue.scss" - ], - ``` + ```JSON + "styles": [ + "src/styles.scss", + "node_modules/@progress/kendo-theme-default/dist/default-ocean-blue.scss" + ], + ``` 1. Run the application `start` script: - ```powershell - npm run start - ``` + ```powershell + npm run start + ``` ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/integrating-with-project-item-generator.md b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/integrating-with-project-item-generator.md index 25633d609..dee10166c 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/integrating-with-project-item-generator.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-angular-report-viewer/integrating-with-project-item-generator.md @@ -26,89 +26,44 @@ The following list describes the prerequisites for completing the tutorial: 1. Install the Native Angular Report Viewer Schematic NPM package with the following command: - ```powershell - npm install @progress/telerik-reporting-schematics - ``` + ```powershell + npm install @progress/telerik-reporting-schematics + ``` - > If you receive a _403 Forbidden Error_, you need to register and log in at [npmjs.com](https://www.npmjs.com/) before performing this step. - > - > ```powershell - > npm login --registry=https://registry.npmjs.org --scope=@progress - > ``` + > If you receive a _403 Forbidden Error_, you need to register and log in at [npmjs.com](https://www.npmjs.com/) before performing this step. + > + > ```powershell + > npm login --registry=https://registry.npmjs.org --scope=@progress + > ``` 1. Right-click where you want to add the new report viewer component and select the "New Telerik Reporting Angular Project Item" option. - ![VS Code context menu option location - last](images/vs-code-context-menu-option.png) + ![VS Code context menu option location - last](images/vs-code-context-menu-option.png) 1. The scaffolding wizard will open, showing the available component options. Set the `Service url` option to the URL of your Reporting REST Service API, the `Report` option to the report you wish to preview, and click `Create`. If you do not set these options, the [Public Reporting Demos](https://demos.telerik.com/reporting) API will be used and the report will be "Report Catalog.trdx". - ![VS Code Telerik Reporting Project Item Generator](images/vs-code-telerik-reporting-project-item-generator.png) + ![VS Code Telerik Reporting Project Item Generator](images/vs-code-telerik-reporting-project-item-generator.png) 1. Import the new component generated by the wizard. - If you have an Angular 16 _(or earlier)_ application, you may import the component in [your application root module](https://angular.io/guide/ngmodules#!#angular-modularity). Ensure the `BrowserAnimationsModule` is imported as well. - - ```TypeScript - import { NgModule } from '@angular/core'; - import { BrowserModule } from '@angular/platform-browser'; - import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; - import { ReportViewerPageComponent } from './report-viewer-page/report-viewer-page.component'; - import { AppComponent } from './app.component'; - - @NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule, - BrowserAnimationsModule, - ReportViewerPageComponent - ], - providers: [], - bootstrap: [AppComponent] - }) - - export class AppModule { } - ``` - - If you have an Angular 17 application, you can import the component in your `app.component.ts` file. - - ```TypeScript - import { Component } from '@angular/core'; - import { RouterOutlet } from '@angular/router'; - import { ReportViewerPageComponent } from './report-viewer-page/report-viewer-page.component'; - - @Component({ - selector: 'app-root', - standalone: true, - imports: [ RouterOutlet, ReportViewerPageComponent ], - templateUrl: './app.component.html', - styleUrl: './app.component.scss' - }) - export class AppComponent { - title = 'my-angular-application'; - } - ``` + If you have an Angular 16 _(or earlier)_ application, you may import the component in [your application root module](https://angular.io/guide/ngmodules#!#angular-modularity). Ensure the `BrowserAnimationsModule` is imported as well. -1. If you have an Angular 17 application, import `provideAnimations` from `@angular/platform-browser/animations` in `app.config.ts`. + {{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerIntegratingAppModule.ts region=NativeAngularViewerIntegratingAppModule}} + + If you have an Angular 17 application, you can import the component in your `app.component.ts` file. - ```TypeScript - import { ApplicationConfig } from '@angular/core'; - import { provideRouter } from '@angular/router'; - import { provideAnimations } from '@angular/platform-browser/animations' - import { routes } from './app.routes'; + {{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerIntegratingStandaloneAppComponent.ts region=NativeAngularViewerIntegratingStandaloneAppComponent}} + +1. If you have an Angular 17 application, import `provideAnimations` from `@angular/platform-browser/animations` in `app.config.ts`. - export const appConfig: ApplicationConfig = { - providers: [provideRouter(routes), provideAnimations()] - }; - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\NativeAngularViewerIntegratingAppConfig.ts region=NativeAngularViewerIntegratingAppConfig}} 1. Utilize the selector of the new report viewer component somewhere in the application. 1. Run the application `start` script: - ```powershell - npm run start - ``` + ```powershell + npm run start + ``` ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/api-reference/commands.md b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/api-reference/commands.md index 3a87072e6..5766af16e 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/api-reference/commands.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/api-reference/commands.md @@ -42,34 +42,7 @@ All commands, except for the `Export` command, require a single argument for thi For example, the `Refresh` and `Export` commands of the current report can be triggered like this: -```RAZOR - - - - - - -@code { - public ReportViewer ViewerInstance { get; set; } - - void RefreshReport() - { - ViewerInstance.ExecuteCommand("Refresh"); - } - void Export() - { - ViewerInstance.ExecuteCommand("Export", "PDF"); - } - - void SetToken() - { - ViewerInstance.ExecuteCommand("SetAuthenticationToken", "SAMPLE_TOKEN"); - } -} -``` +{{source=CodeSnippets\BlazorNative\Docs\ReportViewers\NativeBlazorViewerCommands.razor region=NativeViewerExecuteCommand}} ## Commands List diff --git a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/api-reference/events.md b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/api-reference/events.md index 3c79be130..1837fefa9 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/api-reference/events.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/api-reference/events.md @@ -19,26 +19,7 @@ Occurs before rendering the report. _The event is triggered only on preview. The This event has one argument of type `RenderingBeginEventArgs` which represents the device information settings that will be used for the rendering of the report in the `HTML5`/`HTML5Interactive` format. Sample usage: -```RAZOR - - -@code { - ReportViewer reportViewer1; - public ReportSourceOptions ReportSource { get; set; } = new ReportSourceOptions("Report Catalog.trdx", new Dictionary{}); - - void RenderingBegin(RenderingBeginEventArgs args) - { - // Enable search in the rendered document - args.EnableSearch = true; //default value - } -} -``` +{{source=CodeSnippets\BlazorNative\Docs\ReportViewers\NativeBlazorViewerOnRenderingBegin.razor region=NativeViewerOnRenderingBegin}} ## OnRenderingEnd @@ -47,26 +28,7 @@ This event has one argument of type `RenderingEndEventArgs` which represents the Sample usage: -```RAZOR - - -@code { - ReportViewer reportViewer1; - public ReportSourceOptions ReportSource { get; set; } = new ReportSourceOptions("Report Catalog.trdx", new Dictionary{}); - - async Task RenderingEnd(RenderingEndEventArgs args) - { - // Display alert with the page count of the rendered report - await JsRuntime.InvokeVoidAsync("alert", $"The total page count of rendered report is: {args.PageCount}"); - } -} -``` +{{source=CodeSnippets\BlazorNative\Docs\ReportViewers\NativeBlazorViewerOnRenderingEnd.razor region=NativeViewerOnRenderingEnd}} ## OnExportStart @@ -78,30 +40,7 @@ Occurs before exporting the report. This event has one argument of type `ExportS Sample usage: -```RAZOR - - -@code { - ReportViewer reportViewer1; - public ReportSourceOptions ReportSource { get; set; } = new ReportSourceOptions("Report Catalog.trdx", new Dictionary{}); - - async Task ExportStart(ExportStartEventArgs args) - { - // Cancel CSV exporting - if(args.Format == "CSV") - { - args.IsCancelled = true; - await JsRuntime.InvokeVoidAsync("alert", $"Exporting the report in the {args.Format} format is disabled"); - } - } -} -``` +{{source=CodeSnippets\BlazorNative\Docs\ReportViewers\NativeBlazorViewerOnExportStart.razor region=NativeViewerOnExportStart}} ## OnExportEnd @@ -114,29 +53,7 @@ Occurs after exporting the report. This event has one argument of type `ExportEn Sample usage: -```RAZOR - - -@code { - ReportViewer reportViewer1; - public ReportSourceOptions ReportSource { get; set; } = new ReportSourceOptions("Report Catalog.trdx", new Dictionary{}); - - void ExportEnd(ExportEndEventArgs args) - { - // Change the window's open target - if(args.Format == "PDF") - { - args.WindowOpenTarget = "_blank"; - } - } -} -``` +{{source=CodeSnippets\BlazorNative\Docs\ReportViewers\NativeBlazorViewerOnExportEnd.razor region=NativeViewerOnExportEnd}} ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/customizing/how-to-create-custom-parameter-editors.md b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/customizing/how-to-create-custom-parameter-editors.md index 5561974bc..800a97d92 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/customizing/how-to-create-custom-parameter-editors.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/customizing/how-to-create-custom-parameter-editors.md @@ -34,66 +34,7 @@ A custom editor can be set for one or more parameter templates. Each parameter t The following examples use the default editors that we ship the report viewer with. -```RAZOR - - - - - - - - - - - - - - - - - - - - - - - - - - - @{ var selectedValue = ((IEnumerable)context.Parameter.Value).Cast().ToList(); } - - - - - -``` +{{source=CodeSnippets\BlazorNative\Docs\ReportViewers\NativeBlazorViewerCustomParameterEditors.razor region=NativeViewerDefaultParameterTemplates}} > note The example serves to give example for each parameter template, since these are the default editors that we already ship with, there is no need to implement this. @@ -101,60 +42,7 @@ The following examples use the default editors that we ship the report viewer wi Let's try to use a widget that the Native Blazor Report Viewer is not able to use out of the box. For this example, we will use the Telerik Blazor UI's [`ListView`](https://demos.telerik.com/blazor-ui/listview/overview) widget. The code is as follows: -```RAZOR - - - - - - - - @{ - var selectedValue = ((IEnumerable)context.Parameter.Value)?.Cast()?.ToList(); - } - - - - - - -@code { - public ReportSourceOptions ReportSource { get; set; } = new ReportSourceOptions("Dashboard.trdp", new Dictionary{}); - - void MultiSelectParameterTemplateItemClick(ReportParameterContext reportParameterContext, object reportParameterValue) - { - var selectedValue = ((IEnumerable)reportParameterContext.Parameter.Value).Cast().ToList(); - - if (selectedValue.Contains(reportParameterValue)) - { - selectedValue.Remove(reportParameterValue); - } - else - { - selectedValue.Add(reportParameterValue); - } - - reportParameterContext.Value = selectedValue; - } -} -``` +{{source=CodeSnippets\BlazorNative\Docs\ReportViewers\NativeBlazorViewerCustomParameterEditors.razor region=NativeViewerListViewParameterEditor}} In this example, we set the `ListView` widget to be used for both the `ParameterSingleSelectTemplate` and `ParameterMultiSelectTemplate` templates which means that all report parameters with available values will be rendered using the `ListView` widget, regardless of the type of the report parameter(string, DateTime, etc.) diff --git a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/customizing/toolbar-customization.md b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/customizing/toolbar-customization.md index 5db1181c9..d7048ebe8 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/customizing/toolbar-customization.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/customizing/toolbar-customization.md @@ -45,38 +45,7 @@ The predefined set of all available tools is accessible from the `Telerik.Report Use the `Tools` [option of the viewer](slug:telerikreporting/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/api-reference/options#options) to pass a custom ordered list of Tools for the Toolbar. For example, the below code removes the _Search_, _SendEmail_ and _zoom_ functionalities from the viewer and moves the _Refresh_ in the beginning of the toolbar: -```RAZOR -@page "/" - -@using Telerik.ReportViewer.BlazorNative.Tools - - - - -@code { - public ReportSourceOptions ReportSource { get; set; } = new ReportSourceOptions("Report Catalog.trdp", new Dictionary {}); - public List Tools = new List - { - new Refresh(), - new NavigateBackward(), - new NavigateForward(), - new StopRendering(), - new FirstPage(), - new PreviousPage(), - new PageNumber(), - new NextPage(), - new LastPage(), - new ToggleViewMode(), - new Export(), - new Print(), - new ToggleDocumentMap(), - new ToggleParametersArea() - }; -} -``` +{{source=CodeSnippets\BlazorNative\Docs\ReportViewers\NativeBlazorViewerToolbarCustomization.razor region=NativeViewerCustomToolbar}} ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/customizing/tooltips-customization.md b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/customizing/tooltips-customization.md index 7d35b1957..b63284d79 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/customizing/tooltips-customization.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/customizing/tooltips-customization.md @@ -31,18 +31,7 @@ The Blazor Native Report Viewer provides two data attributes, which hold informa The following example shows how to set a tooltip template. It is a direct copy of the default tooltip template: -```RAZOR - - -
-
@context.DataAttributes["tooltipTitle"]
-
@context.DataAttributes["tooltipText"]
-
-
-
-``` +{{source=CodeSnippets\BlazorNative\Docs\ReportViewers\NativeBlazorViewerTooltipsCustomization.razor region=NativeViewerCustomTooltip}} > note There is a bug in the [Blazor Tooltip component](https://docs.telerik.com/blazor-ui/components/tooltip/overview) that's used in the viewer, which causes the tooltip not to be shown when hovering over adjacent elements. diff --git a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/how-to-use-native-blazor-report-viewer.md b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/how-to-use-native-blazor-report-viewer.md index 4d2d17556..2eb0565b7 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/how-to-use-native-blazor-report-viewer.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/how-to-use-native-blazor-report-viewer.md @@ -45,22 +45,11 @@ If you wish to connect the Report Viewer to a Report Server instance, refer to t 1. (Optional) The [Native Blazor Report Viewer](slug:telerikreporting/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/overview) depends on version **9.1.0** of the [Telerik UI for Blazor](https://www.telerik.com/blazor-ui) product. If [Telerik UI for Blazor](https://www.telerik.com/blazor-ui) is already used in your Blazor application, this step can be skipped. Otherwise, add the [Telerik UI for Blazor](https://www.telerik.com/blazor-ui) JS and its [Kendo theme](https://www.telerik.com/design-system/docs/themes/get-started/introduction/) dependencies to the **head** element of the **Pages/\_Layout.cshtml** (Blazor Server) or **wwwroot/index.html** (Blazor WebAssembly), or `Components/App.razor` (Blazor Web App): - ```HTML - - - @* The version of the Kendo Utils should be updated according to the version of the Kendo theme used by the Telerik UI for Blazor package. *@ - @* The version of the Kendo Theme can be seen in the release notes of the Telerik UI for Blazor version - https://www.telerik.com/support/whats-new/blazor-ui/release-history. *@ - - - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeBlazorViewerUseNativeBlazorReportViewer.html region=NativeBlazorViewerAddingTheNativeBlazorReportViewerComponentManually}} 1. Add the [Native Blazor Report Viewer's](slug:telerikreporting/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/overview) JS and CSS dependencies to the **head** element of the **Pages/\_Layout.cshtml** (Blazor Server) or **wwwroot/index.html** (Blazor WebAssembly), or `Components/App.razor` (Blazor Web App). - ```HTML - - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeBlazorViewerUseNativeBlazorReportViewer.html region=NativeBlazorViewerAddingTheNativeBlazorReportViewerComponentManually2}} 1. Configure the project to recognize all Telerik components without explicit **@using** statements on every **.razor** file by adding the following code to your **~/\_Imports.razor**: diff --git a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/how-to-use-with-report-server-net.md b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/how-to-use-with-report-server-net.md index 996ffd204..1c07698d5 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/how-to-use-with-report-server-net.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/how-to-use-with-report-server-net.md @@ -28,22 +28,11 @@ The user account that will authenticate with the Report Server may be any User, 1. Add NuGet package reference to the **Telerik.ReportViewer.BlazorNative** package hosted on the Progress Telerik proprietary NuGet feed. Ensure that the Telerik NuGet feed is added to the NuGet Package Sources by following [How to add the Telerik private NuGet feed to Visual Studio](slug:telerikreporting/using-reports-in-applications/how-to-add-the-telerik-private-nuget-feed-to-visual-studio). 1. (Optional) The [Native Blazor Report Viewer](slug:telerikreporting/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/overview) depends on version **9.1.0** of the [Telerik UI for Blazor](https://www.telerik.com/blazor-ui) product. If [Telerik UI for Blazor](https://www.telerik.com/blazor-ui) is already used in your Blazor application, this step can be skipped. Otherwise, add the [Telerik UI for Blazor](https://www.telerik.com/blazor-ui) JS and its [Kendo theme](https://www.telerik.com/design-system/docs/themes/get-started/introduction/) dependencies to the **head** element of the **Pages/\_Layout.cshtml** (Blazor Server) or **wwwroot/index.html** (Blazor WebAssembly), or `Components/App.razor` (Blazor Web App): - ```HTML - - - @* The version of the Kendo Utils should be updated according to the version of the Kendo theme used by the Telerik UI for Blazor package. *@ - @* The version of the Kendo Theme can be seen in the release notes of the Telerik UI for Blazor version - https://www.telerik.com/support/whats-new/blazor-ui/release-history. *@ - - - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeBlazorViewerUseWithReportServerNet.html region=NativeBlazorViewerConfiguringForRSNET}} 1. Add the [Native Blazor Report Viewer's](slug:telerikreporting/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/overview) JS and CSS dependencies to the **head** element of the **Pages/\_Layout.cshtml** (Blazor Server) or **wwwroot/index.html** (Blazor WebAssembly), or `Components/App.razor` (Blazor Web App). - ```HTML - - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\NativeBlazorViewerUseNativeBlazorReportViewer.html region=NativeBlazorViewerAddingTheNativeBlazorReportViewerComponentManually2}} 1. Configure the project to recognize all Telerik components without explicit **@using** statements on every **.razor** file by adding the following code to your **~/\_Imports.razor**: diff --git a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/send-mail-message.md b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/send-mail-message.md index d2079e2d6..13a2266f5 100644 --- a/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/send-mail-message.md +++ b/embedding-reports/display-reports-in-applications/web-application/native-blazor-report-viewer/send-mail-message.md @@ -21,9 +21,7 @@ Web browsers cannot initiate the sending of e-mail messages containing attachmen Once ready, the send mail message toolbar button can be enabled through the `EnableSendEmail` initialization option. -```RAZOR - -``` +{{source=CodeSnippets\BlazorNative\Docs\ReportViewers\NativeBlazorViewerSendMail.razor region=NativeViewerEnableSendEmail}} ## Send Mail Message Dialog @@ -37,23 +35,7 @@ The settings are populated from a `SendEmailDialogSettings` tag, that sits insid ### Markup Example -```RAZOR - - - - - - -``` +{{source=CodeSnippets\BlazorNative\Docs\ReportViewers\NativeBlazorViewerSendMail.razor region=NativeViewerSendEmailDialogSettings}} ### Setting Fields diff --git a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/api-reference/properties.md b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/api-reference/properties.md index a7ac13074..bb6bd2501 100644 --- a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/api-reference/properties.md +++ b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/api-reference/properties.md @@ -30,14 +30,7 @@ The commands property is a collection of different commands. Each [command](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/api-reference/command) is an object with the **exec()** method being the one that actually triggers the command. The other two methods, **enabled()** and **checked()** return a bool value and can be used prior to executing a command or to find in what state the UI for the command should be. -```JSX -let viewer; -ReactDOM.render( - <> - viewer = viewerRef} /> - - -``` +{{source=CodeSnippets\Blazor\Docs\jsx\ReactViewer.jsx region=ReactViewerCommands_Print}} The example above creates a Print button and in the click event handler invokes report viewer **print** command. Note that the **exec()** method of the command needs to be called. For more information please check the [command](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/api-reference/command) article. diff --git a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/custom-report-viewer-template.md b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/custom-report-viewer-template.md index 56d7d5430..ef287a736 100644 --- a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/custom-report-viewer-template.md +++ b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/custom-report-viewer-template.md @@ -21,9 +21,7 @@ The React Report Viewer is based on the [HTML5 Report Viewer](slug:telerikreport 1. Make the required changes in the file. 1. Set the **templateUrl** property of the viewer: -```HTML - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\ReactViewerMarkup.html region=ReactViewerCustomTemplate}} ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/how-to-create-a-custom-parameter-editor.md b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/how-to-create-a-custom-parameter-editor.md index ce57671e3..53c84239f 100644 --- a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/how-to-create-a-custom-parameter-editor.md +++ b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/how-to-create-a-custom-parameter-editor.md @@ -89,7 +89,7 @@ The following example illustrates how to use the [Kendo DateTimePicker](https:// function loadScript(callback) { const script = document.createElement("script"); - script.src = "https://kendo.cdn.telerik.com/{{kendosubsetversion}}/js/kendo.all.min.js"; + script.src = "https://kendo.cdn.telerik.com/{{site.kendosubsetversion}}/js/kendo.all.min.js"; script.async = true; script.onload = callback; document.body.appendChild(script); diff --git a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/how-to-pass-values-to-report-parameters.md b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/how-to-pass-values-to-report-parameters.md index 479079108..b07d5244a 100644 --- a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/how-to-pass-values-to-report-parameters.md +++ b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/how-to-pass-values-to-report-parameters.md @@ -38,53 +38,7 @@ ReactDOM.render( **ReportViewer.js**: -```JSX -import 'react-app-polyfill/ie11'; -import 'react-app-polyfill/stable'; -import { React, useRef} from 'react'; -import './index.css'; -import { TelerikReportViewer } from '@progress/telerik-react-report-viewer' - -export function ReportViewer() { - const viewerRef = useRef(null); - const reportSource = { report: 'Invoice.trdx', parameters: {} }; - const viewerContainerStyle = { position: 'absolute', inset: "5px" }; - - return ( - <> -
- - - -
- - - - ) -} -``` +{{source=CodeSnippets\Blazor\Docs\jsx\ReactViewer.jsx region=ReactViewerPassValuesToReportParameters}} > The React Report Viewer is not a native react.js component. If you use a state variable as the value of a report parameter, the report viewer will not refresh with the new value when the setState method of the state variable is executed. diff --git a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/localization.md b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/localization.md index b0d342b3d..861c1db92 100644 --- a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/localization.md +++ b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/customizing/localization.md @@ -16,63 +16,18 @@ The article elaborates on how to localize the messages displayed by the React Re 1. To localize the report viewer, create a new TypeScript file `stringResources.ts`: - ```TypeScript - export class StringResources { - static english = { - loadingReport: 'Loading...', - // override other string resources here - } - static japanese = { - loadingReport: 'ちょっと、まってください...', - // override other string resources here - } - // override string resources for other cultures here - } - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\ViewerLocalizationStringResources.ts region=StringResourcesDefinition}} - The file can contain all or only a part of the string resources which would be localized. For a full list of the report viewer string resources which could be localized, please refer to [HTML5 Report Viewer Localization](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/customizing/localization). + The file can contain all or only a part of the string resources which would be localized. For a full list of the report viewer string resources which could be localized, please refer to [HTML5 Report Viewer Localization](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/customizing/localization). -2. Import the new file in the component where the viewer is used: +1. Import the new file in the component where the viewer is used: - ```TypeScript - import { StringResources } from './stringResources'; - ``` + {{source=CodeSnippets\Blazor\Docs\TypeScript\ViewerLocalizationImport.ts region=ImportStringResources}} -3. Use the [useEffect hook](https://reactjs.org/docs/hooks-effect.html) to extend the viewer object with the string resources for the desired culture after the component has mounted: +1. Use the [useEffect hook](https://reactjs.org/docs/hooks-effect.html) to extend the viewer object with the string resources for the desired culture after the component has mounted: - ```JSX - export function ReportViewer() { - - const viewerRef = useRef(null); - const [language, setLanguage] = useState(navigator.language); - const reportSource = { report: 'Dashboard.trdx', parameters: {} }; - const viewerContainerStyle = { position: 'absolute', inset: '5px', fontFamily: 'ms sans serif' }; - - useEffect(() => { - if (viewerRef) { - const { viewerObject } = viewerRef.current; - switch (language) { - case "ja": - viewerObject.stringResources = Object.assign(viewerObject.stringResources, StringResources.japanese); - break; - default: - viewerObject.stringResources = Object.assign(viewerObject.stringResources, StringResources.english); - break; - } - } - }, [language]) - - return ( - ) - } - ``` + {{source=CodeSnippets\Blazor\Docs\jsx\ReactViewerLocalization.jsx region=ReactViewerLocalization}} + ``` ## See Also diff --git a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/event-binding.md b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/event-binding.md index c69796496..85e433cb8 100644 --- a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/event-binding.md +++ b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/event-binding.md @@ -18,11 +18,7 @@ The React Report Viewer exposes these [Events](slug:telerikreporting/using-repor To attach an event handler to the viewer, specify the name of your function when binding the corresponding input property of the viewer component. For example, we can attach to the __ready__ and __viewerToolTipOpening__ events of the viewer: -````HTML - -```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\ReactViewerMarkup.html region=ReactViewerEventBinding}} Then, we create the event handler functions in the component where the viewer is used: diff --git a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/how-to-use-react-report-viewer-with-report-server.md b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/how-to-use-react-report-viewer-with-report-server.md index ab3c649c6..77c1170a4 100644 --- a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/how-to-use-react-report-viewer-with-report-server.md +++ b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/how-to-use-react-report-viewer-with-report-server.md @@ -73,9 +73,7 @@ The following list describes the prerequisites for this tutorial: 1. Style the viewer using the desired Kendo UI [Sass-Based Theme](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) by adding references to the Sass-based CSS files in the `` element of _public/index.html_: - ```HTML - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerStyling.html region=Html5ViewerKendoThemeCss}} > note To get the Sass-based Kendo UI themes, you can use either the pre-build CSS files, the Kendo UI CDN, or the NPM packages ([Getting the Sass-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/installation)). diff --git a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/how-to-use-react-report-viewer-with-rest-service.md b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/how-to-use-react-report-viewer-with-rest-service.md index 92affd0e4..874e54655 100644 --- a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/how-to-use-react-report-viewer-with-rest-service.md +++ b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/how-to-use-react-report-viewer-with-rest-service.md @@ -97,9 +97,7 @@ The following list describes the prerequisites for this tutorial: 1. Style the viewer using the desired Kendo UI [Sass-Based Theme](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) by adding references to the Sass-based CSS files in the `` element of _public/index.html_: - ```HTML - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\Html5ViewerStyling.html region=Html5ViewerKendoThemeCss}} > note To get the Sass-based Kendo UI themes, you can use either the pre-build CSS files, the Kendo UI CDN, or the NPM packages ([Getting the Sass-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/installation)). diff --git a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/how-to-use-with-report-server-net.md b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/how-to-use-with-report-server-net.md index 45f20e20e..5322ae763 100644 --- a/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/how-to-use-with-report-server-net.md +++ b/embedding-reports/display-reports-in-applications/web-application/react-report-viewer/how-to-use-with-report-server-net.md @@ -36,9 +36,7 @@ The article explains how to set up the HTML5 Report Viewer to work with the Tele 1. Style the viewer using the desired Kendo UI [Sass-Based Theme](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) by adding references to the Sass-based CSS files in the `` element of _public/index.html_: - ```HTML - - ``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\AngularViewerUseWithReportServerNet.html region=AngularViewerSteps3}} > note To get the Sass-based Kendo UI themes, you can use either the pre-built CSS files, the Kendo UI CDN, or the NPM packages ([Getting the Sass-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/installation)). diff --git a/embedding-reports/display-reports-in-applications/web-application/styling-with-themebuilder/styling-html5-based-report-viewers.md b/embedding-reports/display-reports-in-applications/web-application/styling-with-themebuilder/styling-html5-based-report-viewers.md index 05bff9ba9..766586d91 100644 --- a/embedding-reports/display-reports-in-applications/web-application/styling-with-themebuilder/styling-html5-based-report-viewers.md +++ b/embedding-reports/display-reports-in-applications/web-application/styling-with-themebuilder/styling-html5-based-report-viewers.md @@ -63,10 +63,7 @@ After finalizing your customizations, you can export your theme. Click **Export For example, copy the CSS file from the `css` folder in the exported package and add it to your project. In the report viewer file, replace the existing reference to the Telerik and Kendo UI theme with the ThemeBuilder-exported theme: -```HTML - - -``` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\ThemeBuilderStyling.html region=ThemeBuilderHtml5ViewersCss}} > In JavaScript-based projects, if preferred, you can instead utilize the files from the `scss` folder as an NPM package. Further information on this approach can be found at [Using the ThemeBuilder Output as an NPM Package](https://docs.telerik.com/themebuilder/using-exported-styles/exported-package#using-the-themebuilder-output-as-an-npm-package). diff --git a/embedding-reports/display-reports-in-applications/web-application/styling-with-themebuilder/styling-native-blazor-report-viewer.md b/embedding-reports/display-reports-in-applications/web-application/styling-with-themebuilder/styling-native-blazor-report-viewer.md index d98d6bc9e..02cfab6e4 100644 --- a/embedding-reports/display-reports-in-applications/web-application/styling-with-themebuilder/styling-native-blazor-report-viewer.md +++ b/embedding-reports/display-reports-in-applications/web-application/styling-with-themebuilder/styling-native-blazor-report-viewer.md @@ -52,10 +52,7 @@ After finalizing your customizations, you can export your theme. Click **Export For example, copy the CSS file from the `css` folder in the exported package and add it to your project. In the report viewer file, replace the existing references to Telerik and Kendo UI themes with the ThemeBuilder-exported theme: -````HTML -@* *@ - -```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\ThemeBuilderStyling.html region=ThemeBuilderBlazorViewerCss}} ## Next Steps diff --git a/embedding-reports/display-reports-in-applications/windows-forms-application/overview.md b/embedding-reports/display-reports-in-applications/windows-forms-application/overview.md index bc663ac45..02db03b6d 100644 --- a/embedding-reports/display-reports-in-applications/windows-forms-application/overview.md +++ b/embedding-reports/display-reports-in-applications/windows-forms-application/overview.md @@ -1,4 +1,4 @@ ---- +--- title: Overview page_title: Windows Forms Report Viewer at a glance description: "Learn how to display Telerik report documents in WinForms applications by using the Windows Forms Report Viewer control." @@ -76,29 +76,10 @@ When using Windows Forms Report Viewer on a machine with the Windows Vista (and It is recommended that you declare a DPI-aware application by adding a `dpiAware` element to its application manifest: -````XML - - - - True - - - -```` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\WindowsFormsDpiAwareConfiguration.xml region=WindowsFormsDpiAwareConfiguration}} For .NET applications, you need to ensure Windows 10 compatibility in the manifest file, as elaborated in the Microsoft article [High DPI support in Windows Forms](https://learn.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms): -````XML - - - - - - - - -```` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\WindowsFormsCompatibilityConfiguration.xml region=WindowsFormsCompatibilityConfiguration}} As of Windows 10 Anniversary Update, the Windows runtime has improved the UX for Windows Forms applications that are not DPI-aware. However, this behavior may lead to incorrect calculations of the interactive item positions and it is recommended that you always declare the Windows Forms application as DPI-aware. For more information about DPI-aware desktop applications, refer to the [High DPI Desktop Application Development on Windows](https://learn.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows) MSDN article. ## Keyboard Shortcuts diff --git a/embedding-reports/display-reports-in-applications/wpf-application/customizing/how-to-use-rounded-corners.md b/embedding-reports/display-reports-in-applications/wpf-application/customizing/how-to-use-rounded-corners.md index d4105e230..ecd92d008 100644 --- a/embedding-reports/display-reports-in-applications/wpf-application/customizing/how-to-use-rounded-corners.md +++ b/embedding-reports/display-reports-in-applications/wpf-application/customizing/how-to-use-rounded-corners.md @@ -20,20 +20,7 @@ public MainWindow() this.ReportViewer1.CornerRadius = new CornerRadius(15); } ```` -````XAML - - - - - - - -```` +{{source=CodeSnippets\CS\API\Telerik\ReportViewer\Wpf\WindowRoundCorners.xaml region=WpfViewerRoundCorners}} Supported in all of the themes available to the WPF Report Viewer. diff --git a/embedding-reports/host-the-report-engine-remotely/asp.net-web-api-implementation/how-to-implement-the-reportscontroller-in-an-application.md b/embedding-reports/host-the-report-engine-remotely/asp.net-web-api-implementation/how-to-implement-the-reportscontroller-in-an-application.md index c821bad4f..26741923e 100644 --- a/embedding-reports/host-the-report-engine-remotely/asp.net-web-api-implementation/how-to-implement-the-reportscontroller-in-an-application.md +++ b/embedding-reports/host-the-report-engine-remotely/asp.net-web-api-implementation/how-to-implement-the-reportscontroller-in-an-application.md @@ -16,52 +16,52 @@ The Telerik Reporting REST Web API service is represented by the abstract [Repor This abstract class requires [IReportSourceResolver](/api/Telerik.Reporting.Services.IReportSourceResolver) and [IStorage](/api/Telerik.Reporting.Cache.Interfaces.IStorage) implementations. To add the reports controller to your application, follow the steps: -1. Add references to the following Telerik Reporting assemblies (required) and set their **Copy Local** properties to true in Visual Studio: +1. Add references to the following Telerik Reporting assemblies (required) and set their **Copy Local** properties to true in Visual Studio: - - Telerik.Reporting - - Telerik.Reporting.Services.WebApi (located in the installation Bin folder) + - Telerik.Reporting + - Telerik.Reporting.Services.WebApi (located in the installation Bin folder) -1. Add references to the following Telerik Reporting assemblies (optional) and set their **Copy Local** properties to true in Visual Studio: +1. Add references to the following Telerik Reporting assemblies (optional) and set their **Copy Local** properties to true in Visual Studio: - - Telerik.Reporting.Cache.Database.dll - only if [DatabaseStorage](/api/Telerik.Reporting.Cache.Database.DatabaseStorage) caching mechanism is intended. For more details, check [Reporting REST Service Storage](slug:telerikreporting/using-reports-in-applications/host-the-report-engine-remotely/telerik-reporting-rest-services/rest-service-storage/overview). The assembly has dependencies on Telerik Data Access, which can be checked in the version corresponding to [Upgrade article](slug:telerikreporting/upgrade/overview); - - Telerik.Reporting.OpenXmlRendering.dll - depends on [Third-Party Dependencies](slug:telerikreporting/using-reports-in-applications/third-party-dependencies). Required if you need to export in OpenXML formats (DOCX, PPTX, XLSX); - - Telerik.Reporting.XpsRendering.dll - required if you need to export in XPS format; - - Telerik.Reporting.Adomd.dll - required if you use [CubeDataSource](slug:telerikreporting/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/overview) components in reports. The assembly has dependencies on _Microsoft.AnalysisServices.AdomdClient.dll_ v.10.0.0.0 or [above with proper binding redirects](slug:telerikreporting/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/configuring-your-project-for-using-microsoft-analysis-services); + - Telerik.Reporting.Cache.Database.dll - only if [DatabaseStorage](/api/Telerik.Reporting.Cache.Database.DatabaseStorage) caching mechanism is intended. For more details, check [Reporting REST Service Storage](slug:telerikreporting/using-reports-in-applications/host-the-report-engine-remotely/telerik-reporting-rest-services/rest-service-storage/overview). The assembly has dependencies on Telerik Data Access, which can be checked in the version corresponding to [Upgrade article](slug:telerikreporting/upgrade/overview); + - Telerik.Reporting.OpenXmlRendering.dll - depends on [Third-Party Dependencies](slug:telerikreporting/using-reports-in-applications/third-party-dependencies). Required if you need to export in OpenXML formats (DOCX, PPTX, XLSX); + - Telerik.Reporting.XpsRendering.dll - required if you need to export in XPS format; + - Telerik.Reporting.Adomd.dll - required if you use [CubeDataSource](slug:telerikreporting/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/overview) components in reports. The assembly has dependencies on _Microsoft.AnalysisServices.AdomdClient.dll_ v.10.0.0.0 or [above with proper binding redirects](slug:telerikreporting/designing-reports/connecting-to-data/data-source-components/cubedatasource-component/configuring-your-project-for-using-microsoft-analysis-services); + + > Without setting Telerik Reporting references' _Copy Local_ to true, the assemblies may not be loaded correctly when running the application. - > Without setting Telerik Reporting references' _Copy Local_ to true, the assemblies may not be loaded correctly when running the application. +1. Inherit this base class in your hosting application (usually in the Controllers folder of an MVC application). -1. Inherit this base class in your hosting application (usually in the Controllers folder of an MVC application). + - **ReportsControllerBase configuration in code:** - - **ReportsControllerBase configuration in code:** + Set the [ReportServiceConfiguration](/api/Telerik.Reporting.Services.WebApi.ReportsControllerBase#Telerik_Reporting_Services_WebApi_ReportsControllerBase_ReportServiceConfiguration) property. The **ReportSourceResolver** and **Storage** configuration settings are required. See the [IReportServiceConfiguration](/api/Telerik.Reporting.Services.IReportServiceConfiguration) interface for more details. - Set the [ReportServiceConfiguration](/api/Telerik.Reporting.Services.WebApi.ReportsControllerBase#Telerik_Reporting_Services_WebApi_ReportsControllerBase_ReportServiceConfiguration) property. The **ReportSourceResolver** and **Storage** configuration settings are required. See the [IReportServiceConfiguration](/api/Telerik.Reporting.Services.IReportServiceConfiguration) interface for more details. + {{source=CodeSnippets\MvcCS\Controllers\ReportsController.cs region=ReportsControllerImplementation}} + {{source=CodeSnippets\MvcVB\Controllers\ReportsController.vb region=ReportsControllerImplementation}} - {{source=CodeSnippets\MvcCS\Controllers\ReportsController.cs region=ReportsControllerImplementation}} - {{source=CodeSnippets\MvcVB\Controllers\ReportsController.vb region=ReportsControllerImplementation}} + > note Starting with the [2024 Q4 (18.3.24.1112)](https://www.telerik.com/support/whats-new/reporting/release-history/progress-telerik-reporting-2024-q4-18-3-24-1112), it is possible to define the [ReportServiceConfiguration](/api/Telerik.Reporting.Services.WebApi.ReportsControllerBase#Telerik_Reporting_Services_WebApi_ReportsControllerBase_ReportServiceConfiguration) with less code using the `AddTelerikReporting` extension method: - > note Starting with the [2024 Q4 (18.3.24.1112)](https://www.telerik.com/support/whats-new/reporting/release-history/progress-telerik-reporting-2024-q4-18-3-24-1112), it is possible to define the [ReportServiceConfiguration](/api/Telerik.Reporting.Services.WebApi.ReportsControllerBase#Telerik_Reporting_Services_WebApi_ReportsControllerBase_ReportServiceConfiguration) with less code using the `AddTelerikReporting` extension method: + {{source=CodeSnippets\MvcCS\Controllers\ReportsController.cs region=ReportsControllerImplementationMinimal}} + {{source=CodeSnippets\MvcVB\Controllers\ReportsController.vb region=ReportsControllerImplementationMinimal}} - {{source=CodeSnippets\MvcCS\Controllers\ReportsController.cs region=ReportsControllerImplementationMinimal}} - {{source=CodeSnippets\MvcVB\Controllers\ReportsController.vb region=ReportsControllerImplementationMinimal}} + [ReportsControllerBase](/api/Telerik.Reporting.Services.WebApi.ReportsControllerBase) inherits [System.Web.Http.ApiController](https://learn.microsoft.com/en-us/dotnet/api/system.web.http.apicontroller?view=aspnet-webapi-5.2) and implements all necessary API actions. The provided sample implementation will resolve .trdx|.trdp report definitions from the Reports subfolder of the hosting ASP.NET application root. - [ReportsControllerBase](/api/Telerik.Reporting.Services.WebApi.ReportsControllerBase) inherits [System.Web.Http.ApiController](https://learn.microsoft.com/en-us/dotnet/api/system.web.http.apicontroller?view=aspnet-webapi-5.2) and implements all necessary API actions. The provided sample implementation will resolve .trdx|.trdp report definitions from the Reports subfolder of the hosting ASP.NET application root. + Another option is to reference a reports library and provide a report [type assembly qualified name](https://learn.microsoft.com/en-us/dotnet/api/system.type.assemblyqualifiedname?view=net-7.0) from the service clients. - Another option is to reference a reports library and provide a report [type assembly qualified name](https://learn.microsoft.com/en-us/dotnet/api/system.type.assemblyqualifiedname?view=net-7.0) from the service clients. + > note Do not forget to add all necessary (i.e., referred from the report definitions) connection strings to the application configuration file. - > note Do not forget to add all necessary (i.e., referred from the report definitions) connection strings to the application configuration file. + > The above implementation uses the [FileStorage](/api/Telerik.Reporting.Cache.File.FileStorage) method in order to create a storage object instance. All Visual Studio item templates for adding the Reporting REST service use the default **FileStorage** constructor. The second overload of the FileStorage constructor allows you to specify a folder, and it is recommended for usage in a production environment. - > The above implementation uses the [FileStorage](/api/Telerik.Reporting.Cache.File.FileStorage) method in order to create a storage object instance. All Visual Studio item templates for adding the Reporting REST service use the default **FileStorage** constructor. The second overload of the FileStorage constructor allows you to specify a folder, and it is recommended for usage in a production environment. + - **ReportsControllerBase configuration in configuration file:** - - **ReportsControllerBase configuration in configuration file:** + To configure the Telerik Reporting REST service from the application configuration file, set the value of the [ReportServiceConfiguration](/api/Telerik.Reporting.Services.WebApi.ReportsControllerBase#Telerik_Reporting_Services_WebApi_ReportsControllerBase_ReportServiceConfiguration) property to an instance of the [ConfigSectionReportServiceConfiguration](/api/Telerik.Reporting.Services.ConfigSectionReportServiceConfiguration) class. - To configure the Telerik Reporting REST service from the application configuration file, set the value of the [ReportServiceConfiguration](/api/Telerik.Reporting.Services.WebApi.ReportsControllerBase#Telerik_Reporting_Services_WebApi_ReportsControllerBase_ReportServiceConfiguration) property to an instance of the [ConfigSectionReportServiceConfiguration](/api/Telerik.Reporting.Services.ConfigSectionReportServiceConfiguration) class. + {{source=CodeSnippets\MvcCS\Controllers\ReportsControllerConfigSection.cs region=ReportsControllerConfigSectionImplementation}} + {{source=CodeSnippets\MvcVB\Controllers\ReportsControllerConfigSection.vb region=ReportsControllerConfigSectionImplementation}} - {{source=CodeSnippets\MvcCS\Controllers\ReportsControllerConfigSection.cs region=ReportsControllerConfigSectionImplementation}} - {{source=CodeSnippets\MvcVB\Controllers\ReportsControllerConfigSection.vb region=ReportsControllerConfigSectionImplementation}} + Then add the **restReportService** configuration element containing the service settings to the [Telerik Reporting Configuration Section](slug:telerikreporting/using-reports-in-applications/export-and-configure/configure-the-report-engine/overview). - Then add the **restReportService** configuration element containing the service settings to the [Telerik Reporting Configuration Section](slug:telerikreporting/using-reports-in-applications/export-and-configure/configure-the-report-engine/overview). - - {{source=CodeSnippets\MvcCS\ReportServiceConfigurationSnippets\ConfigSectionConfiguration.xml}} + {{source=CodeSnippets\MvcCS\ReportServiceConfigurationSnippets\ConfigSectionConfiguration.xml}} ## See Also diff --git a/embedding-reports/host-the-report-engine-remotely/rest-service-report-source-resolver/how-to-implement-a-custom-report-source-resolver.md b/embedding-reports/host-the-report-engine-remotely/rest-service-report-source-resolver/how-to-implement-a-custom-report-source-resolver.md index 3d229ab0b..10525daed 100644 --- a/embedding-reports/host-the-report-engine-remotely/rest-service-report-source-resolver/how-to-implement-a-custom-report-source-resolver.md +++ b/embedding-reports/host-the-report-engine-remotely/rest-service-report-source-resolver/how-to-implement-a-custom-report-source-resolver.md @@ -52,8 +52,8 @@ This article explains how to create a custom report source resolver for the **Te 1. Add to your IReportSourceResolver implementation a constructor with the parameter IReportSourceResolver parentResolver. Then use the parentResolver if the custom report source resolving mechanism fails. - {{source=CodeSnippets\MvcCS\Controllers\CustomResolverReportsController.cs region=CustomReportSourceResolverFallBack_Implementation}} - {{source=CodeSnippets\MvcVB\Controllers\CustomResolverReportsController.vb region=CustomReportSourceResolverFallBack_Implementation}} + {{source=CodeSnippets\MvcCS\Controllers\CustomResolverReportsController.cs region=CustomReportSourceResolverFallBack_Implementation}} + {{source=CodeSnippets\MvcVB\Controllers\CustomResolverReportsController.vb region=CustomReportSourceResolverFallBack_Implementation}} 1. Add to the `ReportServiceConfiguration` the `IReportSourceResolver` implementations in a chain. Thus, the custom one will be executed first, if it fails the second one, and so on. diff --git a/getting-started/first-steps-designing.md b/getting-started/first-steps-designing.md index 74a3613a2..47d0d1b3d 100644 --- a/getting-started/first-steps-designing.md +++ b/getting-started/first-steps-designing.md @@ -82,18 +82,7 @@ So, first, let's connect to the data and, then, you'll create the table to prese 1. On the screen that loads, fill in the **Select Statement** field with the query below. The query will extract only the first 14 employees and they will be listed in ascending order according to their `id`, that is, the employee with an `id=1` will be the first one, the employee with an `id=2` will come second, and so on. - ```SQL - SELECT - [HumanResources].[vEmployee].[EmployeeID] , - [HumanResources].[vEmployee].[FirstName], - [HumanResources].[vEmployee].[LastName], - [HumanResources].[vEmployee].[JobTitle], - [HumanResources].[vEmployee].[Phone] - FROM [HumanResources].[vEmployee] - WHERE [HumanResources].[vEmployee].[EmployeeID] <= 14 - ORDER BY 1 ASC - ``` - + {{source=CodeSnippets\CS\SQL\SelectEmployees.sql}} 1. Click **Next** to execute the query and the **Execute Query...** button on the next screen to preview the result. Then, click **Finish**. 1. In the **Properties** pane (**Property Browser**) on the right, change the name of the data source to `tableDataSource` so you can later refer it and render its data in the report. diff --git a/getting-started/installation/dot-net-core-support.md b/getting-started/installation/dot-net-core-support.md index 53b7ec6fe..bc4775310 100644 --- a/getting-started/installation/dot-net-core-support.md +++ b/getting-started/installation/dot-net-core-support.md @@ -188,25 +188,13 @@ When using SkiaSharp, reference the `Telerik.Drawing.Skia` NuGet package or asse The next libraries should also be referenced when using SkiaSharp. The snippet is relevant for Ubuntu or Debian and may differ for other Linux distributions: -```DOCKERFILE -FROM microsoft/dotnet:7.0-runtime AS base -RUN apt-get update && \ - apt-get install -y libfreetype6 libfontconfig1 -``` +{{source=CodeSnippets\Blazor\Docs\Dockerfiles\LinuxDockerWithSkiaAddLibs.dockerfile}} ### Linux Docker Container with System.Drawing(`libgdiplus`) The following `dockerfile` snippet demonstrates how to achieve the desired outcome. When these three libraries are installed, Telerik Reporting will run on the produced Docker image. -```DOCKERFILE -FROM microsoft/dotnet:6.0-runtime AS base -RUN apt-get update \ - && apt-get install -y --allow-unauthenticated \ - libc6-dev \ - libgdiplus \ - libx11-dev \ - && rm -rf /var/lib/apt/lists/* -``` +{{source=CodeSnippets\Blazor\Docs\Dockerfiles\LinuxDockerWithGdiAddLibs.dockerfile}} ### Windows Docker Container with System.Drawing @@ -220,13 +208,7 @@ You need to select it from the pop-up configuration window: Here is sample code from the autogenerated Docker file: -```DOCKERFILE -FROM mcr.microsoft.com/dotnet/aspnet:8.0-windowsservercore-ltsc2022 AS base -WORKDIR /app -EXPOSE 8080 -FROM mcr.microsoft.com/dotnet/sdk:windowsservercore-ltsc2022 AS build -# ... -``` +{{source=CodeSnippets\Blazor\Docs\Dockerfiles\WindowsDockerWithGdiAddLibs.dockerfile}} ## Sample Projects @@ -240,53 +222,10 @@ With [2024 Q2 (18.1.24.514)](https://www.telerik.com/support/whats-new/reporting The Docker files may be found in the folder of the corresponding project. For example, the `Dockerfile` for the .NET 8 Telerik Reporting REST Service project with enabled CORS may be found by default in `C:\Program Files (x86)\Progress\Telerik Reporting {{site.suiteversion}}\Examples\CSharp\.NET {{site.mindotnetversion}}\ReportingRestServiceCorsDemo`. The Dockerfile starts with instructions for building the image and running the Docker container. Replace the placeholders in the curly brackets with the corresponding details: **TelerikNuGetApiKey**, **Telerik Reporting Installation Folder**, and **Connection String to AdventureWorks Database Accessible From the Docker Container**. Here is a sample of the file's content. The deployed Reporting REST Service project with enabled CORS will run on `localhost:4040` in the browser: -```DOCKERFILE -# command to BUILD docker IMAGE from the Windows Terminal: -# docker image build -f "{Replace With Installation Folder}\Examples\CSharp\.NET {{site.mindotnetversion}}\ReportingRestServiceCorsDemo\Dockerfile" -t net8reportingrestservicecorsdemo --build-arg TelerikNugetServerApiKey={Replace With Your TelerikNuGetApiKey} "{Replace With Installation Folder}" - -# command to RUN docker CONTAINER from the Windows Terminal: -# docker run -e ConnectionStrings__Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString__connectionString="{Replace With Connection String to AdventureWorks Database Accessible From the Docker Container}" -it -p 4040:8080 net8reportingrestservicecorsdemo - - -#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base - -WORKDIR /app -EXPOSE 8080 - -RUN apt-get update && \ - apt-get install -y libfreetype6 libfontconfig1 - -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build -ARG BUILD_CONFIGURATION=Release -WORKDIR /src - -COPY ["Report Designer/Examples", "Reports"] -COPY ["Examples/CSharp/.NET 8/ReportingRestServiceCorsDemo", ".NET 8/ReportingRestServiceCorsDemo/"] -COPY ["Examples/CSharp/Business Objects", "Business Objects/"] -COPY ["Examples/CSharp/nuget.config", ""] - -ARG TelerikNugetServerApiKey -ENV TelerikNugetServer_API_KEY $TelerikNugetServerApiKey - -RUN dotnet restore "/src/.NET 8/ReportingRestServiceCorsDemo/CSharp.Net8.ReportingRestServiceCorsDemo.csproj" - -WORKDIR "/src/.NET 8/ReportingRestServiceCorsDemo" -RUN dotnet build "./CSharp.Net8.ReportingRestServiceCorsDemo.csproj" -c $BUILD_CONFIGURATION -o /app/build - -FROM build AS publish -ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./CSharp.Net8.ReportingRestServiceCorsDemo.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false - -FROM base AS final -WORKDIR /app/Examples/CSharp/NET8/ReportingRestServiceCorsDemo -COPY --from=publish /app/publish . -COPY --from=build ["/src/Reports", "/app/Report Designer/Examples"] -ENTRYPOINT ["dotnet", "CSharp.Net8.ReportingRestServiceCorsDemo.dll"] -``` +{{source=CodeSnippets\Blazor\Docs\Dockerfiles\DockerSamples.dockerfile}} ## See Also -- [ASP.NET Core Web API Implementation Overview](slug:telerikreporting/using-reports-in-applications/host-the-report-engine-remotely/telerik-reporting-rest-services/asp.net-core-web-api-implementation/overview) -- [Adding Report Viewers to Windows Forms .NET Projects](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/windows-forms-application/how-to-add-report-viewer-to-a-windows-forms-net-core-project) -- [Adding Report Viewers to WPF .NET Projects](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/wpf-application/how-to-add-report-viewer-to-a-wpf-.net-core-project) +* [ASP.NET Core Web API Implementation Overview](slug:telerikreporting/using-reports-in-applications/host-the-report-engine-remotely/telerik-reporting-rest-services/asp.net-core-web-api-implementation/overview) +* [Adding Report Viewers to Windows Forms .NET Projects](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/windows-forms-application/how-to-add-report-viewer-to-a-windows-forms-net-core-project) +* [Adding Report Viewers to WPF .NET Projects](slug:telerikreporting/using-reports-in-applications/display-reports-in-applications/wpf-application/how-to-add-report-viewer-to-a-wpf-.net-core-project) diff --git a/importing-reports/crystal-reports-converter.md b/importing-reports/crystal-reports-converter.md index 308037218..ba1af3e58 100644 --- a/importing-reports/crystal-reports-converter.md +++ b/importing-reports/crystal-reports-converter.md @@ -1,4 +1,4 @@ ---- +--- title: SAP Crystal Reports page_title: Converting reports created with SAP Crystal Reports description: "Learn how to convert an existing report, created with the 'SAP Crystal Reports' reporting solution, into a 'Telerik Reporting' report definition." @@ -61,37 +61,7 @@ The Global Assembly Cache contains the following assemblies: The output from the _gacutil.exe_ above shows that the current version of the installed Crystal Reports runtime assemblies is **13.0.3500.0**. Here is what the configuration file with added binding redirects will look like: -```XML - - - - - - - - - - - - - - - - - - - - - - - - - - - - -``` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\CrystalReportsConfiguration.xml region=CrystalReportsConfiguration}} During the conversion process, the engine outputs warnings and information messages for the converted items in the Summary page. After reviewing the messages, the produced report can be edited further to achieve the desired functionality. ## See Also diff --git a/interactivity/customizing-ai-powered-insights.md b/interactivity/customizing-ai-powered-insights.md index c2f4817a6..ddab5c1e6 100644 --- a/interactivity/customizing-ai-powered-insights.md +++ b/interactivity/customizing-ai-powered-insights.md @@ -1,4 +1,4 @@ ---- +--- title: Customizing AI-Powered Insights page_title: How to Customize the AI-Powered Insights description: "Learn how to configure the AI-powered insights functionality to handle common and advanced cases." @@ -40,23 +40,7 @@ In enterprise environments where AI usage policies are already established or wh } } ``` -```XML - - -
- - - - - - -``` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\AiInsightsConfiguration.xml region=AiInsightsConfiguration}} ### Prompts Configuration By default, users can create their own custom prompts to ask any questions about their reports. While this provides maximum flexibility, it can lead to unpredictable token usage costs and potentially inconsistent results. In these cases, you can provide the users with predefined prompts that are designed to handle specific tasks. @@ -76,27 +60,7 @@ To restrict users to predefined prompts only, you set `allowCustomPrompts` to `f } } ``` -```XML - - -
- - - - - - - - - - -``` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\AiInsightsConfiguration_2.xml region=AiInsightsConfiguration_2}} You can also add predefined prompts without disabling custom ones, giving users both curated options and the flexibility to create their own queries. ### Retrieval-Augmented Generation (RAG) Configuration diff --git a/licensing/license-troubleshoot.md b/licensing/license-troubleshoot.md index 99621d0c0..02b2c8883 100644 --- a/licensing/license-troubleshoot.md +++ b/licensing/license-troubleshoot.md @@ -1,4 +1,4 @@ ---- +--- title: Troubleshooting page_title: "Learn how to troubleshoot problems with Licensing in Telerik Reporting." description: "Learn about Troubleshooting License problems in Telerik Reporting after the 2025 Q1 (19.0.25.211) release." @@ -24,22 +24,7 @@ In rare scenarios, clients keep getting Licensing watermarks in some environment Use the `TelerikLicensingVerbosity` configuration in your project file to enable detailed licensing diagnostics during build. A sample configuration of the proj file is shown below: -```XML - - - Exe - net9.0 - MyProjNamespace - enable - enable - diagnostic - - - - - -``` - +{{source=CodeSnippets\MvcCS\XmlConfiguration\LicenseConfiguration.xml region=LicenseConfiguration}} Here are the possible values for `TelerikLicensingVerbosity`: * `quiet` / `q` - the lowest verbosity level; * `verbose` / `v` - the normal/middle verbosity level; diff --git a/report-items/graph/chart-types/area.md b/report-items/graph/chart-types/area.md index 05636fed5..16b72188c 100644 --- a/report-items/graph/chart-types/area.md +++ b/report-items/graph/chart-types/area.md @@ -33,15 +33,7 @@ In this section, you will learn how to create an Area Chart with the Telerik Rep The sample report will use a pre-defined SqlDataSource that connects to the example AdventureWorks database. The query that returns the needed fields is the following: -````SQL -SELECT - [Sales].[SalesOrderHeader].[OrderDate], - [Sales].[SalesOrderDetail].[LineTotal] -FROM - [Sales].[SalesOrderDetail] INNER JOIN - [Sales].[SalesOrderHeader] ON [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] -```` - +{{source=CodeSnippets\CS\SQL\SelectSalesOrdersByDate.sql}} To create the Stacked Area chart by using the Area Chart Wizard: 1. Add a Stacked Area chart: diff --git a/report-items/graph/chart-types/bar.md b/report-items/graph/chart-types/bar.md index e9c45b28b..0a5c75a05 100644 --- a/report-items/graph/chart-types/bar.md +++ b/report-items/graph/chart-types/bar.md @@ -35,20 +35,7 @@ In the general case, you can select a Stacked Bar or a 100% Stacked Bar chart. T The sample report will use a pre-defined SqlDataSource that connects to the example AdventureWorks database. The query that returns the needed fields is the following: -````SQL -SELECT - [Production].[ProductCategory].[Name] AS 'Category', - [Sales].[SalesOrderHeader].[OrderDate], - [Sales].[SalesOrderDetail].[LineTotal] -FROM - [Production].[Product] INNER JOIN - [Production].[ProductSubcategory] ON [Production].[Product].[ProductSubcategoryID] = [Production].[ProductSubcategory].[ProductSubcategoryID] INNER JOIN - [Production].[ProductCategory] ON [Production].[ProductSubcategory].[ProductCategoryID] = [Production].[ProductCategory].[ProductCategoryID] INNER JOIN - [Sales].[SalesOrderDetail] ON [Production].[Product].[ProductID] = [Sales].[SalesOrderDetail].[ProductID] INNER JOIN - [Sales].[SalesOrderHeader] ON [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] AND [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] AND - [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] -```` - +{{source=CodeSnippets\CS\SQL\SelectSalesByCategoryAndDate.sql}} To create the Bar chart by using the Bar Chart Wizard: 1. Add a Clustered Bar chart as shown in the image below: diff --git a/report-items/graph/chart-types/column.md b/report-items/graph/chart-types/column.md index 08e89a3c1..43a1a5e75 100644 --- a/report-items/graph/chart-types/column.md +++ b/report-items/graph/chart-types/column.md @@ -35,20 +35,7 @@ In the general case, you may select `Stacked Column` or `100% Stacked Column`. T The sample report will use a pre-defined SqlDataSource that connects to the example AdventureWorks database. The query that returns the needed fields is the following: -````SQL -SELECT - [Production].[ProductCategory].[Name] AS 'Category', - [Sales].[SalesOrderHeader].[OrderDate], - [Sales].[SalesOrderDetail].[LineTotal] -FROM - [Production].[Product] INNER JOIN - [Production].[ProductSubcategory] ON [Production].[Product].[ProductSubcategoryID] = [Production].[ProductSubcategory].[ProductSubcategoryID] INNER JOIN - [Production].[ProductCategory] ON [Production].[ProductSubcategory].[ProductCategoryID] = [Production].[ProductCategory].[ProductCategoryID] INNER JOIN - [Sales].[SalesOrderDetail] ON [Production].[Product].[ProductID] = [Sales].[SalesOrderDetail].[ProductID] INNER JOIN - [Sales].[SalesOrderHeader] ON [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] AND [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] AND - [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] -```` - +{{source=CodeSnippets\CS\SQL\SelectSalesByCategoryAndDate.sql}} To create the Column chart by using the Column Chart Wizard: 1. Add Clustered Column Chart as shown in the image below: diff --git a/report-items/graph/chart-types/line.md b/report-items/graph/chart-types/line.md index f4b139da4..fa5e8a3d1 100644 --- a/report-items/graph/chart-types/line.md +++ b/report-items/graph/chart-types/line.md @@ -35,20 +35,7 @@ In the general case, you may select `Stacked Line` or `100% Stacked Line` with o The sample report will use a pre-defined SqlDataSource that connects to the example AdventureWorks database. The query that returns the needed fields is the following: -````SQL -SELECT - [Production].[ProductCategory].[Name] AS 'Category', - [Sales].[SalesOrderHeader].[OrderDate], - [Sales].[SalesOrderDetail].[LineTotal] -FROM - [Production].[Product] INNER JOIN - [Production].[ProductSubcategory] ON [Production].[Product].[ProductSubcategoryID] = [Production].[ProductSubcategory].[ProductSubcategoryID] INNER JOIN - [Production].[ProductCategory] ON [Production].[ProductSubcategory].[ProductCategoryID] = [Production].[ProductCategory].[ProductCategoryID] INNER JOIN - [Sales].[SalesOrderDetail] ON [Production].[Product].[ProductID] = [Sales].[SalesOrderDetail].[ProductID] INNER JOIN - [Sales].[SalesOrderHeader] ON [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] AND [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] AND - [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] -```` - +{{source=CodeSnippets\CS\SQL\SelectSalesByCategoryAndDate.sql}} To create the Line chart by using the Line Chart Wizard: 1. Add Line Chart as shown in the image below: diff --git a/report-items/graph/chart-types/ohlc.md b/report-items/graph/chart-types/ohlc.md index c09d9caa3..0de238685 100644 --- a/report-items/graph/chart-types/ohlc.md +++ b/report-items/graph/chart-types/ohlc.md @@ -41,18 +41,7 @@ The report will display the daily changes in a financial marker and its final fo The sample report will use a pre-defined CsvDataSource with the following data: -````CSV -date,open,high,low,close -03.07.2017,18.2,18.6,18.1,18.4 -04.07.2017,18.3,18.6,18.1,18.4 -05.07.2017,18.5,19,18.3,18.7 -06.07.2017,18.9,19,18.2,18.3 -07.07.2017,18.3,18.9,18.3,18.7 -10.07.2017,18.8,19.2,18.3,18.4 -11.07.2017,18.2,19.2,18.1,18.8 -12.07.2017,18.3,18.6,18.2,18.6 -13.07.2017,18.4,19.4,18.3,18.7 -```` +{{source=CodeSnippets\CS\CSV\OhlcStockPrices.csv}} The `date` field is a DateTime with the `dd.MM.yyyy` format. The rest of the fields are decimal. diff --git a/report-items/graph/chart-types/pie.md b/report-items/graph/chart-types/pie.md index 681ecaf3a..487eb76ed 100644 --- a/report-items/graph/chart-types/pie.md +++ b/report-items/graph/chart-types/pie.md @@ -30,16 +30,7 @@ We are going to displays the SubTotal for the Top 10 performing Stores as a perc The sample report will use a pre-defined SqlDataSource that connects to the example AdventureWorks database. The query that returns the needed fields is the following: -````SQL -SELECT - [Sales].[Store].[Name] AS 'StoreName', - [Sales].[SalesOrderHeader].[SubTotal] -FROM - [Sales].[SalesOrderDetail] INNER JOIN - [Sales].[SalesOrderHeader] ON [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] INNER JOIN - [Sales].[Store] ON [Sales].[SalesOrderHeader].[CustomerID] = [Sales].[Store].[CustomerID] -```` - +{{source=CodeSnippets\CS\SQL\SelectStoreSalesSubtotal.sql}} To create the Pie chart by using the Pie Chart Wizard: 1. Add Pie Chart as shown in the image below: diff --git a/report-items/graph/chart-types/polar.md b/report-items/graph/chart-types/polar.md index b3f07fe20..ef95902b5 100644 --- a/report-items/graph/chart-types/polar.md +++ b/report-items/graph/chart-types/polar.md @@ -34,20 +34,7 @@ We are going to display the LineTotal of the Product Categories by Years. The fi The sample report will use a pre-defined SqlDataSource that connects to the example AdventureWorks database. The query that returns the needed fields is the following: -````SQL -SELECT - [Production].[ProductCategory].[Name] AS 'Category', - [Sales].[SalesOrderHeader].[OrderDate], - [Sales].[SalesOrderDetail].[LineTotal] -FROM - [Production].[Product] INNER JOIN - [Production].[ProductSubcategory] ON [Production].[Product].[ProductSubcategoryID] = [Production].[ProductSubcategory].[ProductSubcategoryID] INNER JOIN - [Production].[ProductCategory] ON [Production].[ProductSubcategory].[ProductCategoryID] = [Production].[ProductCategory].[ProductCategoryID] INNER JOIN - [Sales].[SalesOrderDetail] ON [Production].[Product].[ProductID] = [Sales].[SalesOrderDetail].[ProductID] INNER JOIN - [Sales].[SalesOrderHeader] ON [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] AND [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] AND - [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] -```` - +{{source=CodeSnippets\CS\SQL\SelectSalesByCategoryAndDate.sql}} To create the Polar chart by using the Polar Chart Wizard: 1. Add Rose Chart as shown in the image below: diff --git a/report-items/graph/chart-types/range.md b/report-items/graph/chart-types/range.md index 46515bc2e..3b75c41b5 100644 --- a/report-items/graph/chart-types/range.md +++ b/report-items/graph/chart-types/range.md @@ -34,18 +34,7 @@ The Range Chart is a modification of the more general Area Chart. That's why, it The sample report will use a pre-defined SqlDataSource that connects to the example AdventureWorks database. The query that returns the needed fields is the following: -````SQL -SELECT - [Sales].[SalesTerritory].[Name] AS 'TerritoryName', - [Sales].[SalesOrderHeader].[OrderDate], - [Sales].[SalesOrderHeader].[TotalDue] -FROM - [Sales].[SalesOrderHeader] INNER JOIN - [Sales].[SalesTerritory] ON [Sales].[SalesOrderHeader].[TerritoryID] = [Sales].[SalesTerritory].[TerritoryID] -WHERE - YEAR([Sales].[SalesOrderHeader].[OrderDate]) IN (2002, 2003) -```` - +{{source=CodeSnippets\CS\SQL\SelectTerritorySalesByDate.sql}} To create the Range chart by using the Range Chart Wizard: 1. Add Range Chart as shown in the image below: diff --git a/report-items/graph/chart-types/scatter.md b/report-items/graph/chart-types/scatter.md index fcb0e5356..9249880e3 100644 --- a/report-items/graph/chart-types/scatter.md +++ b/report-items/graph/chart-types/scatter.md @@ -36,21 +36,7 @@ The Bubble Chart is a variation of the more general Scatter Chart and its wizard The sample report will use a pre-defined SqlDataSource that connects to the example AdventureWorks database. The query that returns the needed fields is the following: -````SQL -SELECT - [Person].[Contact].[FirstName] + ' ' + [Person].[Contact].[LastName] AS 'SalesPersonName', - [Sales].[SalesOrderHeader].[OrderDate], - [Sales].[SalesOrderHeader].[SubTotal] -FROM - [Person].[Address] INNER JOIN - [Sales].[SalesOrderHeader] ON [Person].[Address].[AddressID] = [Sales].[SalesOrderHeader].[BillToAddressID] AND - [Person].[Address].[AddressID] = [Sales].[SalesOrderHeader].[ShipToAddressID] INNER JOIN - [Person].[Contact] ON [Sales].[SalesOrderHeader].[ContactID] = [Person].[Contact].[ContactID] -WHERE - YEAR([Sales].[SalesOrderHeader].[OrderDate]) IN (2003, 2004) AND - [Person].[Address].[City] = 'Toronto' -```` - +{{source=CodeSnippets\CS\SQL\SelectSalesPersonOrdersByCity.sql}} To create the Scatter chart by using the Scatter Chart Wizard: 1. Add Bubble Chart as shown in the image below: diff --git a/report-items/htmltextbox/formatting.md b/report-items/htmltextbox/formatting.md index 6e01fd54e..4ffdee0f8 100644 --- a/report-items/htmltextbox/formatting.md +++ b/report-items/htmltextbox/formatting.md @@ -48,15 +48,11 @@ The following HTML attributes control the image source, dimensions, and accessib Basic image with dimensions and styling: -````html -Company Logo -```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\HtmlTextBoxImages.html region=HtmlTextBoxImageWithDimensions}} Data-driven image with embedded expressions: -````html -{Fields.ProductName} -```` +{{source=CodeSnippets\Blazor\Docs\ReportViewers\HtmlTextBoxImages.html region=HtmlTextBoxDataDrivenImage}} ## Supported CSS Attributes diff --git a/report-items/map/get-started.md b/report-items/map/get-started.md index 72e2bb666..d9c64d06b 100644 --- a/report-items/map/get-started.md +++ b/report-items/map/get-started.md @@ -42,28 +42,7 @@ On the `Choose Data Source` page, add a new [SqlDataSource](slug:telerikreportin 1. Set the connection string to the demo AdventureWorks database. 1. Paste the following query in the **Select Statement** box: - ```SQL - SELECT - PS.Name AS ProductSubCategory, - SP.Name + ', ' + CR.Name AS State, - SOD.LineTotal as LineTotal - FROM - - Production.Product AS P - INNER JOIN Production.ProductSubcategory AS PS ON P.ProductSubcategoryID = PS.ProductSubcategoryID - INNER JOIN Production.ProductCategory AS PC ON PS.ProductCategoryID = PC.ProductCategoryID - INNER JOIN Sales.SalesOrderDetail AS SOD ON P.ProductID = SOD.ProductID - INNER JOIN Sales.SalesOrderHeader AS SOH ON SOD.SalesOrderID = SOH.SalesOrderID - INNER JOIN Person.Address AS ADDR ON ADDR.AddressID = SOH.ShipToAddressID - INNER JOIN Person.StateProvince AS SP ON SP.StateProvinceID = ADDR.StateProvinceID - INNER JOIN Person.CountryRegion AS CR ON CR.CountryRegionCode = SP.CountryRegionCode - - WHERE - CR.Name IN ('Australia') - AND DATEPART(YEAR, SOH.OrderDate) IN (2003, 2004) - AND PC.Name = 'Bikes' - ``` - + {{source=CodeSnippets\CS\SQL\SelectProductSalesByState.sql}} 1. Click `Execute Query...` to check if everything is OK with the database connection. 1. Click `Finish` when you are ready. diff --git a/report-items/table-crosstab-list/get-started.md b/report-items/table-crosstab-list/get-started.md index 10f884a2e..ae50203d6 100644 --- a/report-items/table-crosstab-list/get-started.md +++ b/report-items/table-crosstab-list/get-started.md @@ -44,24 +44,7 @@ To add the Crosstab report item to your report: For the purposes of this demo, you will use the following query from the **AdventureWorks** sample database: - ```SQL - SELECT - [Production].[Product].[Name] AS 'ProductName', - [Production].[ProductCategory].[Name] AS 'ProductCategory', - [Production].[ProductSubcategory].[Name] AS 'ProductSubCategory', - [Sales].[SalesOrderDetail].[LineTotal], - [Sales].[SalesOrderHeader].[OrderDate] - FROM (((([Sales].[SalesOrderDetail] - INNER JOIN [Sales].[SalesOrderHeader] - ON [Sales].[SalesOrderDetail].[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID]) - INNER JOIN [Production].[Product] - ON [Sales].[SalesOrderDetail].[ProductID] = [Production].[Product].[ProductID]) - INNER JOIN [Production].[ProductSubcategory] - ON [Production].[Product].[ProductSubcategoryID] = [Production].[ProductSubcategory].[ProductSubcategoryID]) - INNER JOIN [Production].[ProductCategory] - ON [Production].[ProductSubcategory].[ProductCategoryID] = [Production].[ProductCategory].[ProductCategoryID]) - ``` - + {{source=CodeSnippets\CS\SQL\SelectProductSalesByCategoryDate.sql}} 1. Preview the returned data and close the SqlDataSource wizard. ## Configuring the Crosstab diff --git a/wrd-user-guide/components/charts.md b/wrd-user-guide/components/charts.md index 3743c2eb9..551a7969f 100644 --- a/wrd-user-guide/components/charts.md +++ b/wrd-user-guide/components/charts.md @@ -65,22 +65,7 @@ The next sections in this article demonstrate how to add each of the available [ For this tutorial, use the following sample CSV data to create a CSV Data Source that will be used throughout this article: -```csv -Category,Year,Value -Accessories,2003,230 -Accessories,2004,340 -Bikes,2001,150 -Bikes,2002,195 -Bikes,2003,340 -Bikes,2004,265 -Clothing,2002,80 -Clothing,2003,120 -Clothing,2004,110 -Components,2001,230 -Components,2002,140 -Components,2003,280 -Components,2004,310 -``` +{{source=CodeSnippets\CS\CSV\CategorySalesData.csv}} diff --git a/wrd-user-guide/components/maps.md b/wrd-user-guide/components/maps.md index 0e416b30d..673cb5925 100644 --- a/wrd-user-guide/components/maps.md +++ b/wrd-user-guide/components/maps.md @@ -99,28 +99,7 @@ Since this tutorial uses the **AzureLocationProvider**, an Azure Maps subscripti Add a new [SQL Data Source](slug:web-report-designer-user-guide-components-data-sources) item with a connection to the AdventureWorks database. This data will be used to create the Pie Charts that are positioned on the map. Paste the following query in the `SELECT` statement box: -```SQL -SELECT -PS.Name AS ProductSubCategory, -SP.Name + ', ' + CR.Name AS State, -SOD.LineTotal as LineTotal -FROM - -Production.Product AS P -INNER JOIN Production.ProductSubcategory AS PS ON P.ProductSubcategoryID = PS.ProductSubcategoryID -INNER JOIN Production.ProductCategory AS PC ON PS.ProductCategoryID = PC.ProductCategoryID -INNER JOIN Sales.SalesOrderDetail AS SOD ON P.ProductID = SOD.ProductID -INNER JOIN Sales.SalesOrderHeader AS SOH ON SOD.SalesOrderID = SOH.SalesOrderID -INNER JOIN Person.Address AS ADDR ON ADDR.AddressID = SOH.ShipToAddressID -INNER JOIN Person.StateProvince AS SP ON SP.StateProvinceID = ADDR.StateProvinceID -INNER JOIN Person.CountryRegion AS CR ON CR.CountryRegionCode = SP.CountryRegionCode - -WHERE -CR.Name IN ('Australia') -AND DATEPART(YEAR, SOH.OrderDate) IN (2003, 2004) -AND PC.Name = 'Bikes' -``` - +{{source=CodeSnippets\CS\SQL\SelectProductSalesByState.sql}} ![Set up Map DataSource ><](images/wrd-components-tray-maps-map-data-source.png) ### Step 2: Building the Map Charts diff --git a/wrd-user-guide/components/subreport-item/creating-master-detail-report.md b/wrd-user-guide/components/subreport-item/creating-master-detail-report.md index 8a43e5248..8d2370d64 100644 --- a/wrd-user-guide/components/subreport-item/creating-master-detail-report.md +++ b/wrd-user-guide/components/subreport-item/creating-master-detail-report.md @@ -38,21 +38,7 @@ The next video demonstrates how to create master-detail reports by using SubRepo Here is the SQL query that selects the respective data: - ```SQL - SELECT - [dbo].[Products].[ProductID], - [dbo].[Products].[ProductName], - [dbo].[Products].[Discontinued], - [dbo].[Products].[SupplierID], - [dbo].[Products].[CategoryID], - [dbo].[Products].[QuantityPerUnit], - [dbo].[Products].[UnitPrice], - [dbo].[Products].[UnitsInStock], - [dbo].[Products].[UnitsOnOrder], - [dbo].[Products].[ReorderLevel] - FROM [dbo].[Products] - ``` - + {{source=CodeSnippets\CS\SQL\SelectAllProducts.sql}} 1. Set the **DataSource** of the report using the created SQLDataSource: ![Report DataSource ><](images/wrd-components-subreport-report-data-source.png) @@ -75,22 +61,7 @@ The next video demonstrates how to create master-detail reports by using SubRepo 1. Update the `SELECT` query of the added SQLDataSource and add a `WHERE` clause using an SQL parameter (which is mapped to the previously created report parameter): - ```SQL - SELECT - [dbo].[Products].[ProductID], - [dbo].[Products].[ProductName], - [dbo].[Products].[Discontinued], - [dbo].[Products].[SupplierID], - [dbo].[Products].[CategoryID], - [dbo].[Products].[QuantityPerUnit], - [dbo].[Products].[UnitPrice], - [dbo].[Products].[UnitsInStock], - [dbo].[Products].[UnitsOnOrder], - [dbo].[Products].[ReorderLevel] - FROM [dbo].[Products] - WHERE [dbo].[Products].[CategoryID]=@sqlParamCategoryId - ``` - + {{source=CodeSnippets\CS\SQL\SelectProductsByCategoryParam.sql}} ![Update SQL Select ><](images/wrd-components-subreport-update-sql-select.png) 1. Save the report (*ProductsReport.trdp*). You will use it as a child report. @@ -101,15 +72,7 @@ The next video demonstrates how to create master-detail reports by using SubRepo 1. Add a new [SQL Data Source](slug:web-report-designer-user-guide-components-data-sources) filled with the `Northwind.Categories` table: - ```SQL - SELECT - [dbo].[Categories].[CategoryID], - [dbo].[Categories].[CategoryName], - [dbo].[Categories].[Description], - [dbo].[Categories].[Picture] - FROM [dbo].[Categories] - ``` - + {{source=CodeSnippets\CS\SQL\SelectAllCategories.sql}} 1. Select the report's Detail section and use the [Table Wizard](slug:web-report-designer-user-guide-components-tables) to add a table bound to the just added SQLDataSource: ![Create Categories Table ><](images/wrd-components-subreport-create-categories-table.png) diff --git a/wrd-user-guide/customizing-report-items/stylesheet-formatting.md b/wrd-user-guide/customizing-report-items/stylesheet-formatting.md index abdb37b78..0393e1051 100644 --- a/wrd-user-guide/customizing-report-items/stylesheet-formatting.md +++ b/wrd-user-guide/customizing-report-items/stylesheet-formatting.md @@ -1,4 +1,4 @@ ---- +--- title: Styling Reports Using Style Sheets page_title: Web Report Designer - Styling Reports Using Style Sheets description: Learn how to customize the visuals of your report using the fine-grained, built-in styling model, similar to the Cascading Style Sheets (CSS) model. @@ -90,26 +90,7 @@ Still, the raw XML representation can be helpful for reviewing which style prope Here's an example that styles all TextBox items with a light gray background, dark blue text, and bold Arial font: -```XML - - - - - - - - - - -``` +{{source=CodeSnippets\MvcCS\XmlConfiguration\StylesheetConfiguration.xml region=StylesheetConfiguration}} And here's how it looks in the report preview: ![Preview External StyleSheet ><](images/wrd-preview-external-stylesheet.png) diff --git a/wrd-user-guide/query-builder.md b/wrd-user-guide/query-builder.md index 928ac5a9b..d48ec8a4f 100644 --- a/wrd-user-guide/query-builder.md +++ b/wrd-user-guide/query-builder.md @@ -3,7 +3,7 @@ title: Building SQL Queries page_title: Query Builder in the Web Report Designer description: "Learn more about the Query Builder in the Web Report Designer and how to use it to create basic queries easily in Telerik Reporting." slug: user-guide/query-builder -tags: query,builder,web,report,designer +tags: query, builder, web, report, designer tag: new published: True reportingArea: WRDHTML5, WRDBlazorWrapper @@ -24,7 +24,7 @@ The Web Report Designer lets you build SQL queries in two ways: * By using a visual tool (where you click and select options) * By using a text tool (where you type the query) -A query is just a set of instructions that specify what data you want from a database. By using a query, you connect your report only to the data you need. The Web Report Designer works with the most common data providers (like ADO.NET, ODBC, or OLEDB) as long as they can share details about the columns in the database using a feature called `GetSchema`. +A query is just a set of instructions that specifies what data you want from a database. By using a query, you connect your report only to the data you need. The Web Report Designer works with the most common data providers (like ADO.NET, ODBC, or OLEDB) as long as they can share details about the columns in the database using a feature called `GetSchema`. ![The Graphical SQL Query Builder Form of the Web Report Designer ><](images/QueryBuilderWRD.png) @@ -44,40 +44,28 @@ To create a query using the Query Builder in the Web Report Designer: 2. Add an [SQL Data Source item](slug:web-report-designer-user-guide-components-data-sources#sql-data-source). 3. Connect to the desired SQL Data Source. - > To follow along the steps below, use the AdventureWorks database. + > To follow along with the steps below, use the AdventureWorks database. 4. In the **Select statement** section, use the following query: - ````SQL - SELECT - [Production].[ProductCategory].[ProductCategoryID], - [Production].[ProductCategory].[Name] - FROM [Production].[ProductCategory] - ```` - + {{source=CodeSnippets\CS\SQL\SelectProductCategoryIdAndName.sql}} + 5. (Optional) Apply any schema restrictions that apply to your chosen SQL Data Source. 6. Click the **Query Builder** button. 7. In the new window, build your SELECT statement: - 7.1. In the left pane (the DataBase view), select the `Name` field from the `ProductCategory` and the `ProductSubcategory` tables. - - 7.2. In the **Add relationship** window, select the fields (`ProductCategoryID`) that link the two tables and click **Save**. - - 7.3. Select the `Name` field from the `Product` table. - - 7.4. Define the relationship between the `ProductSubcategory` and `Product` tables through the `ProductCategoryID` fields and then click **Save**. - - 7.5. Select the `ListPrice` field from the `Product` table. - - 7.6. Set the alias (display name) for each column. - - 7.7. To reduce the number of records that will be displayed, add a filter. For example, products with list price between 100 and 500. + 7.1. In the left pane (the DataBase view), select the `Name` field from the `ProductCategory` and the `ProductSubcategory` tables. + 7.2. In the **Add relationship** window, select the fields (`ProductCategoryID`) that link the two tables and click **Save**. + 7.3. Select the `Name` field from the `Product` table. + 7.4. Define the relationship between the `ProductSubcategory` and `Product` tables through the `ProductCategoryID` fields and then click **Save**. + 7.5. Select the `ListPrice` field from the `Product` table. + 7.6. Set the alias (display name) for each column. + 7.7. To reduce the number of records that will be displayed, add a filter. For example, products with a list price between 100 and 500. 8. To preview the query and the resulting data, expand the **RESULT** section and click **Preview**. - 9. Click **Save** to confirm your query. -The following video shows a step-by-step guide of the described scenario above: +The following video shows a step-by-step guide to the scenario described above: @@ -182,7 +170,7 @@ The Query Builder keeps your current settings. But if you change the SQL query m ### Schema Restrictions -The Web Report Designer’s Query Builder has an option called `Schema Restrictions`. This option lets you choose which parts of the database to load by listing them with commas. It helps report creators see only the needed information and makes loading faster. +The Web Report Designer’s Query Builder has an option called `Schema Restrictions`. This option lets you choose which parts of the database to load by listing them with commas. It helps report creators see only the information needed and makes loading faster. ```` null,Production,ProductCategory