Free Support Forum - aspose.com

SmartMarkers Not Working with Integral DataTypes

I have a template employing SmartMarkers and so far it’s working with importing string and double data types, just not with integral types. Whenever I put a marker in the template for an integral column I get a NullReferenceException. The stack trace is below:

<br />Object reference not set to an instance of an object.<br /> at Aspose.Excel.Cell.get_StringValue()<br /> at Aspose.Excel.Cell.PutValue(Int32 intValue)<br /> at Aspose.Excel.Cell.PutValue(Object objectValue)<br /> at Aspose.Excel.Cells.ImportObjectArray(Object[] objArray, Int32 firstRow, Byte firstColumn, Boolean isVertical, Int32 skip)<br /> at Aspose.Excel.ExcelDesigner.a(Worksheet A_0, Cell A_1, Int32 A_2, Boolean A_3)<br /> at Aspose.Excel.ExcelDesigner.Process(Int32 sheetIndex, Boolean isPreserved)<br /> at Aspose.Excel.ExcelDesigner.Process(Boolean isPreserved)<br />
I’m filling a DataSet with a result from a stored procedure call to a Microsoft SQL server, its schema is below, so you can see the data types I’m importing into the designer object. I’m simply calling SetDataSource() with the DataSet object.
<br /><?xml version="1.0" encoding="utf-16"?><br /><xs:schema id="NewDataSet" xmlns="" xmlns:xs="<a class="linkification-ext" href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"><br /> <xs:element name="NewDataSet" msdata:IsDataSet="true"><br /> <xs:complexType><br /> <xs:choice maxOccurs="unbounded"><br /> <xs:element name="Facilities"><br /> <xs:complexType><br /> <xs:sequence><br /> <xs:element name="DivisionID" type="xs:int" minOccurs="0" /><br /> <xs:element name="DivisionName" type="xs:string" minOccurs="0" /><br /> <xs:element name="RegionID" type="xs:int" minOccurs="0" /><br /> <xs:element name="RegionName" type="xs:string" minOccurs="0" /><br /> <xs:element name="FacilityID" type="xs:int" minOccurs="0" /><br /> <xs:element name="PercentDoneOnTime" type="xs<img src="/forums/emoticons/emotion-2.gif" alt="Big Smile" />ecimal" minOccurs="0" /><br /> <xs:element name="PercentDoneLate" type="xs<img src="/forums/emoticons/emotion-2.gif" alt="Big Smile" />ecimal" minOccurs="0" /><br /> <xs:element name="PercentSkipped" type="xs<img src="/forums/emoticons/emotion-2.gif" alt="Big Smile" />ecimal" minOccurs="0" /><br /> <xs:element name="TasksCompleted" type="xs:int" minOccurs="0" /><br /> <xs:element name="TasksCompleted2" type="xs<img src="/forums/emoticons/emotion-2.gif" alt="Big Smile" />ouble" minOccurs="0" /><br /> <xs:element name="FollowupNote" type="xs:string" minOccurs="0" /><br /> <xs:element name="FollowupID" type="xs:int" minOccurs="0" /><br /> <xs:element name="FacilityName" type="xs:string" minOccurs="0" /><br /> <xs:element name="City" type="xs:string" minOccurs="0" /><br /> <xs:element name="State" type="xs:string" minOccurs="0" /><br /> <xs:element name="Tiny" type="xs:unsignedByte" minOccurs="0" /><br /> <xs:element name="Small" type="xs:short" minOccurs="0" /><br /> <xs:element name="Big" type="xs:int" minOccurs="0" /><br /> <xs:element name="Floaty" type="xs<img src="/forums/emoticons/emotion-2.gif" alt="Big Smile" />ecimal" minOccurs="0" /><br /> <xs:element name="SuperBig" type="xs:long" minOccurs="0" /><br /> </xs:sequence><br /> </xs:complexType><br /> </xs:element><br /> <xs:element name="Totals"><br /> <xs:complexType><br /> <xs:sequence><br /> <xs:element name="PercentDoneOnTime" type="xs<img src="/forums/emoticons/emotion-2.gif" alt="Big Smile" />ecimal" minOccurs="0" /><br /> <xs:element name="PercentDoneLate" type="xs<img src="/forums/emoticons/emotion-2.gif" alt="Big Smile" />ecimal" minOccurs="0" /><br /> <xs:element name="PercentSkipped" type="xs<img src="/forums/emoticons/emotion-2.gif" alt="Big Smile" />ecimal" minOccurs="0" /><br /> <xs:element name="TasksCompleted" type="xs:int" minOccurs="0" /><br /> </xs:sequence><br /> </xs:complexType><br /> </xs:element><br /> </xs:choice><br /> </xs:complexType><br /> </xs:element><br /></xs:schema><br />

I’m trying to import the “TasksCompleted” column using “&=Facilities.TasksCompleted”. I tried using some fake columns (see “Tiny” though “SuperBig” above) but they all gave the same error. As I said before, strings and doubles import just fine, why don’t my itegers work??

My designer file, DataSet schema and data, and the detailed page error are in here: ftp://ftp8yMwxR:bhD8vKq@ftp.directsupply.com/

Thanks for your help,
David Peters

Which version of Aspose.Excel are you using? I don’t find this problem in my machine.

Please download and try the latest hotfix at http://www.aspose.com/Products/Aspose.Excel/Fixes/Aspose.Excel.zip.

If the problem still occurs, could you please send me your template and sample code? Thank you very much.

Tried the newest version (2.8.8.5) and still get the error. This FTP directory has my entire test project: ftp://ftp8yMwxR:bhD8vKq@ftp.directsupply.com/SmartMarkerStuff/

The default.aspx.htm is a copy of the error page I’m getting.

Thanks for your help Laurence, it’s appreciated.

I cannot access your ftp site but I find this problem finally. It’s fixed and v2.8.8.6 can be downloaded at http://www.aspose.com/Products/Aspose.Excel/Fixes/Aspose.Excel.zip.

That did the trick! What in the hell was wrong, I’m suprised no one found that problem earlier.

By the way, what was the error w/ the FTP directory?

It always worked fine in previous version before mid of 2005/02. Since 2005/02, we did many internal optimization. I changed code while putting double values but forgot to change putting int values code. That introduces this tricky bug.

Thanks for your report.

Now I can access your ftp directory. It may be a connection problem while I acessed the site before.

I hope your forehead doesn’t hurt too much from smacking it! Big Smile

Thanks for the bugfix!