Integer Bug

Topics: Developer Forum
Sep 2, 2008 at 8:48 PM
Edited Sep 3, 2008 at 7:18 AM

first of all I want to say that ExcelPackage is very good and I like working with it.
However, I discovered a bug. The situation: I want to create a list of material. Each entry represents an article and consists of description, hyperlink and article number.

Example:    Resistor        XXX123

Now there was an article number of following style: 0122.2124893.0293.33. The Funtion IsNumericValue implemented in ExcelCell.cs declares this as a number. I think it is necessary to change the regular expression:

Regex objIntPattern = new Regex("^-[0-9,.]+$|^[0-9,.]+$");            // ExcelCell.cs, Function: IsNumericValue, Line: 440
Regex objIntPattern = new Regex("^-[0-9]+[,.]?[0-9]*$|^[0-9]+[,.]?[0-9]*$");

to ensure that there is only one comma or dot between a various count of numbers.
Jul 12, 2009 at 12:34 AM

I am having the same problem as of today. This is a fairly serious problem as being unable to specify the data type of a cell (which should be possible as the data type is a settable property) does not seem to function correctly (or I am just not entering the correct data type as the property is a string value and not an enumerated list as it should be). I want to insert a text value but a double decimal string is being considered a number ~ so in the instance there is a phone number formatted as 612.555.5555, this is being considered numeric and Excel is throwing an error upon opening.

Jul 12, 2009 at 12:36 AM

This same error would occur for anyone that has IP addresses within their data... there are lots of valid reasons for making this change.

Jul 16, 2009 at 11:28 PM

I am also having this problem with a long string of digits. I have container number string which can be upto 25 digits. This needs to be treated as a string.

One 12 character example of this error is:


 System.Xml.XPath.XPathException was unhandled by user code
  Message="'//d:si[d:t=' '694202203767']' has an invalid token."
       at MS.Internal.Xml.XPath.XPathParser.CheckToken(LexKind t)
       at MS.Internal.Xml.XPath.XPathParser.ParsePredicate(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseStep(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseRelativeLocationPath(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseLocationPath(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParsePathExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseUnionExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseUnaryExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseMultiplicativeExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseAdditiveExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseRelationalExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseEqualityExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseAndExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseOrExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseXPathExpresion(String xpathExpresion)
       at MS.Internal.Xml.XPath.QueryBuilder.Build(String query, Boolean allowVar, Boolean allowKey)
       at MS.Internal.Xml.XPath.QueryBuilder.Build(String query, Boolean& needContext)
       at System.Xml.XPath.XPathExpression.Compile(String xpath, IXmlNamespaceResolver nsResolver)
       at System.Xml.XPath.XPathNavigator.Compile(String xpath)
       at System.Xml.XmlNode.SelectSingleNode(String xpath, XmlNamespaceManager nsmgr)
       at OfficeOpenXml.ExcelCell.SetSharedString(String Value)
       at OfficeOpenXml.ExcelCell.set_Value(String value)
       at ApplauseSource.AS_Reports.ExportDetail_Excel(DataSet dsSurveyDetail, String sTitle, HyperLink lnkLinkToUse, String sLinkTitle) in D:\inetpub\wwwroot\ApplauseSource\AS_Reports.aspx.vb:line 1348
       at ApplauseSource.AS_Reports.BuildReport_OpenOrders(DateTime dReportDate) in D:\inetpub\wwwroot\ApplauseSource\AS_Reports.aspx.vb:line 801
       at ApplauseSource.AS_Reports.ReportNow(String sReportName, String sReportStatus, DateTime dReportDate) in D:\inetpub\wwwroot\ApplauseSource\AS_Reports.aspx.vb:line 456
       at ApplauseSource.AS_Reports.Page_Load(Object sender, EventArgs e) in D:\inetpub\wwwroot\ApplauseSource\AS_Reports.aspx.vb:line 375
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)