【问题标题】:mscorlib - value cannot be null - parameter name: valuemscorlib - 值不能为空 - 参数名称:值
【发布时间】:2011-05-10 01:20:15
【问题描述】:

我有一个已经构建了一段时间的 VB.net 应用程序。我最近在其中一个报告中添加了活动报告 6 中的条形码。

在我的机器和其他机器上一切正常,但少数人收到与以下相关的错误:

mscorlib - 值不能为空 - 参数名称:值

代码如下:

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 吗?我不确定为什么会发生此错误。

谢谢

【问题讨论】:

    标签: vb.net exception activereports mscorlib


    【解决方案1】:

    从堆栈跟踪看来,您添加的字体无效。确保用户已将其安装在他们的机器上或选择更有保障的字体。

    【讨论】:

    • @pickypg 这可能是条形码样式吗?我把它设置为 128auto,其他都是 tahoma 和 arial
    • @Jeff 这听起来像是当时最有可能的候选人。一个简单的找出方法是使用带有几个 Try/Catch 块的版本来找到有罪的一方。
    • @pickypg try/catch with err.description 和 source 刚刚返回的 mscorlib 值不能为参数值 - 它在 rp.run 停止
    • 假设我应该预见到这一点。然后尝试将字体更改为 Arial。
    • @pickypg - 在你提到它之前我就这样做了。起初,新的例外是 arial 不支持“正常”样式。每当我将样式切换为粗体时,它都会抛出与开始时相同的异常
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-16
    • 2014-05-17
    • 2016-05-14
    • 2015-11-05
    • 2019-05-26
    相关资源
    最近更新 更多