在公司的项目中(项目用到了remoting),利用ActiveReport控件做打印,其中用到了BarCode这个控件,条形码格式选择的是EAN-13。在客户端打印预览时,抛出了异常:
“未找到反序列化‘DataDynamics.BarCode.BarEngine+BarEngineException’类型对象的构造函数”
经过追踪,服务端抛出的异常是在
" at DataDynamics.ActiveReports.Barcode.#Pvb(GraphicsCache cache, Page page, PointF pageOffset, Single startPos, Single endPos)/r/n
at DataDynamics.ActiveReports.ARControl.Render(GraphicsCache gRef, Page page, PointF pageOffset, Single startPos, Single endPos)/r/n
at DataDynamics.ActiveReports.Section.Render(GraphicsCache cache, Page page, PointF pageOffset, Single pageWidth, Single drawStartPos, Single drawEndPos)/r/n
at #mb.#mqb.#vDb()/r/n at #mb.#vqb.#rEb()/r/n
at #mb.#vqb.#qEb(Page newPage, Single left, Single top, Single right, Single bottom, UInt32 flags, UInt32& status)/r/n
at DataDynamics.ActiveReports.ActiveReport3.#4yb()/r/n
at DataDynamics.ActiveReports.ActiveReport3.Run(Boolean syncDocument)/r/n
at DataDynamics.ActiveReports.ActiveReport3.Run()/r/n "
方法内,抛出的错误信息: ‘incorrect data length’。
后来查到是由于BarCode这个控件赋的值不符合条形码EAN-13的规范,后来改成EAN-13标准的13码,问题解决了。