Telerik Forums
UI for WinForms Forum
1 answer
51 views

Background:

  • Given a spreadsheet template, to generate a new spreadsheet by filling the information and barcode.
  • E.g. the screenshot (template) below, the barcode to be inserted at the cell location.

What I have done:

  • I manage to locate the target cell index (by searching the keyword $PART_NAME_LABEL$).

Question:

  • How to insert the barcode (image) at the target cell index location?
  • Any other suggestions for barcode generation? (Instead of inserting the barcode image, e.g. using barcode font)

I have referred to the sample in this page but it doesn't work.

https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/features/shapes-and-images

 

XlsxFormatProvider formatProvider = new XlsxFormatProvider();
            Workbook workbook = formatProvider.Import(File.ReadAllBytes(@"C:\temp\temp.xlsx"));

            var worksheet = workbook.Sheets[0] as Worksheet;

            FindOptions f = new FindOptions();
            f.FindWhat = "$PART_NAME_LABEL$";

            IEnumerable<FindResult> result = worksheet.FindAll(f);

            foreach(var i in result)
            {
                worksheet.Cells[i.FoundCell.CellIndex].SetValue("");
                //Add barcode here
                RadBarcode radBarcode1 = new RadBarcode();
                Telerik.WinControls.UI.Barcode.Symbology.Code39Extended code39Extended1 = new Telerik.WinControls.UI.Barcode.Symbology.Code39Extended();
                radBarcode1.Symbology = code39Extended1;
                radBarcode1.Value = "123456";
                radBarcode1.LoadElementTree();

                var ms = new MemoryStream();
                Image barcode = radBarcode1.ExportToImage();
                barcode.Save(ms, ImageFormat.Png);

                FloatingImage image = new FloatingImage(worksheet, i.FoundCell.CellIndex, 35, 10);
                image.ImageSource = new Telerik.Windows.Documents.Media.ImageSource(ms, "png");
            }

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 08 May 2023
2 answers
344 views

Hello,

we are creating a barcode programmatically like it is described here: https://www.telerik.com/forums/generate-barcode-image-programmatically

The problem is, that the barcode itself is a bit small (width) for our purpose.

Our code looks like this:

var barcode = new RadBarcode();
barcode.Width = 900;
barcode.Height = 150;
barcode.Symbology = new Code39();
barcode.Value = "1890";
barcode.LoadElementTree();
var barcodeImage = barcode.ExportToImage(900, 150);
barcodeImage.Save(@"C:\test.png");

But if you look at the attached image (test.png), it has the correct size alright, but not the barcode itself. 

Is there away to give the barcode itself more width?

 

Kind regards.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 03 May 2021
1 answer
400 views

In many other Datamatrix controls the tilde character is used to recognize special characters like FNC1 for GS1-Datamatrix. The documentation is very scarce. https://docs.telerik.com/devtools/winforms/controls/barcode/barcode-types/2d-barcodes/datamatrix/overview

 

Is there support for control characters? 

How can I represent <RS> (record separator), <GS> (group separator) and <EOT> (end of text) in the Datamatrix string?

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 31 Mar 2021
1 answer
68 views

Hi,

I am using Barcode inside the cross tab. 

I want to print Barcode like Figure 2. Currently shows Figure 1.

waiting for your favorable response. 

Thanks.

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Mar 2020
2 answers
127 views

Hi everybody, I'm evaluating RadBarcode for printing barcodes in thermal printers. My printers have a resolution of 203 dpi in both horizontal and vertical directions. I'm trying to generate an image of the barcode (EAN13) and sending to printer:

 

        public DrawBarcode(Point Location, Size Size, string valor): base(Location)
        {
            this.Valor = valor;
            bc = new RadBarcode();
            bc.Value = valor;
            
            var EAN13 = new Telerik.WinControls.UI.Barcode.Symbology.EAN13();
            EAN13.ShowText = true;

            bc.Symbology = EAN13;
            EAN13.Stretch = true;

            int n = 50;
            while (true)
            {
                try
                {
                    img = bc.ExportToImage(2*n, n);
                    this.size = img.Size;
                    return;
                }
                catch (Exception) { n += 10; }
            }
        }

 

        public override void Draw(Graphics g)
        {
            base.Draw(g);
            g.DrawImage(img, 0, 0);
        }

I have a base class for controling Drag, zoom and rotation but it is not important in this scenario. When I send the image to screen, text is rendered perfectly but when I send the image to the printer, text is not redeable. Is it any why to specify resolution in ExortToImage or any other why to change generated image resolution?

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 28 May 2019
1 answer
116 views

I have used this code to generate barcode to excel.   I tried Code 39 and EAN128.  But the barcode scanner cannot read.  What is missing in here?  Where can I find demo & documentation for winform barcode to excel?  Thanks.

                Telerik.WinControls.UI.Barcode.Symbology.EAN128 code39Extended1 = new Telerik.WinControls.UI.Barcode.Symbology.EAN128();
                RadBarcode rBL = new RadBarcode();
                rBL.Symbology = code39Extended1;
                rBL.Value = "EE4698";
                rBL.LoadElementTree();
                Image imgBL = rBL.ExportToImage();
                imgBL.Save("c:\\temp\\img.jpg");

                oSheet.Cells[1, 1] = "EE4698";
                oSheet.Shapes.AddPicture("c:\\temp\\img.jpg", MsoTriState.msoFalse, MsoTriState.msoCTrue, 50, 50, 300, 45);

Hristo
Telerik team
 answered on 18 Oct 2018
1 answer
40 views

Hello,

I am build a windows form application for barcode generation. How can I change barcode forecolor? I have button for selecting color.

click the button name is "btnforcolor" then show color dialoguebox. Then select forecolor for my radBarcode component. Please help me.

My code given below

      private void btnForeColor_Click(object sender, EventArgs e)
        {
            using (ColorDialog cdialog1 = new ColorDialog())
            {
                cdialog1.AnyColor = true;
                if (cdialog1.ShowDialog() == DialogResult.OK)
                {
                    radBarcode1.ForeColor = cdialog1.Color;
                    this.btnForeColor.BackColor = cdialog1.Color;
                }
            }
        }

 

and Page Loading

 

        private void SecondCustomControle_Load(object sender, EventArgs e)
        {
            this.btnForeColor.BackColor = radBarcode1.ForeColor;
            this.btnBackColor.BackColor = radBarcode1.BackColor;     
        }

 

but this is not working. Please Help me.Thanks In advance.

Hristo
Telerik team
 answered on 17 Sep 2018
11 answers
144 views
I am assigning numerical value to the barcode value but when scanning special characters were appended at the end.
Dimitar
Telerik team
 answered on 13 Sep 2018
3 answers
45 views

Hi for some reason we have as tricks appearing at either end bar code however we just want the text. We had set it to code 128 I persumed it should be the standard of no extra characters.

 

 

Dimitar
Telerik team
 answered on 03 Jul 2018
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
Buttons, RadioButton, CheckBox, etc
DropDownList
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
Menu
RichTextEditor
PropertyGrid
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
Tabstrip (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
GanttView
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
VirtualGrid
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
Rotator
TrackBar
MessageBox
CheckedDropDownList
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
CAB Enabling Kit
TabbedForm
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ImageEditor
ScrollBar
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Styling
ColorBox
PictureBox
Callout
VirtualKeyboard
FilterView
Accessibility
DataLayout
NavigationView
ToastNotificationManager
CalculatorDropDown
Localization
TimePicker
ValidationProvider
FontDropDownList
Licensing
BreadCrumb
ButtonTextBox
LocalizationProvider
Dictionary
Overlay
Security
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
Flyout
TaskbarButton
HeatMap
SlideView
PipsPager
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?