We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Change in behaviour

Thread ID:

Created:

Updated:

Platform:

Replies:

40544 Feb 6,2006 03:43 PM UTC Mar 5,2018 11:25 AM UTC WinForms 6
loading
Tags: XlsIO
Stephen
Asked On February 6, 2006 03:43 PM UTC

When opening the attached workbook using the previous version of XlsIO (ExcelRW version 2.1.0.9), and displaying values in a grid, the values appeared exactly as they do in the Excel workbook. Now using version 4.1.0.50 (IRange.Text property), the grid displays formulae in column 1 (row 2 onwards) rather than cell values, and some of the date values have a different format that appears in the Excel workbook. Can you explain how I can read and display values so they appear the same in Excel ?

Workbook.zip

Stephen
Replied On February 6, 2006 04:05 PM UTC

Behaviour hasn''t changed since previous version, but would still like to know how to display values as they appear in Excel, rather than formulae (as is being displayed in the 1st column).

Ramu [Syncfusion]
Replied On February 7, 2006 04:19 PM UTC

Hi Stephen, you could read the formula computed value in the excel file using IRange.FormulaNumberValue property. Here is the sample that reads the exact data from excel and displays in grid.Please take a look at attached sample. Please let me know if you have any questions. ExcelToGrid Thanks for using Syncfusion Products. Thanks, Ramu.K

Stephen
Replied On February 11, 2006 12:42 PM UTC

It''s not quite that simple because the formula may return a string value or a date value, so you''d have to use FormulaStringValue and FormulaDateTime as well. The ideal would be if you could add a property (FormattedValue, say) to IRange, which would return the value, as displayed in Excel. Better still, if there could be an overloaded version of the Open method that reads in information necessary to be able to read formatted values, but not information just affecting appearance (font, cell width etc.)

Ramu [Syncfusion]
Replied On February 13, 2006 12:06 PM UTC

Hi Stephen, Here is another way of importing excel to grid. Gridconverter control is used to convert excel to grid and from grid to excel using ExcelToGrid() and GridToExcel(). Here is the sample program that converts excel to grid with exact data present in excel. Please take a look at the sample and let me know If you have any questions. ExceltoGridconverter Thanks for using Syncfusion Products. Thanks, Ramu.K

Joey Keeton
Replied On March 3, 2018 10:57 AM UTC

It''s not quite that simple because the formula may return a string value or a date value, so you''d have to use FormulaStringValue and FormulaDateTime as well. The ideal would be if you could add a property (FormattedValue, say) to IRange, which would return the value, as displayed in Excel. Better still, if there could be an overloaded version of the Open method that reads in information necessary to be able to read formatted values, but not information just affecting appearance (font, cell width etc.)

hi


Abirami Varadharajan [Syncfusion]
Replied On March 5, 2018 11:25 AM UTC

Hi Joey, 
 
Thank you for contacting Syncfusion support. 
 
We request you to make use of ‘DisplayText’ property which returns the cell value as a string with number formats applied. (i.e., it returns the value as you see in cells of Microsoft Excel). 
 
It is recommended to invoke EnableSheetCalculations method of worksheet class to calculate formulas if found. Without this line, cells with formula will not return calculated value.  
 
Code Snippet: 
worksheet.EnableSheetCalculations();  
  
Kindly refer the below API reference to know more about DisplayText property.  
  
  
Please let us know if you have any concerns. 
 
Regards, 
Abirami. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;