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. Image for the cookie policy date

about xlValidate

XLValidate.applyDVRules(range, values, type, required, showErrorAlert)

Please tell me how many validation conditionfor values
for example:"Greater","LessOrEqual","Between","list","GreaterOrEqual"
and more?or can i set to empty array.
Where can I find a note。

one more question,How to get to verify the results obtained after the user to edit cell,i want to get yes or no,and change the cell background color

5 Replies

SI Silambarasan I Syncfusion Team July 6, 2016 11:49 AM UTC

Hi Xycool, 
 
Thank you for using Syncfusion products. 
 
Query #1 “Please tell me how many validation condition for values for example: "Greater"…? or can i set to empty array.” 
 
Please refer the below table for available Data validation conditions based on data types in Spreadsheet. 
 
S.no 
Data Types 
Conditions 
1. 
Number 
“greater than” 
“greater or equal to” 
“less than” 
“less than or equal to” 
“equal to” 
“not equal to" 
“between” 
“not between” 
2. 
Decimal 
3. 
Date 
4. 
Time 
5. 
TextLength 
6. 
List 
-  
 
 
Note: values - field should be non-empty in XLValidate.applyDVRules(). You can also refer the Data Validation options which is placed under “DATA” tab.  
 
Query #2 “Where can I find a note?” 
 
Currently, we are working on help documentation for ejSpreadsheet and we will publish it in any of our upcoming Essential studio releases.  Meanwhile, please refer our online API document for ejSpreadsheet. 
 
 
Query #3 “How to get to verify the results obtained after the user to edit cell,i want to get yes or no,and change the cell background color” 
 
Before we start provide solution, we would like to know the following details, 
 
1. Using Data validation, we can highlight the validation failed (false) conditions values by using “Format Invalid Data” option under Data Validation in DATA tab or by using XLValidate.highlightInvalidData() method. Could you please conform whether your requirement about changing cell background color as it is same as in our highlight Invalid Data option?   
 
 
2. While save the edited cell, we can compare the previous cell value and modified cell value in ‘cellSave’ client-side event by using ‘pValue’ and ‘value’ property. Also, we have prepared a sample to demonstrate this in JS Playground. Could you please check the below sample and let us know whether using this event will fulfil your requirement? 
 
 
Could you please get back to us with the above information so that we can analyze based on that and provide you a better solution?  The information provided would be great help for us to proceed further.  
 
 
Regards, 
Silambarasan I 



XY xycool July 7, 2016 02:00 AM UTC

Thank you for your reply, I have solved my problem。

One more question,If i need to save the excel with asp.net MVC, i use 'excelUrl' and post to controller,

in controller,it's my code:

string sheetModel = Request.Params["sheetModel"], sheetData = Request.Params["sheetData"];
Stream getStream = Spreadsheet.Save(sheetModel, sheetData, ExportFormat.XLSX, ExcelVersion.Excel2013);
using (ExcelEngine excelEngine = new ExcelEngine())
{
    Syncfusion.XlsIO.IWorkbook workbook = excelEngine.Excel.Workbooks.Open(getStream );
}

But this throws an exception,how can i get IWorkbook frome ejSpreadsheet,I need to parse the validity of the user to edit data, thank you!


SI Silambarasan I Syncfusion Team July 7, 2016 10:56 AM UTC

Hi Xycool, 
 
Thanks for your update. 
 
We have checked the provided code snippets and we would like to suggest you to reset the stream position to zero, before passing it in Workbooks.Open() method to get the IWorkbook object.  Please refer the below modified code example. 
 
 
[AcceptVerbs(HttpVerbs.Post)] 
public void ExportToExcel() 
{ 
    string sheetModel = Request.Params["sheetModel"], sheetData = Request.Params["sheetData"]; 
    Stream getStream = Spreadsheet.Save(sheetModel, sheetData, ExportFormat.XLSX, ExcelVersion.Excel2013); 
 
    //Reset the stream position to zero. 
    getStream.Position = 0; 
 
    using (ExcelEngine excelEngine = new ExcelEngine()) 
    { 
        Syncfusion.XlsIO.IWorkbook workbook = excelEngine.Excel.Workbooks.Open(getStream); 
 
        //Your code here 
    } 
} 
 
 
 
For your convenience, we have prepared a sample to demonstrate this and the same can be downloaded from the below link, 
 
 
 
Regards, 
Silambarasan I 



XY xycool July 8, 2016 02:56 AM UTC

Thank you for your answer,if i editing online, then i export the  ejSpreadsheet to IWorkbook,it's no problem,but when i upload my excels,and then export the ejSpreadsheet it's throw System.ArgumentOutOfRangeException,i user sample project throw System.ArgumentOutOfRangeException too, what's problem?Is my excel complicated?

Attached is my project need to upload excel。

Attachment: testExcel_a892e60f.rar


SI Silambarasan I Syncfusion Team July 8, 2016 12:42 PM UTC

Hi Xycool, 
 
Thanks for your update. 
 
While exporting the attached excel file, we have faced an exception “System.FormatException: Input string was not in a correct format” but we are unable to reproduce the reported exception “System.ArgumentOutOfRangeException”.  However, we considered this as an issue and a support incident has been created under your account to track the status of this requirement.  Please log on to our support website to check for further updates. 
 
 
 
Regards, 
Silambarasan I 


Loader.
Up arrow icon