Tabs in WebReport

2013-10-21

We can use tabs to view multiple reports in WebReport  in version FastReport.NET 2013.4 and newer.

WebReport with Tabs

Tabs can be useful for viewing many reports with additional information. Each report in tab has own navigation and may be attached to any data source. Saving in different formats is performed for each tab.

We have plans to implement FastReport.NET for open the detailed report in a separate tab by clicking on the object page. Also we will add the ability to close unnecessary tabs.

Tabs can be added directly in the application code, for example:

WebReport webReport = new WebReport();
webReport.Report.RegisterData(dataSet, "NorthWind");
webReport.Report.Load(report_path + "Simple List.frx");
webReport.CurrentTab.Name = "Simple List";
// tab 2
Report report2 = new Report();
report2.RegisterData(dataSet, "NorthWind");
report2.Load(report_path + "Labels.frx");
webReport.AddTab(report2, "Labels");
// tab 3
Report report3 = new Report();
report3.RegisterData(dataSet, "NorthWind");
report3.Load(report_path + "Master-Detail.frx");
webReport.AddTab(report3, "Master-Detail");
 

A property “webReport.CurrentTab” needs for access to the current tab, for example: “webReport.CurrentTab.Report”. By default, the first tab is available. In each of the tabs we have next available properties: “Report” – report object, “Name” – tab name. The name of the tab will be taken from the properties of report or report file name if the “Name” property is not specified.

The collection of tabs "webReport.Tabs" is also available. These can be used to refer to the tab by its index, for example: webReport.Tabs [0]. Name.

WebReport.AddTab method adds a new tab. We can use any declaration from next:

// an adding of report object
public ReportTab AddTab(Report report);
// an adding of report object with its name
public ReportTab AddTab(Report report, string name);
// an adding of prepared report object with its name (reportDone = true)
public ReportTab AddTab(Report report, string name, bool reportDone);
 

Last call declaration can add any prepared report.

An example of adding some prepared reports:

webReport.Tabs.Clear();
string s = this.Server.MapPath("~/App_Data/Prepared.fpx");
// first
Report firstReport = new Report();
firstReport.LoadPrepared(s);
webReport.AddTab(firstReport, "First tab", true);
// second
Report secondReport = new Report();
secondReport.LoadPrepared(s);
webReport.AddTab(secondReport, "Second tab", true);
 

In the near future we will add the display settings for tabs and an implementation of interactive reports.

LIVE DEMO

Thank you for attention!

September 19, 2024

How to troubleshoot the most common issues when installing FastReport VCL

We have compiled a list of the most popular problems when installing FastReport VCL and have prepared detailed instructions on how to fix the problems that have arisen.
August 12, 2024

How to build and install the Postgres plugin in FastReport .NET

This article describes how to connect to the database using the FastReport .NET plugin for the report designer from Visual Studio via the NuGet server.
August 08, 2024

How to install FastReport .NET and its components on Windows

Step-by-step instructions for online and manual installation via the FastReport registration code.NET and its components in Windows.
Fast Reports
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314

© 1998-2024 Fast Reports Inc.