我有一个已经构建了一段时间的VB.net应用程序。我最近在其中一份报告的活动报告中添加了条形码。
我的机器以及其他设备上的一切正常,但有少数人会收到与以下内容相关的错误:
mscorlib - 值不能为null - 参数名称:值
代码如下:
Dim rp As New ARPTSpecialOrderCard
CType(rp.Sections("pgDetails").Controls("labelVendorPhone"), DataDynamics.ActiveReports.Label).Text = Me.LabelVendorTelephone.Text
CType(rp.Sections("pgDetails").Controls("labelID"), DataDynamics.ActiveReports.Label).Text = Me.orderid.ToString
CType(rp.Sections("pgDetails").Controls("bcID"), DataDynamics.ActiveReports.Barcode).Text = Me.orderid.ToString
rp.Run()
frmARViewer.Viewer1.Document = rp.Document
frmARViewer.ShowDialog()
例外文字:
> ************** Exception Text ************** System.ArgumentNullException: Value
> cannot be null. Parameter name: value
> at
> System.Collections.CollectionBase.OnValidate(Object value) at
> System.Collections.CollectionBase.System.Collections.IList.Add(Object value) at
> DataDynamics.ActiveReports.Document.FontsCollection.Add(Font inFont) at
> #f.#iZi.set_Font(Font value) at
> DataDynamics.ActiveReports.Label.#Pvb(GraphicsCache cache, Page page, PointF pageOffset, Single startPos, Single endPos) at
> DataDynamics.ActiveReports.ARControl.Render(GraphicsCache gRef, Page page, PointF pageOffset, Single startPos, Single endPos) at
> DataDynamics.ActiveReports.Section.Render(GraphicsCache cache, Page page, #Ppb drawingLog, PointF pageOffset, Single pageWidth, Single drawStartPos, Single drawEndPos) at
> DataDynamics.ActiveReports.Section.Render(GraphicsCache cache, #rqb rData, #Ppb drawingLog) at
> #mb.#mqb.#LDb() at
> #mb.#mqb.#SDb(Section section, Int32 insPos) at
> #mb.#vqb.#vEb() at
> #mb.#vqb.#qEb(Page newPage, Single left, Single top, Single right, Single bottom, UInt32 flags, UInt32& status) at
> DataDynamics.ActiveReports.ActiveReport.#4yb() at
> DataDynamics.ActiveReports.ActiveReport.Run(Boolean syncDocument) at
> SpecialOrderSystem.soFRMViewOrder.pbPrintPO_Click(Object sender, EventArgs e) at
> System.Windows.Forms.Control.OnClick(EventArgs e) at
> System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at
> System.Windows.Forms.Control.WndProc(Message& m) at
> System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at
> System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
我是否需要更新用户计算机上的mscorlib.dll?我不确定为什么会发生这种错误。
感谢
答案 0 :(得分:1)
从堆栈跟踪中,您似乎添加了无效的Font。确保用户已在其计算机上安装它或选择更有保证的字体。