Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DataSet vs XML causes CrystalDecisions.CrystalReports.Engine.FormulaException error kind number is required here

Posted on 2012-03-18
2
Medium Priority
?
740 Views
Last Modified: 2012-06-27
hi,

Could someone please explain to me why this is happening. I have a windows service that is written in vs2010 using .net 4.0 FULL and the reports are CR2008 but I have the CR for VS2010 installed to make that work.

 ReportDataSet.WriteXml("C:\outputXMLInsert.xml")
 Dim dsSecond As New DataSet
 dsSecond.ReadXml("C:\outputXMLInsert.xml")
 Report.SetDataSource(dsSecond)

in the above four lines of code I basically write out an XML from a dataset
then I read the XML back into a new data set and set that dataset as the source for the report.
Here is why I am showing you this. The above works but I just wanted to write the XML so I can build my report off the XML schema. So I went ahead and put the following line of code in when I was ready to test.

Report.SetDataSource(ReportDataSet)

All of the sudden I would get the following error, I know the forumula is correct because when I write the XML file back to a dataset and use that as source, everything works.  Could the dataset be different when it goes through an XML reader even though it's the same DS?  --->



CrystalDecisions.CrystalReports.Engine.FormulaException was caught
  Message=A number is required here.
Details: errorKind
Error in File SPTInsert8.5x11NewFormat {406FA090-2D52-4272-AB62-01EDEB22B2AB}.rpt:
Error in formula  ExpDateLbl:
'If{WorkOrderHeader.ReverseFontFlag}="1" Then
'
A number is required here.
Details: errorKind
  Source=CrystalDecisions.ReportAppServer.DataSetConversion
  StackTrace:
       at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
       at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.Export(ExportOptions options)
       at InsertPrintWorkOrder.Report.OutputNewReport(Int32 intCompany, String strWorkOrderID, Int64 lngQty, String strInsertColor, String ReportDefaultQueue) in C:\InsertSystemUpgradeVS2010\ImportPrint\Report.vb:line 134
  InnerException: System.Runtime.InteropServices.COMException
       ErrorCode=-2147217383
       Message=A number is required here.
Details: errorKind
Error in File SPTInsert8.5x11NewFormat {406FA090-2D52-4272-AB62-01EDEB22B2AB}.rpt:
Error in formula  ExpDateLbl:
'If{WorkOrderHeader.ReverseFontFlag}="1" Then
'
A number is required here.
Details: errorKind
       Source=""
       StackTrace:
            at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
            at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
       InnerException:
0
Comment
Question by:mbarazi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 1500 total points
ID: 37735256
Apparently Crystal is interpreting the field {WorkOrderHeader.ReverseFontFlag} as a number not a string

mlmcc
0
 

Author Closing Comment

by:mbarazi
ID: 37742350
You are correct it seems that I created the XML file of the Dataset and didn't realize that the datatype for that field inside the dataset is converted to a string when you write out an XML out of the dataset. I went back and converted the Dataset int data field to a string and now it's working just fine.

Thanks,
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question