ActiveReports 18 .NET Edition
Report Authors: Designer Components / Design Reports / Design Page/RDLX Reports / Tutorials: Report Controls in Page/RDLX Reports / Image Control in Reports
In This Topic
    Image Control in Reports
    In This Topic

    Let's say that we want to create a report that shows the photos of employees along with their details including name, job title, date of birth, mobile, email, and department. For such a report, we will use the BandedList control with Image control in the details band along with other TextBox controls. The report connects to 'DimEmployees' JSON data available here.

    The final report will look like as shown.

    Image Control in Reports

    Create a Report

    In the ActiveReports Designer, create a new Page report.

    If you are creating a new report in the Visual Studio Integrated Designer, see Quick Start.

    Bind Report to Data

    As you create a new report, you can configure the report data connection in the Report Wizard. You can also access the Report Data Source  dialog by right-clicking the Data Sources node in the Report Explorer and then selecting the Add Data Source option. See JSON for details.

    1. On the Choose Data Source Type screen of the wizard, select JSON and click Next.
    2. To specify JSON File Path, click the Browse button and navigate to the desired file on your system. This report uses the 'DimEmployees.json' sample data source that can be downloaded from the following URL:
          https://demodata.mescius.io/contoso/odata/v1/DimEmployees
    3. Click the Next option and configure the dataset by adding a valid query. Enter EmployeesDataset into the Name field and select the node from the data tree in the Path section to generate the path. The resulting query is displayed in the Query field.
    4. Click Next to proceed to the final screen of the Report Wizard.
    5. Review the summary of the report and click Finish to successfully add the report with the JSON data source.   

    Design Report Layout

    1. Drag and drop the BandedList control onto the report's designer.
    2. Drag few TextBox controls to the Details band of the BandedList control, and set their Value property as follows:
      • TextBox1: Name
      • TextBox2: =Fields!FirstName.Value & " " & Fields!LastName.Value
      • TextBox3: Title
      • TextBox4: =Fields!Title.Value
      • TextBox5: Date of Birth
      • TextBox6: =Format(Fields!BirthDate.Value, "dd-MM-yyyy")
      • TextBox7: Mobile
      • TextBox8: =Fields!Mobile.Value
      • TextBox9: Email
      • TextBox10: =Fields!EmailAddress.Value
      • TextBox11: Department
      • TextBox12: =Fields!DepartmentName.Value
    3. Drag and drop the Image control and set its properties as follows:
    4. To provide a heading (label) to the data displayed in the text boxes in Details band, drag and drop a TextBox control onto the Header band of the BandedList control and set its Value property to 'Employee Details'.
    5. To add the report title, drag and drop the TextBox control to the PageHeader section and set its Value property to 'Employee List'.
      Image control in reports
    6. Improve the appearance of the report and preview.
    See Also