QR Code Barcodes in RDLC Reports
Generating Reports with QR Code 2D Barcodes in Visual Studio
- This tutorial shows how you can add QR Code barcodes to Visual Studio RDLC Reports.
- Watch the video or follow the steps below.
![](https://media.barcodewiz.com/images/e810252d-0412-48be-aad8-ff019767ef9b-QR-vs-reports-THUMB.png)
Before You Begin...
- Make sure you've got Microsoft RDLC Report Designer installed.
- (1) To install it, go to Extensions / Manage Extensions
- (2) Type RDLC in the search field
- (3) Click Download
- Proceed with installation.
![Installation of Microsoft RDLC Report Designer in Visual Studio](https://media.barcodewiz.com/images/2a841ea8-4ced-43fe-9866-275aa016b7ad-RDLC-001.png)
- Check if you have Microsoft.SqlServer.Types installed.
- Otherwise, go to Project / Manage NuGet Packages...
- On the NuGet window search for Microsoft.SqlServer.Types
- Click on Install and follow the installation wizard
![Installation of Microsoft SQL Server Types in Visual Studio](https://media.barcodewiz.com/images/99681afb-7ae6-4622-8894-e51c97cdc209-RDLC-002.png)
Step 1. Create a new Project
- In the main Visual Studio window, select Create a new Project
- Type Reports and select Reports Application (in our case C# project)
![Create a new Reports Application Project in Visual Studio](https://media.barcodewiz.com/images/dbb4b22d-a906-4077-bdc7-ec4048e2eae6-RDLC-003.png)
- Name your project
- Select the Framework that you plan to use
- Click on Create
![](https://media.barcodewiz.com/images/8063d3dd-8981-47cb-a2a3-7785b12f3577-QR-vs-reports-002.png)
Step 2. Bind a Data Source
- Select the Data Source Type that you would like to use in your reports (in our case it will be Access Database )
- click on Next
![](https://media.barcodewiz.com/images/8c79e8bf-7fb7-4297-8667-607722254b10-QR-vs-reports-003.png)
- Select Dataset for the database model and click Next
![](https://media.barcodewiz.com/images/7bbadd29-dc35-41c8-8c51-63d48433b364-QR-vs-reports-004.png)
- Click on New Connection...
![Choosing a database Connection type with RDLC Visual Studio Project](https://media.barcodewiz.com/images/f2a67d42-a4eb-478e-b9bc-d426e722820c-RDLC-006.png)
- On the Choose Data Source screen, select Microsoft Access Database File and click on Continue
![Selecting Microsoft Access Database File as a database Connection type with RDLC Visual Studio Project](https://media.barcodewiz.com/images/0c1817a5-098f-4b07-85db-534cc05f338c-RDLC-007.png)
- On the Add Connection screen click on Browse...
![Setting up a database connection to use with RDLC Report](https://media.barcodewiz.com/images/1129d6dc-79ff-43ce-97c9-bfdd7ba14e0c-RDLC-008.png)
- On the Select Microsoft Access Database File screen, browse to the folder Documents\BarCodeWiz Examples\BarCodeWiz QR Code Fonts\Access and select QrCode_Access_Example.mdb
- Click on Open
- On the Add Connection screen, click OK
![](https://media.barcodewiz.com/images/f7b5f088-6e6e-40be-86d6-691f302691ab-QR-vs-reports-031.png)
- Select Tables to use in the Report
- click on Finish
- Click on Next on the next screen (Dataset Properties)
![](https://media.barcodewiz.com/images/4dab8d0f-613d-4610-a9ef-74427aebf580-QR-vs-reports-005.png)
- Arrange fields for the report.
- In our case, we have placed all the fields in the Values section without summarizing.
- Click on Next on the next screen (Choose the layout).
- Click on Finish on the screen named Preview.
![](https://media.barcodewiz.com/images/f0aa1f77-1d9d-4e27-a70c-ae284b67b7b6-QR-vs-reports-006.png)
Step 3. Setting up the Source of the Report's Definition
- Double - click Form1.cs in Solution Explorer
![](https://media.barcodewiz.com/images/a3b1d37b-3217-43c1-89df-247883975aea-QR-vs-reports-007.png)
- Configure Data Sources:
- Bind your Report with Form1
- Click on the tiny triangle just below the Close button
- Select MyQRCodeReport.report1.rdlc
![](https://media.barcodewiz.com/images/4a4e3d22-0674-41f6-b716-11d14aeae230-QR-vs-reports-010.png)
- Click on Choose Data Sources
![](https://media.barcodewiz.com/images/88914c3d-5ca6-4ac0-99c8-18cb38ab0f4b-QR-vs-reports-011.png)
- Expand available sources and select the one you configured earlier.
- In our case - Items
![](https://media.barcodewiz.com/images/4f64f2e7-1ffd-429b-895b-9c097c00311f-QR-vs-reports-012.png)
Step 4. Changing the Project Platform to x64
- If you Start your Project now, you would receive an error saying there is no OLEDB driver for ACCESS files on the machine.
- To prevent that, we have to switch the debug to x64 processors.
![32-bit OLEDB provider is missing](https://media.barcodewiz.com/images/a9872d68-f55d-4035-be37-9f3ba5fd9b88-RDLC-009.png)
- Go to Configuration Manager...
![Altering configuration of the processor platform](https://media.barcodewiz.com/images/52697027-cc39-4631-a7f0-e1cd45df383e-RDLC-010.png)
- (1) In Configuration Manager window, select New from the list under Platform
- (2) In New Project Platform, select x64
- Click OK and Close
![](https://media.barcodewiz.com/images/c5d193bf-e887-4fcb-b0c3-b76117c7fe7e-QR-vs-reports-015.png)
Step 5. Configure Report Properties
- Right-click on the empty area of Report1.rdlc and select Report Properties
![](https://media.barcodewiz.com/images/ef1ec69b-642c-4194-a1ea-e984491ca809-QR-vs-reports-016.png)
- In the Report Properties window, select the References section.
- 1) Click Add to add the assembly
- 2) Type: BarCodeWizFonts.QrCode
- 3) Click Add to add a class instance
- 4) Type BarCodeWizFonts.QrCode.QrCodeFonts for class name and MyQRCode for instance name.
![](https://media.barcodewiz.com/images/37469e21-d9e5-4dcd-adc4-8418cd095041-QR-vs-reports-017.png)
Step 6. Insert a new column with data to encode
- Right-click on the last column's header and select Insert Column - Right.
- In the new column, click in the upper-right corner and select the column with data you wish to encode (in our case - item_name).
![](https://media.barcodewiz.com/images/42a61715-35b5-4f7d-ab17-e43b24736859-QR-vs-reports-018.png)
Step 7. Edit the Expression
- Right-click on the column with the data to encode (item_name) and select Expression
![](https://media.barcodewiz.com/images/fb0a13d8-8f80-4b7f-a708-caa7269fa78c-QR-vs-reports-019.png)
- Edit the Expression:
- =Code.MyQrCode.Encode( Fields!item_name.Value)
- Click OK
![](https://media.barcodewiz.com/images/638e672e-2409-466b-bfba-8443a71cd1e1-QR-vs-reports-020.png)
Step 8. Add reference to BarCodeWizFonts.QrCode.dll
- In Solution Explorer right-click on References
- Select Add Reference...
![](https://media.barcodewiz.com/images/0718b2d9-7d58-44ce-89b9-55e7841a5c03-QR-vs-reports-021.png)
- In Reference Manager click on Browse.
![Click on Browse to select references](https://media.barcodewiz.com/images/56826298-9668-42ec-83de-6d04636c4b67-RDLC-012.png)
- In the Select the files to reference window, browse to folder Program Files\BarCodeWiz\BarCodeWiz QR Code Fonts\DotNet\net20 and add the file BarCodeWizFonts.QrCode.dll
- Click OK in the Reference Manager window.
![](https://media.barcodewiz.com/images/f1d4c1c6-5312-4a22-a7c6-b960be4b8312-QR-vs-reports-023.png)
- Test your Report
- Click Start Without Debugging or press CTRL + F5
- You should see a report similar to the screenshot
![](https://media.barcodewiz.com/images/5889ba88-3992-4f00-88ea-154f3cf8d2a2-QR-vs-reports-024.png)
Step 9. Set the font
- Change the font to BCW_QR
- Set point size to 6
![](https://media.barcodewiz.com/images/02afcbdf-444e-47e0-ba47-b9772369434b-QR-vs-reports-025.png)
The Report is ready!
- Click Start Without Debugging or press CTRL + F5 to preview it
![](https://media.barcodewiz.com/images/985f6f75-293c-46f2-8401-391c33b293f1-QR-vs-reports-026.png)