• Metric Reports for Web
  • Dashboard for Web

    Show / Hide Table of Contents
    • Report Designer
      • First Look at the Report Designer
      • Add New Reports
      • Open Reports
      • Save Reports
      • Introduction to Banded Reports
      • Bind to Data
        • Bind a Report to a Database
        • Specify Query Parameters
        • Bind a Report to JSON Data
        • Bind a Report to an Object Data Source
        • Data Binding Modes
        • Bind Report Controls to Data (Expression Bindings)
        • Bind Report Controls to Data (Data Bindings)
        • Use Embedded Fields (Mail Merge)
        • Validate Report Data Bindings
      • Create Popular Reports
        • Create a Letter
        • Create a Table Report
        • Create an Invoice Manually
        • Create a Master-Detail Report (Use Detail Report Bands)
        • Create a Master-Detail Report (Use Subreports)
        • Create a Report with PDF Content
        • Create a Hierarchical Report
        • Create a Vertical Report
        • Create Labels and Badges
        • Create a Multi-Column Report
        • Create a Report with Cross-Band Content and Populated Empty Space
        • Create an Interactive E-Form
        • Create a Cross-Tab Report
      • Configure Design Settings
        • Change a Report's Measurement Units
        • Change a Report's Page Settings
        • Enable the Right-To-Left Layout
      • Use Report Elements
        • Manipulate Report Elements
          • Add Controls to a Report
          • Select Report Elements and Access Their Settings
          • Move and Resize Report Elements
          • Apply Styles to Report Elements
          • Copy Report Controls
          • Arrange Report Controls
          • Add Report Controls to Containers
          • Validate the Report Layout
        • Use Basic Report Controls
          • Label
          • Character Comb
          • Rich Text
          • Check Box
          • Picture Box
          • Subreport
          • Panel
          • Page Break
          • Table of Contents
          • Page Info
        • Use Tables
          • Table Overview
          • Bind Table Cells to Data
          • Manage Table Structure
          • Manipulate Table Elements
          • Hide Table Cells
        • Use Bar Codes
          • Add Bar Codes to a Report
          • Bar Code Recognition Specifics
          • Codabar
          • Code 11 (USD-8)
          • Code 128
          • Code 39 (USD-3)
          • Code 39 Extended
          • Code 93
          • Code 93 Extended
          • EAN 13
          • EAN 8
          • ECC200 - Data Matrix
          • GS1 - DataBar
          • GS1- Data Matrix
          • GS1-128 - EAN-128 (UCC)
          • Industrial 2 of 5
          • Intelligent Mail
          • Intelligent Mail Package
          • Interleaved 2 of 5
          • Matrix 2 of 5
          • MSI - Plessey
          • PDF417
          • PostNet
          • QR Code
          • UPC Shipping Container Symbol (ITF-14)
          • UPC Supplemental 2
          • UPC Supplemental 5
          • UPC-A
          • UPC-E0
          • UPC-E1
        • Use Charts and Pivot Grids
          • Use Charts in Reports
          • Add a Chart (Set Up Series Manually)
          • Add a Chart (Use a Series Template)
          • Use Charts to Visualize Grouped Data
          • Link a Chart and a Pivot Grid
        • Use Gauges and Sparklines
          • Add Gauges to a Report
          • Add Sparklines to a Report
        • Draw Lines and Shapes
          • Draw Lines
          • Draw Shapes
          • Draw Cross-Band Lines and Boxes
      • Shape Report Data
        • Filter Data
          • Filter Data at the Report Level
          • Filter Data at the Data Source Level
          • Limit the Number of Records to Display
        • Group and Sort Data
          • Sort Data
          • Group Data
          • Sort Data by a Custom Field
          • Group Data by a Custom Field
          • Sort Groups by a Summary Function's Result
        • Shape Data (Expression Bindings)
          • Format Data
          • Conditionally Change a Control's Appearance
          • Conditionally Change a Label's Text
          • Conditionally Change a Band's Visibility
          • Conditionally Filter Report Data
          • Conditionally Suppress Controls
          • Limit the Number of Records per Page
          • Calculate a Summary
          • Calculate an Advanced Summary
          • Display Row Numbers in a Report, Group or Page
          • Count the Number of Records in a Report or Group
          • Count the Number of Groups in a Report
        • Shape Data (Data Bindings)
          • Format Data
          • Conditionally Change a Control's Appearance
          • Conditionally Change a Label's Text
          • Conditionally Change a Band's Visibility
          • Conditionally Filter Report Data
          • Conditionally Suppress Controls
          • Limit the Number of Records per Page
          • Calculate a Summary
          • Calculate a Custom Summary
          • Display Row Numbers in a Report, Group or Page
          • Count the Number of Records in a Report or Group
          • Count the Number of Groups in a Report
        • Use Calculated Fields
          • Calculated Fields Overview
          • Calculate an Aggregate Function
          • Calculate a Weighted Average Function
        • Use Report Parameters
          • Create a Report Parameter
          • Report Parameters with Predefined Static Values
          • Report Parameters with Predefined Dynamic Values
          • Multi-Value Report Parameters
          • Cascading Report Parameters
          • Date Range Report Parameters
      • Lay out Dynamic Report Content
        • Maintain the Band Location on a Page
        • Keep Content Together
        • Maintain the Size and Content of Data-Bound Controls
        • Anchor Controls
        • Suppress Controls
      • Customize Appearance
        • Appearance Properties
        • Report Visual Styles
      • Add Navigation
        • Add Page Numbers
        • Add Cross-References and Hyperlinks
        • Add Bookmarks and a Document Map
        • Create a Table of Contents
      • Provide Interactivity
        • Create Drill-Down Reports
        • Sort a Report in Print Preview
        • Edit Content in Print Preview
      • Add Extra Information
        • Add Watermarks to a Report
        • Display the Current Date and Time in a Report
        • Display the User Name in a Report
      • Merge Reports
        • Add a Report to the End/Beginning
        • Use Data-Driven Page Sequence
      • Use Expressions
        • Expression Syntax
      • Localize Reports
      • Preview, Print and Export Reports
      • Report Designer Tools
        • Report Wizard
          • Empty Report
          • Table and Vertical Report
            • Select Data Source
            • Specify Data Source Settings (Database)
            • Specify Data Source Settings (JSON)
            • Specify Data Source Settings (Object)
            • Define Report Layout
            • Specify Page Settings
          • Label Report
        • Data Source Wizard
          • Specify Data Source Settings (Database)
          • Specify Data Source Settings (JSON)
          • Specify Data Source Settings (Object)
        • Design Surface
        • Main Menu
        • Main Toolbar
        • Toolbox
        • Query Builder
        • Chart Designer
        • Expression Editor
        • Filter Editor
        • Format String Editor
        • Master-Detail Relation Editor
        • Script Editor
        • Localization Editor
        • UI Panels
          • Properties Panel
          • Expressions Panel
          • Field List
          • Report Explorer
    • Metric Report Manager
      • First look at the report manager
      • End user management
      • Open a report using the Report Manager
      • Add new report to the Report Manager

    Create an Invoice Manually

    This tutorial describes how to create a simple invoice report displaying information about customers and their orders. You can perform similar steps to create various invoice layouts depending on your requirements.

    Create a Report and Bind It to Data

    1. Create a new report or open an existing one.

    2. Invoke the designer menu and click Add Data Source....

    3. Select Database on the first page of the invoked Data Source Wizard and click Next.

    4. Select a data connection on the next page.

    5. On the same page, you can choose which tables, views and/or stored procedures to add to the report.

      Obtain data from two different tables to display information about customers and orders at the same hierarchical level in the report. Click the plus button for the Queries category to create a custom query. In the invoked Query Builder, add the required data tables to a query and join them based on a key column.

    6. On the same wizard page, select the data view providing order details for listing products included in each order in the invoice.

    7. On the same page, specify a master-detail relationship between the queries. Select the required key fields (columns) to connect tables.

    8. Click Finish to complete the wizard.

    After these steps, make sure that an appropriate data member is assigned to the report.

    Prepare the Master Report Layout

    Create the master report layout to display basic information about customers and their orders.

    1. Switch to the Field List and drop the required data fields onto the Detail band. New controls of appropriate types are automatically created and bound to the corresponding fields.

    2. Drop Label controls from the Toolbox onto the band to display static captions for specific data fields.

    3. Double-click the added labels one after another and enter the required text.

    4. Use the Line control to separate data.

    Prepare the Detail Report Layout

    Perform the following steps to create a detail report and construct its layout to show the order details in a tabular form:

    1. Expand the Actions category and click Insert Detail Report Band to create a Detail Report Band.

    2. Select the Detail Report band and select the master-detail relationship's name in the Data Member property's drop-down list.

    3. Add dynamic content to the detail report. Go to the Field List, select the data fields while holding down CTRL or SHIFT and drag-and-drop them onto the Detail band. This automatically creates a Table control with table cells bound to the corresponding fields.

      You should drag-and-drop fields from the category corresponding to the master-detail relationship to correctly generate the detail report's data.

    4. Add the Group Header band to the detail report to display captions for table columns. Select the Detail Report band and click Insert Group Header Band in the Actions category.

    5. To create column headers, drop the Table control from the Toolbox onto the Group Header band and enter the required text in the table's cells.

    6. Select the Detail Report band, expand the Behavior category and set the band's Page Break property to After the Band to print each order on a separate page.

    Create a Calculated Field

    This section demonstrates how to create a custom field whose values are calculated using a pre-defined expression.

    Do the following to evaluate an extended price based on the price, quantity and discount values obtained from a database:

    1. In the Field List, select the detail table and click Add calculated field.

    2. Click the Edit button for the calculated field and change its name to ExtendedPrice. Click the Expression property's ellipsis button, and in the invoked Expression Editor, construct the expression based on the UnitPrice, Quantity and Discount fields.

    3. You can use the created calculated field as an ordinary data field. Add a cell to a table in the Detail band and drop the calculated field onto this cell. Additionally, create one more table cell in the Group Header for displaying the corresponding caption.

    Format Data

    The next step is to specify report elements' value formatting to improve displaying their incoming data.

    1. In the master report's Detail band, select controls bound to date fields while holding down CTRL. Switch to the Properties panel, expand the Data category and click the Text Format String property's ellipsis button. In the invoked Format String Editor, activate the DateTime category and select the format, for example, display dates as a month (name) followed by the day (number) and year (four digits).

    2. Select the table cell bound to the Discount data field in the detail report's Detail band. Expand the Actions category, click the Text Format String property's ellipsis button, and in the invoked Format String Editor, apply the Percent format. In this case, field values are multiplied by 100 and displayed with a percent symbol.

    3. In the detail report's Detail band, select the cells bound to the UnitPrice and ExtendedPrice fields. Invoke the Format String Editor once again and choose the format preset from the Currency category (for instance, c2).

    Calculate a Summary

    Do the following to calculate a total price for each order as a sum of Extended Price values:

    1. Add the Group Footer band to the detail report in the same way as the Group Header.

    2. Drop the Label control onto the added band and expand the Actions category in the Properties panel. Select the Summary section and set the Running property to Report to calculate the summary for the entire detail report and click the Expression property's ellipsis button. In the invoked Expression Editor, specify the following expression to calculate the total price:

    3. Use the Text Format String property to format the summary's value (for instance, set it to Total: {0:c2}).

    Sort Data

    Perform the following steps to sort data in the detail report:

    1. Select the Detail band in the detail report. Select the Sort Fields section in the Actions category and add a new sort field to sort the detail report's data by the required data field.

    2. Click the or buttons to define the sort order within the group (ascending or descending). Use the button to disable sorting in grouped data.

    Customize the Report Appearance

    Do the following to customize the report and its elements' appearance:

    1. Click the gray area around the design surface to select the report, and in the Properties panel, specify the font settings. These settings are distributed to all report elements.

    2. You can adjust a control's font independently from its parent (for instance, make summary values bold).

    3. Change specific controls' (bound to date fields, price fields, etc.) text alignment using the Text Alignment property.

    4. Create a global visual style to apply it afterwards to multiple controls. Switch to the Report Explorer panel, select the Styles node and click the plus button to add a new report visual style.

    5. Select the created style and click the Properties button in the Report Explorer. This opens the Properties panel where you can adjust the settings of the selected style.

    6. Select report elements, expand the Styles category and choose a style in the Style property's drop-down list to apply the style to the selected elements.

    7. You can provide different appearances to alternating (odd and even) table rows in the detail report. Select the table and expand the Styles property in the Property Grid. Invoke the drop-down list for the EvenStyle property and select New.

      Specify the created style's appearance settings (for example, background color).

    Add Additional Information

    Do the following to provide additional information to your invoices, such as the report name and current date:

    1. Add the Page Header band to the master report to display the required information on each invoice page.

    2. Drop the Label control from the Toolbox onto the Page Header, double-click the control and type "Invoice". Specify the required appearance settings (font, foreground color, etc.).

    3. Add the Page Info control to the Page Header band to display system date in the report.

    4. Expand the Actions category and set the Page Information property to Current Date and Time. Click the Text Format String property's ellipsis button, and in the invoked Format String Editor, select a date format as in the Format Data section above.

    View the Result

    The invoice report is now ready. Switch to Print Preview to see the result.

    Back to top Copyright © 2020 Metric d.o.o. www.mymetric.net, metric@zg.t-com.hr