ActiveReports 9 new Features: Add catalog functionality to reports with Table of contents (TOC) controls

Source: Internet
Author: User

Original: ActiveReports 9 new features: Add catalog functionality to reports with Table of contents (TOC) controls

Added new features to the newly released ActiveReports 9 report control to help you create a beautiful, powerful reporting system in less time, this article focuses on the new Document catalog control (TOC), which you can add by dragging and dropping the report catalog.

The catalog control helps users navigate quickly to the data they want to see in the report. You can use the table of contents control to embed the content list of a report body for printing and exporting. Unlike a document map, you can only view it in the report browser and not export or print.

This example is broken down into the following steps

    • Add ActiveReports in Visual Studio projects
    • Connect a report to a data source
    • Add Data Set
    • Create a report layout
    • Configure the directory appearance
    • Previewing a report

When this example is complete, you get a design layout and a run-time layout similar to the following.

(i) Add ActiveReport to Visual Studio projects

1. Create a new visual Studio Windows Forms Application project.

2. From the Project menu, select Add New Item .

3. In the Add New Item dialog box that pops up, select the activereport 9 RDL report and enter REPORTSWITHTOC.RDLXin the name.

4. Click the Add button to open a new RDL report in the design interface.

(ii) Report connection data source

This example uses the Movies data table in the reels database. By default, the Reels.mdb file is located under the \componentone samples\activereports 9\data folder of My Documents .

1. In Report Explorer, right-click the data source node and choose the Add Data source option or select a data source under the Add button.

2. In the Report Data Source dialog box that pops up, select General page, and enter ReportData in the name.

3. Create a connection to the Reels database on this page.

(iii) Adding datasets

1. In Report Explorer , right-click the Data source node and select the Add DataSet option or select the dataset under the Add button .

2. In the pop-up DataSet dialog box, select the General page and enter the dataset name Moviecatalog. This name appears as a child node of the data source in Report Explorer.

3. In the query page of the DataSet dialog box, enter the following SQL in the query box.

SELECT Genre.genrename, Movie.title, movie.yearreleased, movie.userrating, movie.country from Genre INNER JOIN (Movie INN ER JOIN moviegenres on movie.movieid = Moviegenres.movieid) on genre.genreid = Moviegenres.genreid ORDER by YearReleased A Sc

4. Click the Validate DataSet icon in the upper right corner of the query text box to verify.

5. Click OK to close the dialog box. The new dataset and the queried fields appear as nodes under Report Explorer.

(iv) Create a report layout

1. From the Toolbox, drag the list control to the design interface and set the following properties in the Properties window .

Property name

Property value

DatasetName

Moviecatalog

Location

0.25in, 1.875in

Size

6in, 4in

PageBreakAtStart

True

2. Select the list control, in the Properties window, click the Properties dialog box link to open the List dialog box.

3. Set the expression below the grouping page in the detail area to=Fields!GenreName.Value。

4. Click OK to close the dialog box.

5. In the Moviecatalog dataset in Report Explorer , drag the Genrename field onto the list data region control and set the following properties in the Properties window.

Property name

Property value

Location

0.25in, 0.375in

Font

Normal, Arial, 12pt, Bold

TextAlign

Center

Size

5.625in, 0.25in

Label

=fields! Genrename.value

Note : The Label property of the set control is used to add entries for the control in the Document Map.

6. From the Toolbox, drag the table (table) data region control into the list data region control and then set the properties below in the Properties window .

7. In the table data area, place the mouse over the table detail data row to display the field selection adorner.

8. Click on the adorner to display the list of fields available in the Moviecatalog dataset and add the following fields to the table detail data row.

9. This action places the expression in the detail data row and places the static label on the header row of the same column.

10. Use the row border on the left to select the detail data row, and then set the following properties in the Properties window.

11. Right click on the left border of the table detail data row and select Insert Group ....

12. In the pop-up Table-Group dialog box, under General tab Group, set the expression to =fields! Yearreleased.value.

13. Click OK to close the dialog box.

14. Use the CTRL key and the right mouse button to select all the text box controls in the table grouping row, then right-click the selection area and select merge cells.

15. Select the merged cells and set the following properties in the Properties window.

Property name

Property value

Font

Normal, Arial, 10pt, Bold

Headinglevel

Heading 2

Note : The headinglevel property of the set control is used to add the corresponding entry for the control in the Document Map.

TextAlign

Center

Value

= ' Movies released in ' & Fields! Yearreleased.value

16. From the Visual Studio Toolbox, drag a catalog (tableofcontents) control to the design interface and set the following properties in the Properties window

Property name

Property value

Location

0.25in, 0.5in

Size

6in, 0.875in

BorderStyle

Solid

(v) Configure the appearance of the directory

1. Select the directory (tableofcontents) control, select the levels(collection) property, and click the ellipsis button that appears.

2. In the pop-up Leveldesigner collection Editor, under members , use the Add button to add Level2 to the directory.

3. Under members , select Level1 and click the property Page button above the Leveldesigner Collection Editor Properties grid.

4. Select the Level2 entity under members in the Leveldesigner Collection Editor and Leveldesigner the property page button above the Collection Editor property grid.

5. In the pop-up Level dialog box, set the font > Weight property to Bold.

6. Click OK to close the dialog box.

7. Select the Level2under members in the Leveldesigner Collection Editor and set the Padding property in the property grid to 20pt, 10pt, 0pt, 0pt and set Displaypagenumber property is False .

8. Click OK to close the leveldesigner Collection Editor dialog box.

9. In Report Explorer, select the Report node and set the following properties in the Properties window:

Property name

Property value

Documentmap > Source

Labels and headings

Documentmap > Numberingstyle

1, 2, 3, 4, 5

After completing the template design, we get the following results:

Six previewing a report

Click the Preview tab at design time to view the report to get the following results

Note: the report template can be installed on the ActiveReports 9 PC's C:\Users\ user name \documents\componentone samples\activereports 9\reports Found in the Gallery\c#\reports\rdl REPORT\REELS\MOVIECATALOG.RDLX path.

For more features of the document catalog control, you can download ActiveReports 9 now for an experience.

For more ActiveReports 9 new feature articles, please click ActiveReports V9 to view them.

ActiveReports 9 new Features: Add catalog functionality to reports with Table of contents (TOC) controls

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.