Crystal报告错误 [英] Crystal reports error

查看:69
本文介绍了Crystal报告错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到问题

report.setdatasource(datatable)

水晶报告创建时数据源是本地数据集

在设置数据源时我使用值填充数据表(与数据集相同的列名称)

到达该行时出现此错误:

I am having a problem on the line
report.setdatasource(datatable)
The crystal report is created with datasource being local dataset
while setting the datasource I populate the datatable (same column names as the dataset) with the values
On reaching that line I get this error:


CrystalDecisions.CrystalReports.Engine.InvalidArgumentException was unhandled
  Message=
Error in File temp_d2d17ab8-3746-4cba-a8ba-b92d2a3505a4 {74F89B47-DB88-4A0C-BA00-E9DD157AFCD9}.rpt:
Invalid negative value.
  Source=CrystalDecisions.ReportAppServer.DataSetConversion
  StackTrace:
       at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataSet dataSet)
       at Project.PurcahseOrder.makereport() in C:\Users\DART\Desktop\Nirav MYS (10.09.12)\Project(Nirav)\Project\PurcahseOrder.vb:line 1367
       at Project.PurcahseOrder.btnConfirm_Click(Object sender, EventArgs e) in C:\Users\DART\Desktop\Nirav MYS (10.09.12)\Project(Nirav)\Project\PurcahseOrder.vb:line 1074
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at Project.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Runtime.InteropServices.COMException
       ErrorCode=-2147483076
       Message=
Error in File temp_d2d17ab8-3746-4cba-a8ba-b92d2a3505a4 {74F89B47-DB88-4A0C-BA00-E9DD157AFCD9}.rpt:
Invalid negative value.
       Source=""
       StackTrace:
            at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.ReplaceConnection(Object oldConnection, Object newConnection, Object parameterFields, Object crDBOptionUseDefault)
            at CrystalDecisions.CrystalReports.Engine.Table.SetDataSource(Object val, Type type)
            at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)
       InnerException:

推荐答案

对我来说,此错误消息的重要部分是:

无效的负值



听起来你的Crystal Report在你的报告中期望一个正数值,但你传递的是负数。检查您的数据。如果您传递的数据不正确,请修复此问题。如果允许负值,则检查您的Crystal报表并确保它预期为负值。



- 更新 -

也可能是Crystal Report期望负值,但不是您发送的范围中的值。那么也许你发送的是一个非常大的负数?
To me, the important part of this error message is this:
Invalid negative value

It sounds like your Crystal Report is expecting a positive numeric value in your report but you are passing in a negative one. Check your data. If you're passing incorrect data, then fix that. If a negative value is allowed, then check your Crystal Report and make sure it is expecting negative values.

-- Update --
It could also be that the Crystal Report is expecting a negative value, but not one in the range that you have sent. So perhaps you are sending a very large negative number?


我的CR中只有一个来自本地数据集的数据表和一些文本对象没有任何负值错误的问题,因为没有公式或报告中的任何其他约束/复杂性结果错误是由于FirstLineIndent属性的负值导致它为正,错误已解决
There was only a datatable from local dataset and some text objects in my CR There was no question of a negative value error since there were no formula or any other constraint/complexity in the report Turns out the error was due to negative value of FirstLineIndent property On making it positive the error was solved


这篇关于Crystal报告错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆