Barcodes and QR Codes - majorsilence/Reporting GitHub Wiki

To insert a barcode or QR code in a report open a report in the report designer, right click a location on the report. In the popup menu go to Insert and select one of the following options. An updated list can always be found in the CustomReportItems section of RdlEngineConfig.xml.

  • BarCode EAN-13
  • BarCode Bookland
  • QR Code
<CustomReportItem Name="PLACEHOLDER_NAME">
  <Type>Qr Code</Type>
  <Height>30.91mm</Height>
  <Width>30.91mm</Width>
    <CustomProperties>
      <CustomProperty>
        <Name>Code</Name>
        <Value>=Fields!PLACEHODER_FIELD.Value</Value>
      </CustomProperty>
    </CustomProperties>
  <Left>1.13pt</Left>
  <Top>0.75pt</Top>
  <Source>Embedded</Source>
</CustomReportItem>
  • BarCode39
<CustomReportItem Name="PLACEHOLDER_NAME">
  <Type>BarCode39</Type>
  <Height>30.91mm</Height>
  <Width>60.91mm</Width>
    <CustomProperties>
      <CustomProperty>
        <Name>Code</Name>
        <Value>=Fields!PLACEHODER_FIELD.Value</Value>
      </CustomProperty>
    </CustomProperties>
  <Left>1.13pt</Left>
  <Top>0.75pt</Top>
  <Source>Embedded</Source>
</CustomReportItem>
  • BarCodeEAN8
<CustomReportItem Name="PLACEHOLDER_NAME">
  <Type>BarCodeEAN8</Type>
  <Height>30.91mm</Height>
  <Width>60.91mm</Width>
    <CustomProperties>
      <CustomProperty>
        <Name>Code</Name>
        <Value>=Fields!PLACEHODER_FIELD.Value</Value>
      </CustomProperty>
    </CustomProperties>
  <Left>1.13pt</Left>
  <Top>0.75pt</Top>
  <Source>Embedded</Source>
</CustomReportItem>
  • AztecCode
<CustomReportItem Name="PLACEHOLDER_NAME">
  <Type>AztecCode</Type>
  <Height>30.91mm</Height>
  <Width>60.91mm</Width>
    <CustomProperties>
      <CustomProperty>
        <Name>Code</Name>
        <Value>=Fields!PLACEHODER_FIELD.Value</Value>
      </CustomProperty>
    </CustomProperties>
  <Left>1.13pt</Left>
  <Top>0.75pt</Top>
  <Source>Embedded</Source>
</CustomReportItem>
  • BarCode128
<CustomReportItem Name="PLACEHOLDER_NAME">
  <Type>BarCode128</Type>
  <Height>30.91mm</Height>
  <Width>60.91mm</Width>
    <CustomProperties>
      <CustomProperty>
        <Name>Code</Name>
        <Value>=Fields!PLACEHODER_FIELD.Value</Value>
      </CustomProperty>
    </CustomProperties>
  <Left>1.13pt</Left>
  <Top>0.75pt</Top>
  <Source>Embedded</Source>
</CustomReportItem>
  • ITF-14
  • Pdf417
<CustomReportItem Name="PLACEHOLDER_NAME">
  <Type>Pdf417</Type>
  <Height>30.91mm</Height>
  <Width>60.91mm</Width>
    <CustomProperties>
      <CustomProperty>
        <Name>Code</Name>
        <Value>=Fields!PLACEHODER_FIELD.Value</Value>
      </CustomProperty>
    </CustomProperties>
  <Left>1.13pt</Left>
  <Top>0.75pt</Top>
  <Source>Embedded</Source>
</CustomReportItem>
  • DataMatrix
<CustomReportItem Name="PLACEHOLDER_NAME">
  <Type>DataMatrix</Type>
  <Height>30.91mm</Height>
  <Width>60.91mm</Width>
    <CustomProperties>
      <CustomProperty>
        <Name>Code</Name>
        <Value>=Fields!PLACEHODER_FIELD.Value</Value>
      </CustomProperty>
    </CustomProperties>
  <Left>1.13pt</Left>
  <Top>0.75pt</Top>
  <Source>Embedded</Source>
</CustomReportItem>

Once the bar code has been inserted select it, right click and select properties. Now set the bar codes value. If you wish to use a field value such as

=Fields!FirstName.Value

you must manually edit the XML by select the RDL Text tab and finding the barcodes CustomReportItem. Once found you need to move it into either the <List> or <Table> </ReportItems> that is in the report.

See the screenshots below for a visual walk through.

Insert bar code menu option. Insert Barcode Menu Option

Set barcode value. In this screenshot you can see the QR code is having its value set. Barcode value

This screenshot shows that the QR code value is set to come from a data field on the report. However before this will work the xml must manually be edited to move the QR code into the List or Table that the data field is a member of. Barcode value from list or table field

This screenshot shows the xml before the QR code before the CustomReportItem has been moved into the reports List data. Barcode original XML with no access to field values

This screenshot is the xml code after the CustomReportItem has been moved into the reports List ReportItems and can now be run to produce a QR code for each row displayed on the report. Barcode with access to field value

Related

Also see the CustomReportItems/QrCode use in the Reports_ChainedTest.cs and Reports_ManualDefinitionTest.cs tests via Majorsilence.Reporting.RdlCreator.

⚠️ **GitHub.com Fallback** ⚠️