Solved

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

Posted on 2012-03-18
2
712 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 100

Accepted Solution

by:
mlmcc earned 500 total points
Comment Utility
Apparently Crystal is interpreting the field {WorkOrderHeader.ReverseFontFlag} as a number not a string

mlmcc
0
 

Author Closing Comment

by:mbarazi
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now