How to Use .NET Reports in a Manufacturing Application
In this blog, we will work through creating an ActiveReports.NET report for manufacturing. With ActiveReports controls, it is easy to create simple and straightforward reports and complex and attractive reports that organize data the way you need it to be organized. When it comes to manufacturing, it can be almost effortless to make reports for employee records, incoming/outgoing supplies, process management, and more. ActiveReports can be used in a variety of ways, whether that be through code or through the designers that we offer (Desktop, Web, Visual Studio).
Today, we will be working with the ActiveReports 15 Desktop Designer, or the Standalone Report Designer, that is included in the installation of the product. To find more details about the Standalone Report Designer, take a look at our Designer Documentation.
To get started with the main features of the Standalone Report Designer, let's work through creating a basic sample report for employee performance. To start, install ActiveReports 15, and let's download our AR15 Sample Data Sources and Data Sets from our AR15 Samples Github Page.
OK! Let's start by opening the ActiveReports 15 Designer application from the desktop. We can create a new RDL (Report Definition Language) Report by clicking the "New" icon in the top-left of the app (or by pressing Ctrl+N) and then choosing RDL from the popup modal.
ActiveReports has multiple types of reports (RDL Report, Page Report, XML-Based Section Report, Code-Based Section Report), and all of them have unique use-cases and features. RDL Reports will grow and shrink depending on the amount of data within the report, so our controls will run onto the next page if need be. You can find more information on each type of report from our Report Types Page.
From here, let's add a Data Source by going to the Report Explorer section on the left-hand side, right-clicking the "Data Sources" option, and choosing "Add Data Source." We should get another popup modal to input the information about our Data Source.
Now, we want to name it "Schedule" and select "Microsoft OleDb Provider" for the type. Under the "Connection" section, let's choose "Microsoft.Jet.OLEDB.4.0" for the OLE DB Provider. In the "Enter a server or file name" box, we will click the ellipsis to choose our "Schedule.mdb" file from the SamplesAR15 folder we downloaded earlier (SamplesAR15>Data>Schedule.mdb). We can finish up by clicking "OK" at the bottom.
Once that's done, let's create a Data Set from that Data Source by right-clicking "Schedule" and choosing "Add Data Set." Here we will name it "Employees", go to the "Query" tab and click the pencil icon to use the Visual Query Designer. Here we can double-click the "ScheduleOfTime" table, automatically adding a query for that entire table. Click "Save" in the top-right corner, and close the Data Set modal by clicking "Exit". Now that we did that, our data is connected and ready to be used by our report!
Finally, we can add a table control to the report. To do this, let's drag the table icon from the Toolbox section on the left-hand side of the designer onto the surface of the report. Our table will contain three rows by default: the header, detail, and footer. Although there are only three rows, the detail row will expand to show all of our data when previewing the report. To see this, let's expand our "Employees" Data Set and drag the "EmployeeID" field into the first cell of the detail row of the table. That will add all of our Employee IDs (which is just one employee with multiple shifts) and a header to organize our data by. Let's do the same with the "StartTime" and "Comment" fields to complete our detail row and fully populate our table.
To customize the table, let's make each column bigger by dragging the edge of each column header with our mouse. To bolden and underline our header row, let's click the table and select the header icon on the left of the control to select the entire header row. From there, we can choose from the options toolbar on the top of the page to customize the text to our liking. We can center each column by Ctrl+clicking each column header and choosing the center alignment from the same options toolbar. Finally, let's drag our table to the center of the report and view the results by clicking the "Preview" icon on the top-left corner of the designer. See this all in action here.
Well done – we have just created a simple yet meaningful report that displays each employee ID when that employee started working and comments that the employee made a note of during his working hours. Users can also add other controls and concepts to the report. If you'd like to further your knowledge on ActiveReports.NET, feel free to look at the sample that we downloaded earlier to see some more advanced use-cases.