Solved

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

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 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