graphicore / librebarcode

Libre Barcode: barcode fonts for various barcode standards.
https://graphicore.github.io/librebarcode
SIL Open Font License 1.1
425 stars 25 forks source link

EAN-13 not displaying properly in PDF from SSRS report #44

Open sebas3552 opened 3 years ago

sebas3552 commented 3 years ago

I'm trying to generate a EAN-13 barcode in SQL Server Reporting Services from a 13-digit string, the last digit is the check digit and it's already calculated. In the report designer I chose the installed "Libre Barcode EAN13 Text" as the font for that field, and it looks good in preview mode. But when I export it to any format except PowerPoint, it is no longer displayed as a valid barcode.

Preview mode: barcode_preview

Exported to PDF: barcode_exported

As you see, I'm also using other two fonts to try and those are working both on preview mode and exported to PDF, it's just the Libre Barcode EAN13 Text that isn't working.

The font was installed for all users, and PC was rebooted before using it. The SSRS server is running locally in the same machine so it has the font installed as well.

Note: the only way I got it working on PDF is exporting the report to a Word file, then opening it with LibreOffice Writer and exporting it to PDF, but unfortunately I can't tell the user to do the same.

Any help would be appreciated.

graphicore commented 3 years ago

When you use Libre Barcode EAN13 Text with just digits as input, it is required that your rendering software can do proper shaping of the OpenType Features, especially the calt feature. But actually without shaping your barcode would look rather like this:

Screenshot-20210907145420-383x166

The result here looks more like .notdef glyphs, maybe the font is not available in the PDF-exporter at all, or there's some conversion/encoding happening to the input string (as maybe with the Barcode column)?

As you see, I'm also using other two fonts to try and those are working both on preview mode and exported to PDF, it's just the Libre Barcode EAN13 Text that isn't working.

Be careful, the UPC-A example doesn't look all right at all! For the very least, the UPC-Code would have to start with a 0 to be compatible with UPC-A and then you could only encode 12 other digits, including the checksum. But also the patterns of the zeros would be clearly alternating between the first six figures and the second six figures. Further the start, middle and end guard patterns are missing.

I don't know how the Barcode column was created, it looks OK, but if you actually use a font, I would be interested to know which one it is. Is there maybe an encoding step happening (and could it be that the same step is applied to the Libre Barcode column)?

See the docs for usage details: https://graphicore.github.io/librebarcode/documentation/ean13.html Maybe you can implement the Compatible Input Method if OpenType features are not available, the grandzebu.net website has a Visual Basic 6 program/VBA macro and it looks like you can Add Code to a Report (SSRS).

If you send me the exported, failing PDF, I may be able to figure what's happening to the font. Whether it's missing or if the input string got encoded to something else. But I'm not experienced with debugging PDF directly.

sebas3552 commented 3 years ago

Don't worry about the UPC-A column, it's completely wrong for that format but it was just to show that the font used was working in preview mode and exported to PDF. I forgot to say that the Barcode column is actually an image made with some custom VB code and a barcode imaging library, and that's why it has some "demo" strings over the bars, it isn't a font.

I didn't know about the encoding method, so I tried it as you described adding the grandzebu.net VB macro (and adapting it since it's a little bit too old and gave me compillation errors at first) and now it works great with Libre Barcode EAN13 Text and grandzebu's EAN13 font, both in preview and exported mode!

Screenshot of PDF exported report: barcode_working

Thank you very much for your fast and accurate help! I hope this helps other people facing the same problem in the future as well.

graphicore commented 3 years ago

Awesome! I'm glad it worked! Maybe you can post and share the adapted macro here, under the original license (GNU LGPL), it could help even better other people from the future! :wink:

sebas3552 commented 3 years ago

That's great. Here is the macro working in Visual Studio 2019 (Visual Basic 16):

Public Function ean13(chaine)
    'Cette fonction est regie par la Licence Generale Publique Amoindrie GNU (GNU LGPL)
    'This function is governed by the GNU Lesser General Public License (GNU LGPL)
    'V 1.1.2
    'Parametres : une chaine de 12 chiffres
    'Parameters : a 12 digits length string
    'Retour : * une chaine qui, affichee avec la police EAN13.TTF, donne le code barre
    '         * une chaine vide si parametre fourni incorrect
    'Return : * a string which give the bar code when it is dispayed with EAN13.TTF font
    '         * an empty string if the supplied parameter is no good
    Dim i, checksum, first As Integer, CodeBarre As String, tableA As Boolean
    ean13 = ""
    'Verifier qu'il y a 12 caracteres
    'Check for 12 characters
    If Len(chaine) = 12 Then
        'Et que ce sont bien des chiffres
        'And they are really digits
        For i = 1 To 12
            If Asc(Mid(chaine, i, 1)) < 48 Or Asc(Mid(chaine, i, 1)) > 57 Then
                i = 0
                Exit For
            End If
        Next
        If i = 13 Then
            'Calcul de la cle de controle
            'Calculation of the checksum
            For i = 12 To 1 Step -2
                checksum = checksum + Val(Mid(chaine, i, 1))
            Next
            checksum = checksum% * 3
            For i = 11 To 1 Step -2
                checksum = checksum + Val(Mid(chaine, i, 1))
            Next
            chaine = chaine & (10 - checksum Mod 10) Mod 10
            'Le premier chiffre est pris tel quel, le deuxieme vient de la table A
            'The first digit is taken just as it is, the second one come from table A
            CodeBarre = Left(chaine, 1) & Chr(65 + Val(Mid(chaine, 2, 1)))
            first = Val(Left(chaine, 1))
            For i = 3 To 7
                tableA = False
                Select Case i
                    Case 3
                        Select Case first
                            Case 0 To 3
                                tableA = True
                        End Select
                    Case 4
                        Select Case first
                            Case 0, 4, 7, 8
                                tableA = True
                        End Select
                    Case 5
                        Select Case first
                            Case 0, 1, 4, 5, 9
                                tableA = True
                        End Select
                    Case 6
                        Select Case first
                            Case 0, 2, 5, 6, 7
                                tableA = True
                        End Select
                    Case 7
                        Select Case first
                            Case 0, 3, 6, 8, 9
                                tableA = True
                        End Select
                End Select
                If tableA Then
                    CodeBarre = CodeBarre & Chr(65 + Val(Mid(chaine, i, 1)))
                Else
                    CodeBarre = CodeBarre & Chr(75 + Val(Mid(chaine, i, 1)))
                End If
            Next
            CodeBarre = CodeBarre & "*"   'Ajout separateur central / Add middle separator
            For i = 8 To 13
                CodeBarre = CodeBarre & Chr(97 + Val(Mid(chaine, i, 1)))
            Next
            CodeBarre = CodeBarre & "+"   'Ajout de la marque de fin / Add end mark
            ean13 = CodeBarre

        End If
    End If
End Function
graphicore commented 3 years ago

Awesome, thanks!

GitHubRulesOK commented 3 years ago

Just a comment since I am not running barcodes

but saw the aside that the font may work in word export to PDF,

so correct me if wrong but WordPad is to some extent workable in many ways including setting RTF font so if the program writes to docx or rtf image

WordPad /PT can write to filename.pdf via command line and MSPrint2PDF, Is that not a second easy native route? I can try that out If you specify the font source (downlink?) you are loading

graphicore commented 3 years ago

@GitHubRulesOK I'm not sure if that helps in the context of Microsoft SQL Server Reporting Services (SSRS), but you can try of course!

The font is available via https://github.com/graphicore/librebarcode/releases/tag/v1.008 or on Google Fonts: https://fonts.google.com/specimen/Libre+Barcode+EAN13+Text?preview.text=0123456789012&preview.text_type=custom

GitHubRulesOK commented 3 years ago

OK i used the topic ttf font from here, I have no idea how a valid barcode should be calculated but random insertion works well in WordPad, but was surprised to need fs200=200x1/2points=100 pt to get a reasonable size image

That suggests that RTF based strings should work well so for my abhorance above you would generate

{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang2057{\fonttbl{\f0\fnil\fcharset0 Libre Barcode EAN13 Text;}}
{\*\generator Riched20 10.0.19041}\viewkind4\uc1\pard\sa200\sl276\slmult1\f0\fs200 H

\'c3\'eb\'ee\'e7\'e7\'ef

\fs40\par

\endash\emdash\lquote\rquote\'82

\par}

Much of that can be fixed heading (can be trimmed down more) and \pard trailer with the core barcode just short string(s) in a sandwich

graphicore commented 3 years ago

@GitHubRulesOK have a look at the docs, how to use the font: https://graphicore.github.io/librebarcode/documentation/ean13.html In short, if you give it 12 digits plus a question mark a the end, the font will create a valid EAN-13 barcode for you, including the checksum calculation, e.g. 123456789012?. There's an encoder tool to play with as well, at the bottom of the document.

Your image doesn't look sufficient at all. I think it would be interesting to know if the calt feature is used by wordpad. I'm also not sure how this is related to SSRS.

The font-size needs to be big so the barcode is big and can be scanned.

GitHubRulesOK commented 3 years ago

My interest is that native windows can output pdf from TTF and that rtf is a means to an end since dumb wordpad can print PDF given correct in and output. the code generation needs be done using cmd / vbs /powershell scripting, as described by others above. My suggestion is rtf avoids using any additional installed application (e,g, Word) over and above a report generator. image

graphicore commented 3 years ago

Maybe, similar to WordPad, Edge could be used to render an input HTML string directly to PDF. It can handle OpenType features and it can print to PDF, it also is a native app. No EAN-13 encoding would be required, as the font can do it. Doing it all from the command line would be likely the part where it breaks. But, I don't even have access to windows right now.

GitHubRulesOK commented 3 years ago

The difference between Edge and WordPad is how you wish to call it Edge/Chrome --headless tends to use system A4/Letter default page but I guess that may be overridden by a size --option (untested) Wordpad /PT is also usually blind page printing so again needs system default form[at]s to be pre-set using PrintUI directives thus neither easily adapted to barcode layout unless using a simple Full Sheet template like Avery.

atultandon1981 commented 3 years ago

That's great. Here is the macro working in Visual Studio 2019 (Visual Basic 16):

Public Function ean13(chaine)
    'Cette fonction est regie par la Licence Generale Publique Amoindrie GNU (GNU LGPL)
    'This function is governed by the GNU Lesser General Public License (GNU LGPL)
    'V 1.1.2
    'Parametres : une chaine de 12 chiffres
    'Parameters : a 12 digits length string
    'Retour : * une chaine qui, affichee avec la police EAN13.TTF, donne le code barre
    '         * une chaine vide si parametre fourni incorrect
    'Return : * a string which give the bar code when it is dispayed with EAN13.TTF font
    '         * an empty string if the supplied parameter is no good
    Dim i, checksum, first As Integer, CodeBarre As String, tableA As Boolean
    ean13 = ""
    'Verifier qu'il y a 12 caracteres
    'Check for 12 characters
    If Len(chaine) = 12 Then
        'Et que ce sont bien des chiffres
        'And they are really digits
        For i = 1 To 12
            If Asc(Mid(chaine, i, 1)) < 48 Or Asc(Mid(chaine, i, 1)) > 57 Then
                i = 0
                Exit For
            End If
        Next
        If i = 13 Then
            'Calcul de la cle de controle
            'Calculation of the checksum
            For i = 12 To 1 Step -2
                checksum = checksum + Val(Mid(chaine, i, 1))
            Next
            checksum = checksum% * 3
            For i = 11 To 1 Step -2
                checksum = checksum + Val(Mid(chaine, i, 1))
            Next
            chaine = chaine & (10 - checksum Mod 10) Mod 10
            'Le premier chiffre est pris tel quel, le deuxieme vient de la table A
            'The first digit is taken just as it is, the second one come from table A
            CodeBarre = Left(chaine, 1) & Chr(65 + Val(Mid(chaine, 2, 1)))
            first = Val(Left(chaine, 1))
            For i = 3 To 7
                tableA = False
                Select Case i
                    Case 3
                        Select Case first
                            Case 0 To 3
                                tableA = True
                        End Select
                    Case 4
                        Select Case first
                            Case 0, 4, 7, 8
                                tableA = True
                        End Select
                    Case 5
                        Select Case first
                            Case 0, 1, 4, 5, 9
                                tableA = True
                        End Select
                    Case 6
                        Select Case first
                            Case 0, 2, 5, 6, 7
                                tableA = True
                        End Select
                    Case 7
                        Select Case first
                            Case 0, 3, 6, 8, 9
                                tableA = True
                        End Select
                End Select
                If tableA Then
                    CodeBarre = CodeBarre & Chr(65 + Val(Mid(chaine, i, 1)))
                Else
                    CodeBarre = CodeBarre & Chr(75 + Val(Mid(chaine, i, 1)))
                End If
            Next
            CodeBarre = CodeBarre & "*"   'Ajout separateur central / Add middle separator
            For i = 8 To 13
                CodeBarre = CodeBarre & Chr(97 + Val(Mid(chaine, i, 1)))
            Next
            CodeBarre = CodeBarre & "+"   'Ajout de la marque de fin / Add end mark
            ean13 = CodeBarre

        End If
    End If
End Function

Well done , i am having exact issue but could not figure out how to use this macro code, please describe bit more if possible

graphicore commented 3 years ago

@GitHubRulesOK thanks for adding that image

@atultandon1981 I'm not a Visual Basic programmer, but it's just a function definition, so you have to call the function in your macro, with a string of 12 digits as input. It returns an empty string on failure or a string that will render a barcode when used with the font.

'Put the function definition maybe here?
Public Function ean13(chaine)
    ...

Dim result as String
result = ean13("123456789012") ' => "1CDOFQR*ijabci+"

It depends on your scenario how to call the function and use the result.

Since I'm on Linux and have no Windows available now, I gave it a shot to make a a stand alone command line program that runs the encoder.

I'm using mono with the mono-basic package as the VB compiler (command is vbnc):

File ean13-encoder.vb: (I added type annotations to the ean13 function)

Module Module1

Public Function ean13(chaine as String) as String
    'Cette fonction est regie par la Licence Generale Publique Amoindrie GNU (GNU LGPL)
    'This function is governed by the GNU Lesser General Public License (GNU LGPL)
    'V 1.1.2
    'Parametres : une chaine de 12 chiffres
    'Parameters : a 12 digits length string
    'Retour : * une chaine qui, affichee avec la police EAN13.TTF, donne le code barre
    '         * une chaine vide si parametre fourni incorrect
    'Return : * a string which give the bar code when it is dispayed with EAN13.TTF font
    '         * an empty string if the supplied parameter is no good
    Dim i, checksum, first As Integer, CodeBarre As String, tableA As Boolean
    ean13 = ""
    'Verifier qu'il y a 12 caracteres
    'Check for 12 characters
    If Len(chaine) = 12 Then
        'Et que ce sont bien des chiffres
        'And they are really digits
        For i = 1 To 12
            If Asc(Mid(chaine, i, 1)) < 48 Or Asc(Mid(chaine, i, 1)) > 57 Then
                i = 0
                Exit For
            End If
        Next
        If i = 13 Then
            'Calcul de la cle de controle
            'Calculation of the checksum
            For i = 12 To 1 Step -2
                checksum = checksum + Val(Mid(chaine, i, 1))
            Next
            checksum = checksum% * 3
            For i = 11 To 1 Step -2
                checksum = checksum + Val(Mid(chaine, i, 1))
            Next
            chaine = chaine & (10 - checksum Mod 10) Mod 10
            'Le premier chiffre est pris tel quel, le deuxieme vient de la table A
            'The first digit is taken just as it is, the second one come from table A
            CodeBarre = Left(chaine, 1) & Chr(65 + Val(Mid(chaine, 2, 1)))
            first = Val(Left(chaine, 1))
            For i = 3 To 7
                tableA = False
                Select Case i
                    Case 3
                        Select Case first
                            Case 0 To 3
                                tableA = True
                        End Select
                    Case 4
                        Select Case first
                            Case 0, 4, 7, 8
                                tableA = True
                        End Select
                    Case 5
                        Select Case first
                            Case 0, 1, 4, 5, 9
                                tableA = True
                        End Select
                    Case 6
                        Select Case first
                            Case 0, 2, 5, 6, 7
                                tableA = True
                        End Select
                    Case 7
                        Select Case first
                            Case 0, 3, 6, 8, 9
                                tableA = True
                        End Select
                End Select
                If tableA Then
                    CodeBarre = CodeBarre & Chr(65 + Val(Mid(chaine, i, 1)))
                Else
                    CodeBarre = CodeBarre & Chr(75 + Val(Mid(chaine, i, 1)))
                End If
            Next
            CodeBarre = CodeBarre & "*"   'Ajout separateur central / Add middle separator
            For i = 8 To 13
                CodeBarre = CodeBarre & Chr(97 + Val(Mid(chaine, i, 1)))
            Next
            CodeBarre = CodeBarre & "+"   'Ajout de la marque de fin / Add end mark
            ean13 = CodeBarre

        End If
    End If
End Function

Sub Main(ByVal cmdArgs() As String)
    Dim result as String
    result = ean13(cmdArgs(0)) '"123456789012" => "1CDOFQR*ijabci+"     
    Console.WriteLine("Input: " + cmdArgs(0))
    Console.WriteLine("Result: " + result)
    If result = ""  Then    
        Console.WriteLine("FAIL!")
    Else
        Console.WriteLine("SUCCESS!")
    End If
End Sub

End Module

compile:

$ vbnc ean13-encoder.vb 
Visual Basic.Net Compiler version 0.0.0.5943 (Mono 4.7 - tarball)
Copyright (C) 2004-2010 Rolf Bjarne Kvinge. All rights reserved.

Assembly 'ean13-encoder, Version=0.0, Culture=neutral, PublicKeyToken=null' saved successfully to '/path/to/ean13-encoder.exe'.
Compilation successful
Compilation took 00:00:00.6057890

Run with good input:

$ mono ean13-encoder.exe 123456789012
Input: 123456789012
Result: 1CDOFQR*ijabci+
SUCCESS!

Run with bad input

$ mono ean13-encoder.exe 123456
Input: 123456
Result: 
FAIL!
sebas3552 commented 3 years ago

That's great. Here is the macro working in Visual Studio 2019 (Visual Basic 16):

Public Function ean13(chaine)
    'Cette fonction est regie par la Licence Generale Publique Amoindrie GNU (GNU LGPL)
    'This function is governed by the GNU Lesser General Public License (GNU LGPL)
    'V 1.1.2
    'Parametres : une chaine de 12 chiffres
    'Parameters : a 12 digits length string
    'Retour : * une chaine qui, affichee avec la police EAN13.TTF, donne le code barre
    '         * une chaine vide si parametre fourni incorrect
    'Return : * a string which give the bar code when it is dispayed with EAN13.TTF font
    '         * an empty string if the supplied parameter is no good
    Dim i, checksum, first As Integer, CodeBarre As String, tableA As Boolean
    ean13 = ""
    'Verifier qu'il y a 12 caracteres
    'Check for 12 characters
    If Len(chaine) = 12 Then
        'Et que ce sont bien des chiffres
        'And they are really digits
        For i = 1 To 12
            If Asc(Mid(chaine, i, 1)) < 48 Or Asc(Mid(chaine, i, 1)) > 57 Then
                i = 0
                Exit For
            End If
        Next
        If i = 13 Then
            'Calcul de la cle de controle
            'Calculation of the checksum
            For i = 12 To 1 Step -2
                checksum = checksum + Val(Mid(chaine, i, 1))
            Next
            checksum = checksum% * 3
            For i = 11 To 1 Step -2
                checksum = checksum + Val(Mid(chaine, i, 1))
            Next
            chaine = chaine & (10 - checksum Mod 10) Mod 10
            'Le premier chiffre est pris tel quel, le deuxieme vient de la table A
            'The first digit is taken just as it is, the second one come from table A
            CodeBarre = Left(chaine, 1) & Chr(65 + Val(Mid(chaine, 2, 1)))
            first = Val(Left(chaine, 1))
            For i = 3 To 7
                tableA = False
                Select Case i
                    Case 3
                        Select Case first
                            Case 0 To 3
                                tableA = True
                        End Select
                    Case 4
                        Select Case first
                            Case 0, 4, 7, 8
                                tableA = True
                        End Select
                    Case 5
                        Select Case first
                            Case 0, 1, 4, 5, 9
                                tableA = True
                        End Select
                    Case 6
                        Select Case first
                            Case 0, 2, 5, 6, 7
                                tableA = True
                        End Select
                    Case 7
                        Select Case first
                            Case 0, 3, 6, 8, 9
                                tableA = True
                        End Select
                End Select
                If tableA Then
                    CodeBarre = CodeBarre & Chr(65 + Val(Mid(chaine, i, 1)))
                Else
                    CodeBarre = CodeBarre & Chr(75 + Val(Mid(chaine, i, 1)))
                End If
            Next
            CodeBarre = CodeBarre & "*"   'Ajout separateur central / Add middle separator
            For i = 8 To 13
                CodeBarre = CodeBarre & Chr(97 + Val(Mid(chaine, i, 1)))
            Next
            CodeBarre = CodeBarre & "+"   'Ajout de la marque de fin / Add end mark
            ean13 = CodeBarre

        End If
    End If
End Function

Well done , i am having exact issue but could not figure out how to use this macro code, please describe bit more if possible

In my use case with SSRS and Visual Studio 2019, I used the macro this way (sorry for the spanish translated VS):

  1. I set up a VB console project to check that the macro works as expected, similar as what @graphicore explained:

code

  1. Then, in the SSRS project I added the macro to the custom code section in report properties (only the function itself, without the module declaration):

ssrs

  1. Finally, I called the macro on the barcode text field in the report and passed it the EAN column coming from the report dataset:

macro

So, that transforms the original EAN value into the encoded value, and then when the Libre Barcode EAN13 Text font style is applied to the text field it generates the visual barcode into the report.

You can check out this repo where I uploaded the whole working solution: https://github.com/sebas3552/TutorialSSRS_Barcode

atultandon1981 commented 3 years ago

Well done, very nice work.

Thanks for sharing Regards Atul

On Fri, 10 Sep 2021, 4:37 pm Sebastián Cruz, @.***> wrote:

That's great. Here is the macro working in Visual Studio 2019 (Visual Basic 16):

Public Function ean13(chaine) 'Cette fonction est regie par la Licence Generale Publique Amoindrie GNU (GNU LGPL) 'This function is governed by the GNU Lesser General Public License (GNU LGPL) 'V 1.1.2 'Parametres : une chaine de 12 chiffres 'Parameters : a 12 digits length string 'Retour : une chaine qui, affichee avec la police EAN13.TTF, donne le code barre ' une chaine vide si parametre fourni incorrect 'Return : a string which give the bar code when it is dispayed with EAN13.TTF font ' an empty string if the supplied parameter is no good Dim i, checksum, first As Integer, CodeBarre As String, tableA As Boolean ean13 = "" 'Verifier qu'il y a 12 caracteres 'Check for 12 characters If Len(chaine) = 12 Then 'Et que ce sont bien des chiffres 'And they are really digits For i = 1 To 12 If Asc(Mid(chaine, i, 1)) < 48 Or Asc(Mid(chaine, i, 1)) > 57 Then i = 0 Exit For End If Next If i = 13 Then 'Calcul de la cle de controle 'Calculation of the checksum For i = 12 To 1 Step -2 checksum = checksum + Val(Mid(chaine, i, 1)) Next checksum = checksum% 3 For i = 11 To 1 Step -2 checksum = checksum + Val(Mid(chaine, i, 1)) Next chaine = chaine & (10 - checksum Mod 10) Mod 10 'Le premier chiffre est pris tel quel, le deuxieme vient de la table A 'The first digit is taken just as it is, the second one come from table A CodeBarre = Left(chaine, 1) & Chr(65 + Val(Mid(chaine, 2, 1))) first = Val(Left(chaine, 1)) For i = 3 To 7 tableA = False Select Case i Case 3 Select Case first Case 0 To 3 tableA = True End Select Case 4 Select Case first Case 0, 4, 7, 8 tableA = True End Select Case 5 Select Case first Case 0, 1, 4, 5, 9 tableA = True End Select Case 6 Select Case first Case 0, 2, 5, 6, 7 tableA = True End Select Case 7 Select Case first Case 0, 3, 6, 8, 9 tableA = True End Select End Select If tableA Then CodeBarre = CodeBarre & Chr(65 + Val(Mid(chaine, i, 1))) Else CodeBarre = CodeBarre & Chr(75 + Val(Mid(chaine, i, 1))) End If Next CodeBarre = CodeBarre & "" 'Ajout separateur central / Add middle separator For i = 8 To 13 CodeBarre = CodeBarre & Chr(97 + Val(Mid(chaine, i, 1))) Next CodeBarre = CodeBarre & "+" 'Ajout de la marque de fin / Add end mark ean13 = CodeBarre

    End If
End If

End Function

Well done , i am having exact issue but could not figure out how to use this macro code, please describe bit more if possible

In my use case with SSRS and Visual Studio 2019, I used the macro this way (sorry for the spanish translated VS):

  1. I set up a VB console project to check that the macro works as expected, similar as what @graphicore https://github.com/graphicore explained:

[image: code] https://user-images.githubusercontent.com/38670360/132809825-825e1f60-476b-4155-acf9-5f90b2cfaeaa.png

  1. Then, in the SSRS project I added the macro to the custom code section in report properties (only the function itself, without the module declaration):

[image: ssrs] https://user-images.githubusercontent.com/38670360/132809955-7eea6566-597b-4dca-b6cc-7b91573eb63e.png

  1. Finally, I called the macro on the barcode text field in the report and passed it the EAN column coming from the report dataset:

[image: macro] https://user-images.githubusercontent.com/38670360/132810221-8f9e5b71-7eb3-4521-a40b-c4a81deafd5e.png

So, that transforms the original EAN value into the encoded value, and then when the Libre Barcode EAN13 Text font style is applied to the text field it generates the visual barcode into the report.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/graphicore/librebarcode/issues/44#issuecomment-916667797, or unsubscribe https://github.com/notifications/unsubscribe-auth/APUKJLMISCHRHNONR5MRHNTUBGRTPANCNFSM5DRISUVQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.