Solved

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

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

Technology Partners: 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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

713 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