reading large texts from Excel
xavigepe
Member Posts: 185
Hello. I have an excel spreadsheet where one specific cell contains large text (more than 1024 characters). I'm trying to use excel buffer table and readsheet function to read this cell, but as it's more than 250 characters long, it returns an error. Does anybody know a solution for this?. I guess I could use streams or something like this, but I'm not very used to them and any help would be appreciated.
Thanks,
Thanks,
0
Comments
-
You can save the workbook in XML format and read worksheet from it.
Sample CodeName DataType Subtype Length XlWorkBook Automation Unknown Automation Server.Workbook xmlExcelBook Automation 'Microsoft XML, v3.0'.DOMDocument30 xmlSheetNode Automation 'Microsoft XML, v3.0'.IXMLDOMNode xmlSheetNodes Automation 'Microsoft XML, v3.0'.IXMLDOMNodeList xmlRowNode Automation 'Microsoft XML, v3.0'.IXMLDOMNode xmlRowNodes Automation 'Microsoft XML, v3.0'.IXMLDOMNodeList xmlCellNode Automation 'Microsoft XML, v3.0'.IXMLDOMNode xmlCellNodes Automation 'Microsoft XML, v3.0'.IXMLDOMNodeList i Integer j Integer k Integer XlWorkBook.SaveAs(lxmlFileName, 46); CREATE(xmlExcelBook); xmlExcelBook.load(lxmlFileName); xmlSheetNode:=xmlExcelBook.documentElement.selectSingleNode('./Worksheet[@ss:Name="' + lSheetName + '"]'); IF NOT ISCLEAR(xmlSheetNode) THEN BEGIN xmlRowNodes:=xmlSheetNode.selectNodes('./Table/Row'); FOR j:=0 TO xmlRowNodes.length-1 DO BEGIN xmlRowNode:=xmlRowNodes.item(j); xmlCellNodes:=xmlRowNode.selectNodes('./Cell'); FOR k:=0 TO xmlCellNodes.length-1 DO BEGIN xmlCellNode:=xmlCellNodes.item(k); ................................................. end; end;
XML Text Node ('Microsoft XML, v3.0'.IXMLDOMText) has SubstringData method, you can use it for reading large texts.Looking for part-time work.
Nav, T-SQL.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions