Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2012-03-18
2
Medium Priority
?
746 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
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

886 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