Activereports report control getting started in Chinese (3)-How to Select page reports and regional reports

Source: Internet
Author: User
Zookeeper

This article describes common use cases, differences, and suggestions for selecting report types for regional reports and page reports, template design and data sources for the two reports (both at design time and runtime) the difference between setting and Viewing Reports.


Activereports report controls (1)-installation, activation, and product resources

Activereports report controls (2)-create, data source, browse, and publish

This article includes the following parts:

1. Differences between area reports and page reports

  • Application scenarios of the two types of reports
  • Differences between area reports and page reports
  • How to select a report type in a project

2. region report and page report data source settings

  • Runtime
  • Design Time
3. Differences between report loading in the report Browser1. Differences between regional reports and page reports 1.1 first, let's take a look at the specific application scenarios of the two reports
  • Fixed page layout report: one of the first in activereports. net report model. The report page during running is exactly the same as that during design, and the positions and sizes of each control remain unchanged. Therefore, it is very suitable for creating traditional paper report formats, for example, it is used to design statements that require strict formats such as financial documents and bank bills.
  • Continuous page layout report: the report layout is controlled mainly through the data area to automatically display data by PAGE, and provides the most powerful report interaction capability, allowing you to easily implement various interactive reports. The control on the report page can be expanded or reduced; data filtering can be achieved through parameter reports; Interactive sorting can be set; you can set Drilling Reports, hide details in the initial state, and click the button to open; you can also add drilling links to other reports and bookmarks to other areas in the report.
  • Regional layout report: a typical report model of activereports. reports in a regional layout are divided into different regions. By default, the region layout report contains the header, details, and footer areas. You can insert the report header, report end, and group Header/group end areas. This layout method is also widely used in access and Crystal Reports. You can use C # and VB.. Net knowledge, combined with the rich APIs provided by the regional layout report model to implement a variety of report systems, such as subreports, Cross reports, grouped reports, column-based reports, and master-slave reports.
1.2 differences between regional reports and page reports

The main difference between a regional report and a page report is the composition structure. A regional report, as its name suggests, is composed of multiple regions, and a regional report is finally presented in a combination of multiple regions, including the header, detailed area, and table tail.

In the final presentation layout of a page report, only one unit is-page. The final presentation result of the page report is composed of multiple pages. Further, the final page number of the continuous page layout depends on the amount of data to be displayed. Fixed page reports emphasize that the preview effect is exactly the same as the print effect. It is very suitable for creating traditional paper report formats, such as for designing statements that require strict formats such as financial documents and bank tickets.

1.3 How to Select a report type in a project

In actual projects, how to select a report is often subject to a greater impact. Different developers' perspectives may affect the selection results. For example, some programmers tend to divide a report into three parts: Regular headers, data regions, and footers. In this way, they think that regional reports are more suitable for project requirements and select regional reports. There are other programmers who need to base all the Report pages on one report template. At this time, they will select continuous page reports. For another example, if you need to use multiple data sources, continuous page reports are also a good choice.

If interactive report analysis (drill-down and drill-through, and dynamic data sorting) is required in a report, page reports are also required for requirements such as mini charts, data entries, map controls, and multiple data sources.

Of course, activereports provides a wide range of resources such as product documentation, random installation examples, and online examples to provide you with a lot of guidance on choosing the report type, helping you select the correct report template, saving development time.

2. Set the region report and page report data source. The data source design steps for the 2.1 page report are as follows:
  • Step 1:Create a page report named pagereport_performance_designtime.rdlx in the project.

Step 2:After the report is created, the report design page is automatically displayed. In this case, you can see a fixed page report (FPL).Reports"->"Convert to a continuous page layout (CPL) report"Converts a report to a CPL report.

From the menu bar of Visual Studio,View"->"Other windows"->"Report Resource Manager V8"To open the activereports report resource manager, you can see"Data Source"Node, right-click the node and select"Add Data Source"Menu item, in the pop-up"Report Data SourceIn the dialog box, follow the wizard steps to connect to an Access database, for example:

Click"OKClick to create the data source. In the report resource manager window, clickData Source"Added a node named"Performance1", Right-click the node, and select"Add Dataset"Menu item, in the"Query"Tab, write the following SQL query statement [select * from product], and then click"OK"Button to create a dataset. Return to the report Resource Management window and click"Dataset1"Node, you can see all the data fields returned by the SQL query statement.

Step 3:In the Visual Studio toolbox,Activereports 8 page layout report"Drag the table control to the report design page, and click" table ".Line detailsIn the cells, all fields in the dataset in dataset1 are automatically displayed, and then the fields to be bound are specified for each cell.

For more information about how to set the time-based report data source, see:

Http://blog.gcpowertools.com.cn/post/2014/08/01/ActiveReports_DataSource_DesignTime.aspx

The key code for setting the data source during report running on the 2.1 page is as follows:
Private void data source page report toolstripmenuitem_click (Object sender, eventargs E)
    {
        GrapeCity.ActiveReports.PageReport pReport1 = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo("PageReport_DataSource_RunTime.rdlx"));
        viewer1.LoadDocument(pReport1.Document);            
    }
    private void Form1_Load(object sender, EventArgs e)
    {
        viewer1.LocateDataSource += new GrapeCity.ActiveReports.LocateDataSourceEventHandler(viewer1_LocateDataSource);
    }
    void viewer1_LocateDataSource(object sender, GrapeCity.ActiveReports.LocateDataSourceEventArgs args)
    {
        if (args.DataSourceName == "DataSource1")
        {
            if (args.DataSetName == "DataSet1")
            {
                args.Data = GetDataSource();
            }
        }
    }
    private DataTable GetDataSource()
    {
        DataTable dt = new DataTable();
DT. Columns. Add ("Product NO ");
DT. Columns. Add ("Product Name ");
DT. Columns. Add ("unit price ");
DT. Columns. Add ("inventory ");
DT. Rows. Add ("a10002", "apple", 20, 50 );
DT. Rows. Add ("a15681", "banana", 20, 50 );
DT. Rows. Add ("a15681", "pineapple", 20, 50 );
        return dt;
    }

For more information about how to set the report data source during running, see:

Http://blog.gcpowertools.com.cn/post/2014/08/01/ActiveReports_DataSource_RunTime.aspx

3. Differences between report loading in the report Browser

The page report and region report vary in browsing mode. This section uses webviewer as an example to view the differences between page report loading and regional report:

GrapeCity.ActiveReports.PageReport rpt = new GrapeCity.ActiveReports.PageReport();
rpt.Load(new System.IO.FileInfo(Server.MapPath("")+"\\invoice.rdlx"));
WebViewer1.Report = rpt;

Webviewer Load Code-based regional reports:

SecionReport rpt = new SecionReport();
WebViewer1.Report = rpt; 

Webviewer load XML-based regional reports:

SectionReport sr = new SectionReport();
sr.LoadLayout(Server.MapPath("") + "\\Invoice.RPX);
WebViewer1.Report = sr;

For more details on winforms, WPF, Silverlight and other platforms, please refer to the help documentation related chapter: http://www.gcpowertools.com.cn/docs/ActiveReports/AR8Guide! Documents/_28.htm

The above is all the content of the activereports report control getting started tutorial. The three articles must be understood only when using the activereports report control, we hope that you can have a general understanding of the use of the activereports report control by reading this series of articles to complete the practical development work smoothly.

If you have any questions when using the product, you can log on to the official product technical community and experienced technical engineers and activereports developers to exchange information:Click to communicate

Learn more about activereports:

Http://www.gcpowertools.com.cn/products/activereports_overview.htm

Download Product experience features:

Http://www.gcpowertools.com.cn/products/download.aspx? PID = 16

Activereports report control getting started in Chinese (3)-How to Select page reports and regional reports

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.