I did this to create the barcode in winform in page_load event
- Code: Select all
this.packInfoTableAdapter.Fill(this.dsLabel.PackInfo);
Spire.Barcode.BarcodeSettings barsetting = new Spire.Barcode.BarcodeSettings();
//set the x dimension
barsetting.X = 0.8f;
barsetting.BarHeight = 25;
barsetting.Unit = GraphicsUnit.Millimeter;
barsetting.TextFont = new Font("Arial", 20.0f);
barsetting.Type = Spire.Barcode.BarCodeType.EAN13;
foreach (dsLabel.PackInfoRow row in this.dsLabel.PackInfo.Rows)
{
//Set the value to encode
barsetting.Data = row.CustomValue.ToString();
barsetting.Data2D = row.CustomValue.ToString();
Spire.Barcode.BarCodeGenerator bargenerator = new Spire.Barcode.BarCodeGenerator(barsetting);
Image barcodeimage = bargenerator.GenerateImage();
//Generate the barcode image and store it into the Barcode Column
row.BarCode = imageToByteArray(bargenerator.GenerateImage());
}
this.reportViewer1.RefreshReport();
how can I do the same thing in the webform?
in web there is a ObjectDataSource that acts as an intermediary with the dataset and do not know how to value the field of the dataset "barcode"
can you help?