我有一个使用DexExpress生成的报告。即使我已经提到了他们的official documentation,数据矩阵还是以某种方式不完整地生成,就像这样:
如果您对其进行扫描,您仍将获得正确的值 ER737308933MY ,因此数据矩阵没有损坏,但视觉上令人不适。这是提取的代码:
using DevExpress.XtraPrinting;
using DevExpress.XtraPrinting.BarCode;
public class OrderDetailReport : XtraReport
{
private XRBarCode xrBarCode2;
private void InitializeComponent()
{
DataMatrixGenerator dataMatrixGenerator = new DataMatrixGenerator();
this.xrBarCode2 = new XRBarCode();
this.xrBarCode2.AutoModule = true;
this.xrBarCode2.Dpi = 96f;
this.xrBarCode2.ExpressionBindings.AddRange(new ExpressionBinding[] { new ExpressionBinding("BeforePrint", "Text", "[tracking_no]") });
this.xrBarCode2.Font = new System.Drawing.Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
this.xrBarCode2.LocationFloat = new PointFloat(325.7999f, 22.07999f);
this.xrBarCode2.Name = "xrBarCode2";
this.xrBarCode2.Padding = new PaddingInfo(10, 10, 0, 0, 96f);
this.xrBarCode2.SizeF = new System.Drawing.SizeF(128.8f, 130f);
this.xrBarCode2.StylePriority.UseFont = false;
this.xrBarCode2.Symbology = dataMatrixGenerator;
}
}
很奇怪,如果我要用常规QR码替换数据矩阵,则可以正确生成QR码。因此,如果有人能指出我在这里缺少或做错了什么,我将不胜感激。