Flexreport Barcode Printing

Posted by: info on 30 May 2020, 8:16 pm EST

    • Post Options:
    • Link

    Posted 30 May 2020, 8:16 pm EST - Updated 3 October 2022, 2:51 pm EST

    Hello, if I insert a too small barcode field, the system highlights in red that the field cannot be drawn (I attach the photo).

    We have created a labeling system that allows you to draw the label layout. Then the user designs the layout independently of the data.

    Subsequently, the user decides to print the labels of 3 articles.

    Each article can have a different type of barcode, for example, 1 article must print an Ean8, 1 article must print an Ean13 and an article a Code128.

    With the previous version, (C1.Win.BarCode.4.dll and C1.Win.C1BarCode.4.dll 4.0.2017.248 ecc), we converted barcodes into images and we had no size problems, solved it in the following way:

    1. Generate the label by inserting an image field to display the barcode.
    2. Export of barcodes to the desired size using the scretch / scale features.
    3. Passing the images to the report for each individual label via the Detail OnFormat event …

    With the updated libraries (C1.Win.BarCode.4.5.2.dll 4.5.20201.416) the generation of bar codes at a certain resolution (e.g. fit to control, scratch or scale) is much more limited.

    The result is that the bar code image generated is usually of very small dimensions (106x54px which I attach) and, by printing it in this way, it has a very bad resolution, reducing the graphic aspect or reading the code.

    To solve, we have converted the technique using the barcodefield, completely solving the resolution problems, but we have found that there is no automatic horizontal resize of the bar code and, reason that has prompted us to open this ticket, for small size bar codes, the bar code is not own generated.

    Do you have a solution?

    Thank’s, Regards, Marco

  • Posted 30 May 2020, 8:20 pm EST - Updated 3 October 2022, 2:51 pm EST

    these images instead illustrate the system we have created:

  • Posted 30 May 2020, 8:25 pm EST

    This is the algorithm that we have developed:

    
    flexReport.StartSection += () => 
    	{
    		if (e.Section != SectionTypeEnum.Detail) return;
            if (!(sender is C1FlexReport flexReport)) return;
    		
    		foreach (string barCodeFieldName in _barCodeFieldsName)
    		{
    			if (!(flexReport.Fields[barCodeFieldName] is BarCodeField barCodeField)) continue;
    			
    			index = flexReport.DataSource.DataHandler.GetBookmark();
    	
    			barCodeField.BarCode = _dataTable.DefaultView[index]["BarCodeType"].ToString();
    			barCodeField.Text = _dataTable.DefaultView[index]["BarCodeText"].ToString();
    		}
    	}
    	
    
    
  • Posted 1 June 2020, 4:43 am EST

    Hello,

    You can set the AutoWidth of Barcode to CanGrow to achieve your requirement.

    Thanks,

    Mohit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels