Update how-to-set-up-in-.net-5-and-.net-core-3.1-applications.md (#509)

* Update how-to-set-up-in-.net-5-and-.net-core-3.1-applications.md

* Update how-to-set-up-in-.net-core-2.1-application.md

* Update how-to-set-up-in-.net-framework-application.md

* Update overview.md

* Update bookmark-action.md

* Delete how-to-add-a-bookmark-action.md

* Update custom-action.md

* Delete how-to-add-a-custom-action.md

* Update drilldown-report-action.md

* Delete how-to-add-a-drilldown-toggle-visibility-action.md

* Update drillthrough-report-action.md

* Delete how-to-add-a-drillthrough-navigate-to-report-action.md

* Update hyperlink-action.md

* Delete how-to-add-a-hyperlink-action.md
This commit is contained in:
Todor Arabadzhiev 2022-05-30 16:55:32 +03:00 коммит произвёл GitHub
Родитель 1811557004
Коммит 1d720e70de
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
14 изменённых файлов: 426 добавлений и 586 удалений

Просмотреть файл

@ -175,10 +175,10 @@ Path.Combine(sp.GetService<IWebHostEnvironment>().WebRootPath, "Reports")
<div id="webReportDesigner">
loading...
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" /script>
<script src="https://kendo.cdn.telerik.com/2022.1.301/js/kendo.all.min.js" /script>
<script src="/api/reportdesigner/resources/js/telerikReportViewer/" /script>
<script src="/api/reportdesigner/designerresources/js/webReportDesigner/" /script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2022.1.301/js/kendo.all.min.js"></script>
<script src="/api/reportdesigner/resources/js/telerikReportViewer/"></script>
<script src="/api/reportdesigner/designerresources/js/webReportDesigner/"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#webReportDesigner").telerik_WebReportDesigner({

Просмотреть файл

@ -42,94 +42,100 @@ If you don't use NuGet packages, along with the above assemblies, you need to ad
1. Inject the [IConfiguration](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.configuration.iconfiguration?view=dotnet-plat-ext-5.0) and [IHostingEnvironment](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.ihostingenvironment?view=aspnetcore-2.1) in the constructor of the Startup class. We will need them later to get the configuration settings and the relative paths:
````c#
````C#
public Startup(IConfiguration configuration, IHostingEnvironment hostingEnvironment)
{
Configuration = configuration;
HostingEnvironment = hostingEnvironment;
}
public IConfiguration Configuration { get; }
public IHostingEnvironment HostingEnvironment { get; }
{
Configuration = configuration;
HostingEnvironment = hostingEnvironment;
}
public IConfiguration Configuration { get; }
public IHostingEnvironment HostingEnvironment { get; }
````
1. The __ConfigureServices__ method inside the __Startup.cs__ in the project should be modified in order to enable the Web Report Designer Service functionality. Make sure the application calls the following methods that add MVC functionality and prevent from potentially breaking behavior changes between ASP.NET Core versions:
1. The `ConfigureServices` method inside the `Startup.cs` in the project should be modified in order to enable the Web Report Designer Service functionality. Make sure the application calls the following methods that add MVC functionality and prevent from potentially breaking behavior changes between ASP.NET Core versions:
````c#
````C#
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
````
1. Make sure the configuration inside the __Configure__ method of the __Startup.cs__ is set up for MVC by adding the following line:
1. Make sure the configuration inside the `Configure` method of the `Startup.cs` is set up for MVC by adding the following line:
````c#
````C#
app.UseMvc();
````
1. Assure also that the application configuration inside the __Configure__ method can serve static files:
1. Assure also that the application configuration inside the `Configure` method can serve static files:
````c#
````C#
app.UseStaticFiles();
````
## Add Configuration Settings in the Startup.cs file
The report generation engine can retrieve Sql Connection Strings and specific Report Generation Engine Settings that provide flexibility of the deployed application. It utilizes the [IConfiguration interface](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.configuration.iconfiguration?view=dotnet-plat-ext-5.0) for this purpose.
The .NET Core 2.1 applications use a [key-value JSON-based](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.1) file named by default __appSettings.json__. The default ReportingEngineConfiguration:
The .NET Core 2.1 applications use a [key-value JSON-based](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.1) file named by default `appSettings.json`. The default ReportingEngineConfiguration:
````C#
ReportingEngineConfiguration = sp.GetService<IConfiguration>()
````
will be initialized from __appSettings.json__ or __appsettings.{EnvironmentName}.json__.
will be initialized from `appSettings.json` or `appsettings.{EnvironmentName}.json`.
To activate JSON file configuration with a different name, for example, __reportingAppSettings.json__, call the [AddJsonFile](https://docs.microsoft.com/dotnet/api/microsoft.extensions.configuration.jsonconfigurationextensions.addjsonfile/) extension method on an instance of [ConfigurationBuilder](https://docs.microsoft.com/dotnet/api/microsoft.extensions.configuration.configurationbuilder). Here are the exact steps you may follow:
To activate JSON file configuration with a different name, for example, `reportingAppSettings.json`, call the [AddJsonFile](https://docs.microsoft.com/dotnet/api/microsoft.extensions.configuration.jsonconfigurationextensions.addjsonfile/) extension method on an instance of [ConfigurationBuilder](https://docs.microsoft.com/dotnet/api/microsoft.extensions.configuration.configurationbuilder). Here are the exact steps you may follow:
1. Add a new __ResolveSpecificReportingConfiguration__ class as a separate file or in the Startup.cs file (optional)
1. Add a new `ResolveSpecificReportingConfiguration` class as a separate file or in the Startup.cs file (optional)
````c#
static IConfiguration ResolveSpecificReportingConfiguration(IHostingEnvironment environment)
{
// If a specific configuration needs to be passed to the reporting engine, add it through a new IConfiguration instance.
var reportingConfigFileName = System.IO.Path.Combine(environment.ContentRootPath, "reportingAppSettings.json");
return new ConfigurationBuilder()
.AddJsonFile(reportingConfigFileName, true)
.Build();
}
````C#
static IConfiguration ResolveSpecificReportingConfiguration(IHostingEnvironment environment)
{
// If a specific configuration needs to be passed to the reporting engine, add it through a new IConfiguration instance.
var reportingConfigFileName = System.IO.Path.Combine(environment.ContentRootPath, "reportingAppSettings.json");
return new ConfigurationBuilder()
.AddJsonFile(reportingConfigFileName, true)
.Build();
}
````
1. Add the required services in the `ConfigureServices` method. Here is how it may look finally:
````C#
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
var reportsPath = Path.Combine(this.HostingEnvironment.ContentRootPath, "Reports");
// Configure dependencies for ReportsController.
services.TryAddSingleton<IReportServiceConfiguration>(sp =>
new ReportServiceConfiguration
{
// The default ReportingEngineConfiguration will be initialized from appsettings.json or appsettings.{EnvironmentName}.json:
ReportingEngineConfiguration = sp.GetService<IConfiguration>(),
// In case the ReportingEngineConfiguration needs to be loaded from a specific configuration file, use the approach below:
// ReportingEngineConfiguration = ResolveSpecificReportingConfiguration(sp.GetService<IHostingEnvironment>()),
HostAppId = "Html5DemoAppCore",
Storage = new FileStorage(),
ReportSourceResolver = new TypeReportSourceResolver()
.AddFallbackResolver(new UriReportSourceResolver(reportsPath)),
});
// Configure dependencies for ReportDesignerController.
services.TryAddSingleton<IReportDesignerServiceConfiguration>(sp => new ReportDesignerServiceConfiguration
{
DefinitionStorage = new FileDefinitionStorage(reportsPath),
SettingsStorage = new FileSettingsStorage(
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Telerik Reporting")),
ResourceStorage = new ResourceStorage(
Path.Combine(reportsPath, "Resources")),
});
}
````
1. Add the required services in the __ConfigureServices__ method. Here is how it may look finally:
````c#
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
var reportsPath = Path.Combine(this.HostingEnvironment.ContentRootPath, "Reports");
// Configure dependencies for ReportsController.
services.TryAddSingleton<IReportServiceConfiguration>(sp =>
new ReportServiceConfiguration
{
// The default ReportingEngineConfiguration will be initialized from appsettings.json or appsettings.{EnvironmentName}.json:
ReportingEngineConfiguration = sp.GetService<IConfiguration>(),
// In case the ReportingEngineConfiguration needs to be loaded from a specific configuration file, use the approach below:
// ReportingEngineConfiguration = ResolveSpecificReportingConfiguration(sp.GetService<IHostingEnvironment>()),
HostAppId = "Html5DemoAppCore",
Storage = new FileStorage(),
ReportSourceResolver = new TypeReportSourceResolver()
.AddFallbackResolver(new UriReportSourceResolver(reportsPath)),
});
// Configure dependencies for ReportDesignerController.
services.TryAddSingleton<IReportDesignerServiceConfiguration>(sp => new ReportDesignerServiceConfiguration
{
DefinitionStorage = new FileDefinitionStorage(reportsPath),
SettingsStorage = new FileSettingsStorage(
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Telerik Reporting")),
ResourceStorage = new ResourceStorage(
Path.Combine(reportsPath, "Resources")),
});
}
````
1. Add a new folder named __Reports__ in the main application folder according to the above settings. We will use the folder as report definition storage. Add some report definitions inside, for example, our "Product Catalog.trdp" demo report we are going to reference in the designer web page.
1. Add a new folder named `Reports` in the main application folder according to the above settings. We will use the folder as report definition storage. Add some report definitions inside, for example, our "Product Catalog.trdp" demo report we are going to reference in the designer web page.
## Setting up the Report Designer REST service:
@ -137,77 +143,78 @@ The REST service works as a backend and is responsible for storage operations li
1. Make sure that a key-value JSON-based file is available in your project and add the required [configuration settings in it]({%slug telerikreporting/using-reports-in-applications/export-and-configure/configure-the-report-engine/overview%}#json-based-configuration), for example the __ConnectionStrings__.
1. Implement a Report Designer controller. Create the __Controllers__ folder if it doesn't exist, right-click on it and add a new item: Add > New item... > __API Controller - Empty__ item. Name it ReportDesignerController. This will be our Telerik Web Report Designer REST service in the project.
1. Implement a Report Designer controller. Create the `Controllers` folder if it doesn't exist, right-click on it and add a new item: Add > New item... > __API Controller - Empty__ item. Name it ReportDesignerController. This will be our Telerik Web Report Designer REST service in the project.
1. Inherit the [ReportDesignerControllerBase](/reporting/api/Telerik.Reporting.Services.WebApi.ReportDesignerControllerBase) type and inject the required configuration settings in the constructor. Along with the ReportServiceConfiguration there is another configuration instance named ReportDesignerServiceConfiguration, which will initialize the definition storage. This is the class responsible for opening, saving, etc. the report definitions. This is how a basic implementation of the controller should look like:
````c#
````C#
namespace CSharp.AspNetCoreDemo.Controllers
{
using Microsoft.AspNetCore.Mvc;
using Telerik.Reporting.Services;
using Telerik.WebReportDesigner.Services;
using Telerik.WebReportDesigner.Services.Controllers;
[Route("api/reportdesigner")]
public class ReportDesignerController : ReportDesignerControllerBase
{
public ReportDesignerController(IReportDesignerServiceConfiguration reportDesignerServiceConfiguration, IReportServiceConfiguration reportServiceConfiguration)
: base(reportDesignerServiceConfiguration, reportServiceConfiguration)
{
}
}
}
{
using Microsoft.AspNetCore.Mvc;
using Telerik.Reporting.Services;
using Telerik.WebReportDesigner.Services;
using Telerik.WebReportDesigner.Services.Controllers;
[Route("api/reportdesigner")]
public class ReportDesignerController : ReportDesignerControllerBase
{
public ReportDesignerController(IReportDesignerServiceConfiguration reportDesignerServiceConfiguration, IReportServiceConfiguration reportServiceConfiguration)
: base(reportDesignerServiceConfiguration, reportServiceConfiguration)
{
}
}
}
````
1. To ensure that the service operates, run the application and navigate to URL __{applicationRoot}/api/reportdesigner/cultureContext__. It should return a JSON representing the separators determined by the current culture, for example:
````js
````JS
{"decimalSeparator":".","listSeparator":","}
````
## Adding the Web Report Designer:
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, for example __webReportDesigner.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:
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, for example `webReportDesigner.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
````HTML
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Telerik Web Report Designer Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500&display=swap" rel="stylesheet">
</head>
<body>
<div id="webReportDesigner">
loading...
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" /script>
<script src="https://kendo.cdn.telerik.com/2022.1.301/js/kendo.all.min.js" /script>
<script src="api/reportdesigner/resources/js/telerikReportViewer" /script>
<script src="api/reportdesigner/designerresources/js/webReportDesigner" /script>
<script type="text/javascript">
$(document).ready(function () {
$("#webReportDesigner").telerik_WebReportDesigner({
persistSession: false,
toolboxArea: {
layout: "list"
},
serviceUrl: "api/reportdesigner/",
report: "Product Catalog.trdp"
}).data("telerik_WebDesigner");
});
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Telerik Web Report Designer Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500&display=swap" rel="stylesheet">
</head>
<body>
<div id="webReportDesigner">
loading...
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2022.1.301/js/kendo.all.min.js"></script>
<script src="api/reportdesigner/resources/js/telerikReportViewer"></script>
<script src="api/reportdesigner/designerresources/js/webReportDesigner"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#webReportDesigner").telerik_WebReportDesigner({
persistSession: false,
toolboxArea: {
layout: "list"
},
serviceUrl: "api/reportdesigner/",
report: "Product Catalog.trdp"
}).data("telerik_WebDesigner");
});
</script>
</body>
</html>
````
1. To setup the new page as startup 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 webReportDesigner.html in *launchSettings.json*.
1. Finally, run the project to preview the web designer.
## Examples
Find the complete example setup of the Web Report Designer in the __AspNetCoreDemo__ located in Telerik Reporting installation folder. For example, *%PROGRAMFILES(x86)%\Progress\Telerik Reporting*. The Web Report Designers page is in __wwwroot__ folder. To setup the page to be a startup page, change the launchUrl to webReportDesigner.html in *launchSettings.json*.
Find the complete example setup of the Web Report Designer in the __AspNetCoreDemo__ located in Telerik Reporting installation folder. For example, *%PROGRAMFILES(x86)%\Progress\Telerik Reporting*. The Web Report Designers page is in `wwwroot` folder. To setup the page to be a startup page, change the launchUrl to webReportDesigner.html in *launchSettings.json*.

Просмотреть файл

@ -30,122 +30,123 @@ When you use NuGet packages, the dependencies will be automatically resolved. Ot
The REST service works as a backend and is responsible for storage operations like creating, opening, or saving report definitions. The following steps describe how to configure it:
1. Implement a Report Designer controller. Right-click on the __Controllers__ folder and add a new item: __Add__ > __New item__ > __Web API Controller Class__ item. Name it __ReportDesignerController__. This will be our Telerik Web Report Designer REST service in the project.
1. Implement a Report Designer controller. Right-click on the `Controllers` folder and add a new item: __Add__ > __New item__ > __Web API Controller Class__ item. Name it `ReportDesignerController`. This will be our Telerik Web Report Designer REST service in the project.
1. Inherit the [ReportDesignerControllerBase](/reporting/api/Telerik.Reporting.Services.WebApi.ReportDesignerControllerBase) type and setup the `ReportServiceConfiguration` instance. Notice that there is another configuration instance named `ReportDesignerServiceConfiguration`, which will initialize the definition storage. This is the class, responsible for opening, saving etc. the report definitions. This is how a basic implementation of the controller should look like:
````c#
````C#
namespace CSharp.MvcDemo.Controllers
{
using System;
using System.IO;
using System.Web;
using System.Web.Http;
using Telerik.Reporting.Cache.File;
using Telerik.Reporting.Services;
using Telerik.Reporting.Services.WebApi;
using Telerik.WebReportDesigner.Services;
using Telerik.WebReportDesigner.Services.Controllers;
//The class name determines the service URL.
//ReportsController class name defines /api/report/ service URL.
[Route("api/reportdesigner")]
public class ReportDesignerController : ReportDesignerControllerBase
{
static ReportServiceConfiguration configurationInstance;
static ReportDesignerServiceConfiguration designerConfigurationInstance;
static ReportDesignerController()
{
//This is the folder that contains the report definitions
//In this case this is the Reports folder
var appPath = HttpContext.Current.Server.MapPath("~/");
var reportsPath = Path.Combine(appPath, "Reports");
//Add report source resolver for trdx/trdp report definitions,
//then add resolver for class report definitions as fallback resolver;
//finally create the resolver and use it in the ReportServiceConfiguration instance.
var resolver = new UriReportSourceResolver(reportsPath);
//Setup the ReportServiceConfiguration
configurationInstance = new ReportServiceConfiguration
{
HostAppId = "Html5App",
Storage = new FileStorage(),
ReportSourceResolver = resolver,
ReportSharingTimeout = 1000,
ClientSessionTimeout = 20,
};
designerConfigurationInstance = new ReportDesignerServiceConfiguration
{
DefinitionStorage = new FileDefinitionStorage(reportsPath),
SettingsStorage = new FileSettingsStorage(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Telerik Reporting"))
};
}
public ReportDesignerController()
{
//Initialize the service configuration
this.ReportServiceConfiguration = configurationInstance;
this.ReportDesignerServiceConfiguration = designerConfigurationInstance;
}
}
}
{
using System;
using System.IO;
using System.Web;
using System.Web.Http;
using Telerik.Reporting.Cache.File;
using Telerik.Reporting.Services;
using Telerik.Reporting.Services.WebApi;
using Telerik.WebReportDesigner.Services;
using Telerik.WebReportDesigner.Services.Controllers;
//The class name determines the service URL.
//ReportsController class name defines /api/report/ service URL.
[Route("api/reportdesigner")]
public class ReportDesignerController : ReportDesignerControllerBase
{
static ReportServiceConfiguration configurationInstance;
static ReportDesignerServiceConfiguration designerConfigurationInstance;
static ReportDesignerController()
{
//This is the folder that contains the report definitions
//In this case this is the Reports folder
var appPath = HttpContext.Current.Server.MapPath("~/");
var reportsPath = Path.Combine(appPath, "Reports");
//Add report source resolver for trdx/trdp report definitions,
//then add resolver for class report definitions as fallback resolver;
//finally create the resolver and use it in the ReportServiceConfiguration instance.
var resolver = new UriReportSourceResolver(reportsPath);
//Setup the ReportServiceConfiguration
configurationInstance = new ReportServiceConfiguration
{
HostAppId = "Html5App",
Storage = new FileStorage(),
ReportSourceResolver = resolver,
ReportSharingTimeout = 1000,
ClientSessionTimeout = 20,
};
designerConfigurationInstance = new ReportDesignerServiceConfiguration
{
DefinitionStorage = new FileDefinitionStorage(reportsPath),
SettingsStorage = new FileSettingsStorage(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Telerik Reporting"))
};
}
public ReportDesignerController()
{
//Initialize the service configuration
this.ReportServiceConfiguration = configurationInstance;
this.ReportDesignerServiceConfiguration = designerConfigurationInstance;
}
}
}
````
## Adding the Web Report Designer:
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:
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:
````html
````HTML
@using Telerik.Reporting
@{
Layout = null;
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Telerik Web Report Designer Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500&display=swap" rel="stylesheet">
</head>
<body>
<div id="webReportDesigner">
loading...
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" /script>
<script src="https://kendo.cdn.telerik.com/2022.1.301/js/kendo.all.min.js" /script>
<script src="/api/reportdesigner/resources/js/telerikReportViewer" /script>
<script src="/api/reportdesigner/designerresources/js/webReportDesigner" /script>
<script type="text/javascript">
$(document).ready(function () {
$("#webReportDesigner").telerik_WebReportDesigner({
persistSession: false,
toolboxArea: {
layout: "list"
},
serviceUrl: "/api/reportdesigner/",
report: "SampleReport.trdp"
}).data("telerik_WebDesigner");
});
</script>
</body>
</html>
@{
Layout = null;
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Telerik Web Report Designer Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500&display=swap" rel="stylesheet">
</head>
<body>
<div id="webReportDesigner">
loading...
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>>
<script src="https://kendo.cdn.telerik.com/2022.1.301/js/kendo.all.min.js"></script>>
<script src="/api/reportdesigner/resources/js/telerikReportViewer"></script>>
<script src="/api/reportdesigner/designerresources/js/webReportDesigner"></script>>
<script type="text/javascript">
$(document).ready(function () {
$("#webReportDesigner").telerik_WebReportDesigner({
persistSession: false,
toolboxArea: {
layout: "list"
},
serviceUrl: "/api/reportdesigner/",
report: "SampleReport.trdp"
}).data("telerik_WebDesigner");
});
</script>
</body>
</html>
````
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__ in it.
1. Register the *ReportsControllerConfiguration* and *ReportDesignerControllerConfiguration* routes in the `Application_Start()` method of the __Global.asax__ file. It is important to register them before the default routes as shown below:
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` in it.
1. Register the *ReportsControllerConfiguration* and *ReportDesignerControllerConfiguration* routes in the `Application_Start()` method of the `Global.asax` file. It is important to register them before the default routes as shown below:
````html
````HTML
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
Telerik.Reporting.Services.WebApi.ReportsControllerConfiguration.RegisterRoutes(System.Web.Http.GlobalConfiguration.Configuration);
Telerik.WebReportDesigner.Services.WebApi.ReportDesignerControllerConfiguration.RegisterRoutes(System.Web.Http.GlobalConfiguration.Configuration);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
Telerik.Reporting.Services.WebApi.ReportsControllerConfiguration.RegisterRoutes(System.Web.Http.GlobalConfiguration.Configuration);
Telerik.WebReportDesigner.Services.WebApi.ReportDesignerControllerConfiguration.RegisterRoutes(System.Web.Http.GlobalConfiguration.Configuration);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
````
1. In case the reports shown in the viewer need access to a database, add the necessary connection strings to the __web.config__ file.
1. In case the reports shown in the viewer need access to a database, add the necessary connection strings to the `web.config` file.
1. Finally, run the project to preview the web designer.

Просмотреть файл

@ -38,3 +38,23 @@ Culture affects the way strings are formatted in Telerik Reporting. For example,
* __Text Direction (LTR/RTL)__
Middle Eastern languages such as Hebrew and Arabic are generally written from right to left. If your TextBox will contain text written using a RTL script, then you simply need to specify the appropriate Culture, for example "he" for Hebrew and "ar" for Arabic.
# See Also
* [HTML5 Report Viewer Localization]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/customizing/localization%})
* [Angular Report Viewer Localization]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/angular-report-viewer/customizing/localization%})
* [React Report Viewer Localization]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/react-report-viewer/customizing/localization%})
* [HTML5 ASP.NET MVC Report Viewer Localization]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-asp.net-mvc-report-viewer/customizing/localization%})
* [HTML5 ASP.NET Web Forms Report Viewer Localization]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-asp.net-web-forms-report-viewer/customizing/localization%})
* [Windows Forms Report Viewer Localization]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/windows-forms-application/report-viewer-localization%})
* [WPF Report Viewer Localization]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/wpf-application/report-viewer-localization%})
* [Silverlight Forms Report Viewer Localization]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/silverlight-application/report-viewer-localization%})
* [(legacy) ASP.NET Web Forms Report Viewer Localization]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/asp.net-web-forms-report-viewer/report-viewer-localization%})

Просмотреть файл

@ -12,7 +12,37 @@ position: 4
A bookmark action is a link that a user clicks to move to another area or report item in a report. To create a bookmark, set a bookmark on the destination report item and add bookmark action on report items that users should click to jump to the bookmarked report item. You can set bookmarks on any report item, including text boxes, images, charts, and gauges. You can add multiple bookmark actions to the same bookmark. To define a bookmark action add a [NavigateToBookmarkAction](/reporting/api/Telerik.Reporting.NavigateToBookmarkAction) on another report item/section.
# How to Add a Bookmark Action
## Adding a bookmark action using the Report Designer
1. In Design view, right-click the report item to which you want to add a link and then click __Properties__.
1. In The Properties dialog box for that report item, click __Action__.
1. Select __Navigate to bookmark__. An additional section appears in the dialog box for this option.
1. In the __Target bookmark by Value__ textbox, type a bookmark or an expression that
evaluates to a bookmark.
1. Click __OK__.
1. To test the link, run the report and click the report item with the applied Action. For TextBox items, it is
helpful to change the style of the text to indicate to the user that the text is a link. For example,
change the color to blue and the effect to underline by setting the corresponding Font properties of the TextBox.
## Adding a bookmark action programatically
{{source=CodeSnippets\CS\API\Telerik\Reporting\ActionSnippets.cs region=AddNewNavigateToBookMarkSnippet}}
{{source=CodeSnippets\VB\API\Telerik\Reporting\ActionSnippets.vb region=AddNewNavigateToBookMarkSnippet}}
# See Also
* [How to: Add a Bookmark Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-bookmark-action%})
* [Drillthrough Report Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/drillthrough-report-action%})
* [Hyperlink Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/hyperlink-action%})
* [Expressions Overview]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/overview%})
* [Data Items Overview]({%slug telerikreporting/designing-reports/connecting-to-data/data-items/overview%})

Просмотреть файл

@ -17,46 +17,30 @@ To define a [CustomAction](/reporting/api/Telerik.Reporting.CustomAction) use th
Here is an example how to get the custom action's parameters in __InteractiveActionExecuting()__ event of __WinForms Report Viewer__.
{{source=CodeSnippets\CS\API\Telerik\ReportViewer\WinForms\Form1.cs region=WinFormsCustomInteractiveActionExecutingEventSnippet}}
````C#
void reportViewer1_CustomInteractiveActionExecuting(object sender, Telerik.ReportViewer.Common.InteractiveActionCancelEventArgs args)
{
var strB = new System.Text.StringBuilder();
strB.AppendLine("ReportItem name: " + args.Action.ReportItemName);
var customAction = args.Action as Telerik.Reporting.Processing.CustomAction;
if (null != customAction)
{
foreach (var p in customAction.Parameters)
{
strB.AppendLine(string.Format("Parameter \"{0}\" value: {1}", p.Key, p.Value));
}
}
strB.AppendLine(string.Format("Mouse cursor position: {0}; Item bounds: {1}", args.CursorPos, args.Bounds));
MessageBox.Show(strB.ToString());
}
````
{{source=CodeSnippets\VB\API\Telerik\ReportViewer\WinForms\Form1.vb region=WinFormsCustomInteractiveActionExecutingEventSnippet}}
````VB
' Handles the InteractiveActionExecuting event
' Do not forget to add the WithEvents clause on ReportViewer1 instantiation if needed.
Private Sub reportViewer1_CustomInteractiveActionExecuting(sender As Object, args As Telerik.ReportViewer.Common.InteractiveActionCancelEventArgs) Handles ReportViewer1.InteractiveActionExecuting
Dim strB = New System.Text.StringBuilder()
strB.AppendLine("ReportItem name: " + args.Action.ReportItemName)
Dim customAction = TryCast(args.Action, Telerik.Reporting.Processing.CustomAction)
If customAction IsNot Nothing Then
For Each p As KeyValuePair(Of String, Object) In customAction.Parameters
strB.AppendLine(String.Format("Parameter ""{0}"" value: {1}", p.Key, p.Value))
Next
End If
strB.AppendLine(String.Format("Mouse cursor position: {0}; Item bounds: {1}", args.CursorPos, args.Bounds))
MessageBox.Show(strB.ToString())
End Sub
````
# How to Add a Custom Action
## Adding a custom action using the Report Designer
1. In Design view, right-click the report item to which you want to add a link and then click __Properties__.
1. In The Properties dialog box for that report item, click __Action__. The [Edit Action dialog]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/edit-action-dialog%}) will open.
1. Select __Custom__. An additional section appears in the dialog box, containing a button titled __Select parameters__.
1. Clicking the button will open the __Edit Custom Action Parameters__ dialog box. Add one or more parameters, defining their *Name* and *Value* properties.
1. Click __OK__ when ready.
1. To test the action, preview the report and click the report item with the applied custom action. A message will appear, displaying information for the action's properties.
## Adding a custom action programatically
{{source=CodeSnippets\CS\API\Telerik\Reporting\ActionSnippets.cs region=AddNewCustomActionSnippet}}
{{source=CodeSnippets\VB\API\Telerik\Reporting\ActionSnippets.vb region=AddNewCustomActionSnippet}}
# See Also
@ -64,4 +48,6 @@ End Sub
* [Interactive Action Events]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/interactive-action-events%})
* [How to Add a Custom Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-custom-action%})
* [Expressions]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/overview%})
* [Data Items]({%slug telerikreporting/designing-reports/connecting-to-data/data-items/overview%})

Просмотреть файл

@ -18,10 +18,70 @@ To define a drilldown action add a [ToggleVisibilityAction](/reporting/api/Teler
>note The report item that you use for the __toggle visibility__ action must be in a containing scope that controls the item that you want to show or hide. Example: to hide a row group, the report item must be in a row group associated with the parent group or higher in the containment hierarchy.
# How to Add a Drilldown/Toggle Visibility Action
A report item can initially display or be hidden when a user views a report. The toggle action applied on the report item that allows you to hide and display items interactively is known as drilldown action.
## Adding a drilldown action to a report item using the Report Designer
1. In Design view, right-click a report item to which you want to add a toggle visibility action and then click __Properties__.
1. In the item's __Properties__ dialog box, click __Action__.
1. Select __Toggle Visibility__. Additional sections appear in the dialog box for this option.
1. Click __Edit toggle targets__ button, which opens __Edit toggle Visibility targets__ dialog.
1. Click __New__ button to add a new toggle action. Select a report item from the combobox to set it as toggle target, which visibility will be toggled when the action is triggered.
1. To add more toggle targets, repeat steps 4 and 5.
1. The __Toggle mark initially expanded__ checkbox determines if the item exposing the action will be rendered initially with expanded or with collapsed mark.
1. To test the toggle, run the report and click the text box with the toggle mark. The report display refreshes to show report items with their toggled visibility.
>note The report item must be in the same container hierarchy or higher (up to the report itself).
## Adding a drilldown action to a Table, CrossTab or ListBox group using the Report Designer
1. In Design view, click the Table, CrossTab or ListBox to select it. The [Group Explorer]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/group-explorer%}).
1. Locate the __Display Mode__ combo in the title bar of the Group Explorer and select Extended Mode. This toggles to show the underlying display structure for rows and columns.
1. Right-click the name of the row group or column group for which you want to hide the associated rows or columns and select __Group Properties__.
1. Alter the __Visible__ property to indicate whether the group is displayed initially expanded or collapsed (default is expanded). Click __OK__.
1. In Design view, right-click the report item representing the row group or column group to which you want to add a toggle visibility action and then click __Properties__.
1. In the item's __Properties__ dialog box, click __Action__.
1. Select __Toggle Visibility__. Additional sections appear in the dialog box for this option.
1. Click __Edit toggle targets__ button, which opens __Edit toggle Visibility targets__ dialog.
1. Click __New__ button to add a new toggle action. Select a row group or column group from the combobox to set it as toggle target, which visibility will be toggled when the action is triggered.
1. To add more toggle targets, repeat steps 8 and 9.
1. The __Toggle mark initially expanded__ checkbox determines if the item exposing the action will be rendered initially with expanded or with collapsed mark.
1. To test the toggle, run the report and click the text box with the toggle mark. The report display refreshes to show report items with their toggled visibility.
>note The report item must either be in the same group as the item that is being hidden or in an ancestor group.
## Adding a drilldown action programatically
{{source=CodeSnippets\CS\API\Telerik\Reporting\ActionSnippets.cs region=AddNewToggleVisibilitySnippet}}
{{source=CodeSnippets\VB\API\Telerik\Reporting\ActionSnippets.vb region=AddNewToggleVisibilitySnippet}}
# See Also
* [How to Add a Drilldown/Toggle Visibility Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-drilldown-toggle-visibility-action%})
* [ToggleVisibilityAction](/reporting/api/Telerik.Reporting.ToggleVisibilityAction)
* [Drilldown Report Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/drilldown-report-action%})
* [Drillthrough Report Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/drillthrough-report-action%})
* [How to Add a Drillthrough/Navigate To Report Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-drillthrough-navigate-to-report-action%})

Просмотреть файл

@ -20,8 +20,40 @@ To define a drill-through action add a [NavigateToReportAction](/reporting/api/T
>note The Target report of a drill-through action should always have a default constructor, so it can be instantiated.
> We recommend the usage of TypeReportSource ('Type name' option) or UriReportSource ('Url or file' option) in the [Load Report Dialog]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/load-report-dialog%}) on configuring the target report. InstanceReportSource ('Object instance' option) is only supported for WinForms and WPF Report Viewers in Embedded mode.
# How to Add a Drillthrough/Navigate To Report Action
A report can contain links to other reports. The report that opens when you click the link in the main report is known as a drillthrough report. Drillthrough reports must be published to the same report server as the main report, but they can be in different folders. You can add a drillthrough link to any item that has an Action property.
> We recommend the usage of TypeReportSource ('Type name' option) or UriReportSource ('Url or file' option) in the [Load Report Dialog]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/load-report-dialog%})) on configuring the target report. InstanceReportSource ('Object instance' option) is only supported for WinForms and WPF Report Viewers in Embedded mode.
## Adding a drillthrough action using the Report Designer
1. In Design view, right-click a report item to which you want to add a link and then click __Properties__.
1. In the item's __Properties__ dialog box, click __Action__.
1. Select __Navigate to Report__. Additional section appears which allows you to select a __ReportSource__.
1. In the __Choose a Report Source__ dialog, select how you would navigate to the report, For this example we would use __Type Report Source__ , click that option and select the report that you would like to navigate to. If you have to specify parameters for the drillthrough report, follow the next step.
1. Click __Edit Parameters__ button - __Edit Parameters__ dialog appears. Click __New__. In the __Parameter Name__ column select the name of the report parameter in the drillthrough report. In the __Parameter Value__ , type or select the value to pass to the parameter in the drillthrough report.
1. To test the link, run the report and click the report item with the applied __Action__. For TextBoxes, it is helpful to change the color and effect of the text to indicate that the text is a link. For example, change the color to blue and the effect to underline by setting the corresponding __Font__ properties of the TextBox.
## Adding a drillthrough action programatically
{{source=CodeSnippets\CS\API\Telerik\Reporting\ActionSnippets.cs region=AddNewNavigateToReportSnippet}}
{{source=CodeSnippets\VB\API\Telerik\Reporting\ActionSnippets.vb region=AddNewNavigateToReportSnippet}}
# See Also
* [How to Add a Drillthrough/Navigate To Report Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-drillthrough-navigate-to-report-action%})
* [Bookmark Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/bookmark-action%})
* [Hyperlink Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/hyperlink-action%})
* [Expressions Overview]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/overview%})
* [Data Items Overview]({%slug telerikreporting/designing-reports/connecting-to-data/data-items/overview%})

Просмотреть файл

@ -1,55 +0,0 @@
---
title: How to Add a Bookmark Action
page_title: How to Add a Bookmark Action
description: How to Add a Bookmark Action
slug: telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-bookmark-action
tags: how,to,add,a,bookmark,action
published: True
position: 1
---
# How to Add a Bookmark Action
## Adding a bookmark action using the Report Designer
1. In Design view, right-click the report item to which you want to add a link and then click __Properties__.
1. In The Properties dialog box for that report item, click __Action__.
1. Select __Navigate to bookmark__. An additional section appears in the dialog box for this option.
1. In the __Target bookmark by Value__ textbox, type a bookmark or an expression that
evaluates to a bookmark.
1. Click __OK__.
1. To test the link, run the report and click the report item with the applied Action. For TextBox items, it is
helpful to change the style of the text to indicate to the user that the text is a link. For example,
change the color to blue and the effect to underline by setting the corresponding Font properties of the TextBox.
## Adding a bookmark action programatically
{{source=CodeSnippets\CS\API\Telerik\Reporting\ActionSnippets.cs region=AddNewNavigateToBookMarkSnippet}}
````C#
Telerik.Reporting.NavigateToBookmarkAction bookmarkAction1 = new Telerik.Reporting.NavigateToBookmarkAction();
textBox2.DocumentMapText = "MyBookMark";
bookmarkAction1.TargetBookmarkId = "MyBookMark";
textBox1.Action = bookmarkAction1;
````
{{source=CodeSnippets\VB\API\Telerik\Reporting\ActionSnippets.vb region=AddNewNavigateToBookMarkSnippet}}
````VB
Dim bookmarkAction1 As New Telerik.Reporting.NavigateToBookmarkAction()
textBox2.DocumentMapText = "MyBookMark"
bookmarkAction1.TargetBookmarkId = "MyBookMark"
textBox1.Action = bookmarkAction1
````
# See Also
* [How to: Add a Drillthrough Report Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-drillthrough-navigate-to-report-action%})
* [How to: Add a Hyperlink Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-hyperlink-action%})
* [Expressions Overview]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/overview%})
* [Data Items Overview]({%slug telerikreporting/designing-reports/connecting-to-data/data-items/overview%})

Просмотреть файл

@ -1,52 +0,0 @@
---
title: How to Add a Custom Action
page_title: How to Add a Custom Action
description: How to Add a Custom Action
slug: telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-custom-action
tags: how,to,add,a,custom,action
published: True
position: 4
---
# How to Add a Custom Action
## Adding a custom action using the Report Designer
1. In Design view, right-click the report item to which you want to add a link and then click __Properties__.
1. In The Properties dialog box for that report item, click __Action__. The [Edit Action dialog]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/edit-action-dialog%}) will open.
1. Select __Custom__. An additional section appears in the dialog box, containing a button titled __Select parameters__.
1. Clicking the button will open the __Edit Custom Action Parameters__ dialog box. Add one or more parameters, defining their *Name* and *Value* properties.
1. Click __OK__ when ready.
1. To test the action, preview the report and click the report item with the applied custom action. A message will appear, displaying information for the action's properties.
## Adding a custom action programatically
{{source=CodeSnippets\CS\API\Telerik\Reporting\ActionSnippets.cs region=AddNewCustomActionSnippet}}
````C#
Telerik.Reporting.CustomAction customAction = new Telerik.Reporting.CustomAction();
customAction.Parameters.Add("param1", "=Fields.Name");
customAction.Parameters.Add("param2", "=Now()");
textBox1.Action = customAction;
````
{{source=CodeSnippets\VB\API\Telerik\Reporting\ActionSnippets.vb region=AddNewCustomActionSnippet}}
````VB
Dim customAction As New Telerik.Reporting.CustomAction()
customAction.Parameters.Add("param1", "=Fields.Name")
customAction.Parameters.Add("param2", "=Now()")
textBox1.Action = customAction
````
# See Also
* [Custom Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/custom-action%})
* [Overview]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/overview%})
* [Expressions]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/overview%})
* [Data Items]({%slug telerikreporting/designing-reports/connecting-to-data/data-items/overview%})

Просмотреть файл

@ -1,100 +0,0 @@
---
title: How to Add a Drilldown/Toggle Visibility Action
page_title: How to Add a Drilldown/Toggle Visibility Action
description: How to Add a Drilldown/Toggle Visibility Action
slug: telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-drilldown-toggle-visibility-action
tags: how,to,add,a,drilldown/toggle,visibility,action
published: True
position: 3
---
# How to Add a Drilldown/Toggle Visibility Action
A report item can initially display or be hidden when a user views a report. The toggle action applied on the report item that allows you to hide and display items interactively is known as drilldown action.
## Adding a drilldown action to a report item using the Report Designer
1. In Design view, right-click a report item to which you want to add a toggle visibility action and then click __Properties__.
1. In the item's __Properties__ dialog box, click __Action__.
1. Select __Toggle Visibility__. Additional sections appear in the dialog box for this option.
1. Click __Edit toggle targets__ button, which opens __Edit toggle Visibility targets__ dialog.
1. Click __New__ button to add a new toggle action. Select a report item from the combobox to set it as toggle target,
which visibility will be toggled when the action is triggered.
1. To add more toggle targets, repeat steps 4 and 5.
1. The __Toggle mark initially expanded__ checkbox determines if the item exposing the action will be rendered initially
with expanded or with collapsed mark.
1. To test the toggle, run the report and click the text box with the toggle mark. The report display refreshes to show
report items with their toggled visibility.
>note The report item must be in the same container hierarchy or higher (up to the report itself).
## Adding a drilldown action to a Table, CrossTab or ListBox group using the Report Designer
1. In Design view, click the Table, CrossTab or ListBox to select it. The [Group Explorer]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/group-explorer%}).
1. Locate the __Display Mode__ combo in the title bar of the Group Explorer and select Extended Mode. This
toggles to show the underlying display structure for rows and columns.
1. Right-click the name of the row group or column group for which you want to hide the associated rows or columns and
select __Group Properties__.
1. Alter the __Visible__ property to indicate whether the group is displayed initially
expanded or collapsed (default is expanded). Click __OK__.
1. In Design view, right-click the report item representing the row group or column group to which you want to add a toggle
visibility action and then click __Properties__.
1. In the item's __Properties__ dialog box, click __Action__.
1. Select __Toggle Visibility__. Additional sections appear in the dialog box for this option.
1. Click __Edit toggle targets__ button, which opens __Edit toggle Visibility targets__ dialog.
1. Click __New__ button to add a new toggle action. Select a row group or column group from the combobox to set it as toggle target,
which visibility will be toggled when the action is triggered.
1. To add more toggle targets, repeat steps 8 and 9.
1. The __Toggle mark initially expanded__ checkbox determines if the item exposing the action will be rendered initially
with expanded or with collapsed mark.
1. To test the toggle, run the report and click the text box with the toggle mark. The report display refreshes to show
report items with their toggled visibility.
>note The report item must either be in the same group as the item that is being hidden or in an ancestor group.
## Adding a drilldown action programatically
{{source=CodeSnippets\CS\API\Telerik\Reporting\ActionSnippets.cs region=AddNewToggleVisibilitySnippet}}
````C#
Telerik.Reporting.ToggleVisibilityAction toggleVisibilityAction1 = new Telerik.Reporting.ToggleVisibilityAction();
textBox1.Action = toggleVisibilityAction1;
toggleVisibilityAction1.DisplayExpandedMark = false;
toggleVisibilityAction1.Targets.AddRange(new Telerik.Reporting.IToggleVisibilityTarget[] { textBox2 });
````
{{source=CodeSnippets\VB\API\Telerik\Reporting\ActionSnippets.vb region=AddNewToggleVisibilitySnippet}}
````VB
Dim toggleVisibilityAction1 As New Telerik.Reporting.ToggleVisibilityAction()
textBox1.Action = toggleVisibilityAction1
toggleVisibilityAction1.DisplayExpandedMark = False
toggleVisibilityAction1.Targets.AddRange(New Telerik.Reporting.IToggleVisibilityTarget() {textBox2})
````
# See Also
* [ToggleVisibilityAction](/reporting/api/Telerik.Reporting.ToggleVisibilityAction)
* [Drilldown Report Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/drilldown-report-action%})
* [Drillthrough Report Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/drillthrough-report-action%})
* [How to: Add a Drillthrough Report Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-drillthrough-navigate-to-report-action%})

Просмотреть файл

@ -1,64 +0,0 @@
---
title: How to Add a Drillthrough/Navigate To Report Action
page_title: How to Add a Drillthrough/Navigate To Report Action
description: How to Add a Drillthrough/Navigate To Report Action
slug: telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-drillthrough-navigate-to-report-action
tags: how,to,add,a,drillthrough/navigate,to,report,action
published: True
position: 0
---
# How to Add a Drillthrough/Navigate To Report Action
A report can contain links to other reports. The report that opens when you click the link in the main report is known as a drillthrough report. Drillthrough reports must be published to the same report server as the main report, but they can be in different folders. You can add a drillthrough link to any item that has an Action property.
>tip We recommend the usage of TypeReportSource ('Type name' option) or UriReportSource ('Url or file' option) in the [Load Report Dialog](../../../report-designer-tools/desktop-designers/tools/load-report-dialog) on configuring the target report. InstanceReportSource ('Object instance' option) is only supported for WinForms and WPF Report Viewers in Embedded mode.
## Adding a drillthrough action using the Report Designer
1. In Design view, right-click a report item to which you want to add a link and then click __Properties__.
1. In the item's __Properties__ dialog box, click __Action__.
1. Select __Navigate to Report__. Additional section appears which allows you to select a __ReportSource__.
1. In the __Choose a Report Source__ dialog, select how you would navigate to the report, For this example we would use __Type Report Source__ , click that option and select the report that you would like to navigate to. If you have to specify parameters for the drillthrough report, follow the next step.
1. Click __Edit Parameters__ button - __Edit Parameters__ dialog appears. Click __New__. In the __Parameter Name__ column select the name of the report parameter in the drillthrough report. In the __Parameter Value__ , type or select the value to pass to the parameter in the drillthrough report.
1. To test the link, run the report and click the report item with the applied __Action__. For TextBoxes, it is helpful to change the color and effect of the text to indicate that the text is a link. For example, change the color to blue and the effect to underline by setting the corresponding __Font__ properties of the TextBox.
## Adding a drillthrough action programatically
{{source=CodeSnippets\CS\API\Telerik\Reporting\ActionSnippets.cs region=AddNewNavigateToReportSnippet}}
````C#
Telerik.Reporting.TypeReportSource reportSource = new Telerik.Reporting.TypeReportSource();
reportSource.TypeName = "ReportLibrary1.Report1, ReportLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
reportSource.Parameters.Add(new Telerik.Reporting.Parameter("OrderNumber", "SO43659"));
Telerik.Reporting.NavigateToReportAction reportAction1 = new Telerik.Reporting.NavigateToReportAction();
reportAction1.ReportSource = reportSource;
textBox1.Action = reportAction1;
````
{{source=CodeSnippets\VB\API\Telerik\Reporting\ActionSnippets.vb region=AddNewNavigateToReportSnippet}}
````VB
Dim reportSource As New Telerik.Reporting.TypeReportSource()
reportSource.TypeName = "ReportLibrary1.Report1, ReportLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
reportSource.Parameters.Add(New Telerik.Reporting.Parameter("OrderNumber", "SO43659"))
Dim reportAction1 As New Telerik.Reporting.NavigateToReportAction()
reportAction1.ReportSource = reportSource
textBox1.Action = reportAction1
````
# See Also
* [How to: Add a Bookmark Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-bookmark-action%})
* [How to: Add a Hyperlink Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-hyperlink-action%})
* [Expressions Overview]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/overview%})
* [Data Items Overview]({%slug telerikreporting/designing-reports/connecting-to-data/data-items/overview%})

Просмотреть файл

@ -1,54 +0,0 @@
---
title: How to Add a Hyperlink Action
page_title: How to Add a Hyperlink Action
description: How to Add a Hyperlink Action
slug: telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-hyperlink-action
tags: how,to,add,a,hyperlink,action
published: True
position: 2
---
# How to Add a Hyperlink Action
Add a hyperlink to a URL when you want users to be able to click a link in a report and open a browser to the URL you specify. You must ensure that the user has access to the URL that you provide i.e. it allows anonymous access or does not require credentials. You can add a hyperlink to a URL to any item that has an Action property.
## Adding a Hyperlink action using Report Designer
1. In Design view, right-click a report item to which you want to add a link and then click __Properties__.
1. In the Properties dialog box, click __Action__.
1. Select __Navigate to URL__. An additional section appears in the dialog box for this option.
1. In __Target URL__ TextBox, type a URL or an expression that evaluates to a URL.
1. Click __OK__.
1. To test the link, run the report and click the report item with the applied __Action__. For TextBoxes, it is
helpful to change the color and effect of the text to indicate that the text is a link. For example, change the color to blue and
the effect to underline by setting the corresponding __Font__ properties of the TextBox.
## Adding a Hyperlink action programatically
{{source=CodeSnippets\CS\API\Telerik\Reporting\ActionSnippets.cs region=AddNewNavigateToUrlSnippet}}
````C#
Telerik.Reporting.NavigateToUrlAction UrlAction1 = new Telerik.Reporting.NavigateToUrlAction();
UrlAction1.Url = "http://demos.telerik.com/reporting";
textBox1.Action = UrlAction1;
````
{{source=CodeSnippets\VB\API\Telerik\Reporting\ActionSnippets.vb region=AddNewNavigateToUrlSnippet}}
````VB
Dim UrlAction1 As New Telerik.Reporting.NavigateToUrlAction()
UrlAction1.Url = "http://demos.telerik.com/reporting"
textBox1.Action = UrlAction1
````
# See Also
* [How to: Add a Drillthrough Report Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-drillthrough-navigate-to-report-action%})
* [How to: Add a Bookmark Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-bookmark-action%})
* [Expressions Overview]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/overview%})
* [Data Items Overview]({%slug telerikreporting/designing-reports/connecting-to-data/data-items/overview%})

Просмотреть файл

@ -20,7 +20,36 @@ You can also specify whether the URL is opened in the same or new browser window
> Opening URL in the same window is only applicable for the [ASP.NET Web Forms Report Viewer]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/asp.net-web-forms-report-viewer/overview%}) and [Silverlight Application]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/silverlight-application/overview%}). For the others, the [NavigateToUrlAction](/reporting/api/Telerik.Reporting.NavigateToUrlAction) would be opened in a new window.
# How to Add a Hyperlink Action
Add a hyperlink to a URL when you want users to be able to click a link in a report and open a browser to the URL you specify. You must ensure that the user has access to the URL that you provide i.e. it allows anonymous access or does not require credentials. You can add a hyperlink to a URL to any item that has an Action property.
## Adding a Hyperlink action using Report Designer
1. In Design view, right-click a report item to which you want to add a link and then click __Properties__.
1. In the Properties dialog box, click __Action__.
1. Select __Navigate to URL__. An additional section appears in the dialog box for this option.
1. In __Target URL__ TextBox, type a URL or an expression that evaluates to a URL.
1. Click __OK__.
1. To test the link, run the report and click the report item with the applied __Action__. For TextBoxes, it is helpful to change the color and effect of the text to indicate that the text is a link. For example, change the color to blue and the effect to underline by setting the corresponding __Font__ properties of the TextBox.
## Adding a Hyperlink action programatically
{{source=CodeSnippets\CS\API\Telerik\Reporting\ActionSnippets.cs region=AddNewNavigateToUrlSnippet}}
{{source=CodeSnippets\VB\API\Telerik\Reporting\ActionSnippets.vb region=AddNewNavigateToUrlSnippet}}
# See Also
* [How to: Add a Hyperlink Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/how-to/how-to-add-a-hyperlink-action%})
* [Drillthrough Report Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/drillthrough-report-action%})
* [Bookmark Action]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/actions/bookmark-action%})
* [Expressions Overview]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/overview%})
* [Data Items Overview]({%slug telerikreporting/designing-reports/connecting-to-data/data-items/overview%})