CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2008
    Posts
    136

    Thumbs up Using Barcode DLL Component

    In this simple guide, you will learn how to use the Barcode DLL component in RDL reports.

    System Requirements
    - Visual Studio (VS) 2005/2008/2010 or Business Intelligent Development Studio (BIDS) 2005/2008/2012
    - Reporting Services 2005/2008/2008-R2/2012 ANY Editions (Express, Workgroup, Web, Developer, Standard, Enterprise or Datacenter)

    In the following sample you'll create a Report Server Project which features barcode images by using Barcode Professional DLL component. This project will contain a simple RDL report displaying a List of products from Microsoft's AdventureWorks database sample (http://msftdbprodsamples.codeplex.com/).

    NOTE: This guide uses Visual Studio 2008 for reference but you can use the same approach if using Visual Studio 2005 or Visual Studio 2010

    Please follow up these steps:
    - Please ensure you correctly set up Barcode Professional DLL component (See [url]Barcode DLL Configuration[/urlhttp://www.neodynamic.com/Products/Help/BarcodeReportingServices7.0/rsconfiguration_barcode_dll.htm])
    - Open VS or BIDS and create a new Report Server Project
    - With the Report Server project opened, add a new Data Source pointing to the AventureWorks database sample
    - Add a new Report item, name it to ProductList.rdlc, and enter the following SQL Statement:


    SELECT ProductID, Name, ProductModel, CultureID FROM Production.vProductAndDescription WHERE (CultureID = N'en')

    as is shown in the below figure:

    http://www.neodynamic.com/demo-faq/b...sing_dll_1.png


    - Select a Tabular type report and add the ProductID, Name, and ProductModel fields into the Report's Detail section. The report should look like the following figure:

    http://www.neodynamic.com/demo-faq/b...sing_dll_2.png


    - Now it's time to add a reference to Barcode DLL component and write a VB function for generating the barcode images. (see video below)
    -- With the report opened at design-time, select Report > Report properties...
    -- In the Report Properties dialog box, select References tab.
    -- Add a reference to Neodynamic.ReportingServices.Barcode.dll which should be located under [VS Install Folder]\Common7\IDE\PrivateAssemblies
    -- Finally, select Code tab. When generating barcodes, you should know about what Barcode Symbology you need to encode. Most common symbologies are Code 39, Code 128, GS1-128, GS1 DataBar, EAN-13, UPC-A, Data Matrix, QR Code, etc. The barcode symbology is set up by using Symbology property of Barcode object. In this sample, you will use Code 128 barcode, a common symbology which can be used for encoding full ASCII strings. When using Barcode DLL component, you need to write a custom VB function for generating barcodes which will be later displayed by an Image item on the report. In this sample you will create a VB function called GetBarcode which accept a parameter called valueToEncode which, in general, is a field of the report's data source. Inside this function you will create an instance of Barcode class called objBarcode setting up some properties for generating the barcode image:


    Public Function GetBarcode(ByVal valueToEncode As String) As Byte()

    Using objBarcode As New Neodynamic.ReportingServices.Barcode
    'Set the value to encode
    objBarcode.Code = valueToEncode
    'Set the Code 128 Barcode Symbology
    objBarcode.Symbology = _
    Neodynamic.ReportingServices.Symbology.Code128
    'Set the Bar's height to 0.5 in
    objBarcode.BarHeight = 0.5F
    'Enable AutoSize
    objBarcode.AutoSize = True
    'Generate the barcode image
    Return objBarcode.GetBarcodeImagePng()
    End Using

    End Function


    -- Close the Report Properties dialog box.

    - Now, from the VS toolbox, drag & drop an Image item onto the first column of the table.

    http://www.neodynamic.com/demo-faq/b...sing_dll_3.png

    - The image item will hold the barcode image generated by the GetBarcode function. Select the image item and hit F4 to display VS Properties Window. Set up the following properties:
    -- Source -> Database
    -- MIMEType -> image/png
    -- Sizing -> AutoSize
    -- Value -> =Code.GetBarcode(Fields!ProductID.Value.ToString)

    http://www.neodynamic.com/demo-faq/b...sing_dll_4.png

    - That's it! Click on the Preview tab to preview the report with barcodes

    http://www.neodynamic.com/demo-faq/b...sing_dll_5.png


    Deployment

    When you are ready for production, you must ensure that Barcode Professional is correctly configured and deployed to your Report Server! All steps for correctly deploying Barcode Professional DLL are stated in the Deployment topic.

    http://www.neodynamic.com/demo-faq/b...sing_dll_6.png


    Links:
    This demo
    Demos
    Download Barcode Professional for Reporting Services
    More Information about Neodynamic Barcode Professional for Reporting Services

    Neodynamic
    .NET Components & Controls
    http://www.neodynamic.com
    http://www.barcode-for-reporting-services.com

  2. #2
    Join Date
    Jan 2008
    Posts
    136

    Re: Using Barcode DLL Component

    Quote Originally Posted by rogermiller View Post
    can this barcode dll component support barcode generation in Crystal reports and SSRS?
    Hi Roger,

    Yes, you can use the component with Crystal Reports too. Contact us if you need further assistance.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured