Results 1 to 4 of 4
  1. #1
    Raghuraman K is offline Member
    Join Date
    May 2010
    Posts
    4
    Rep Power
    0

    Default Excel Sheet Validation

    Hi,

    I'm using an application, which uploads an excel file to the server. New Users generally download the excel sheet from my application(Excel sheet template -name,age,dept), and they fill in the data(from downloaded excel sheet - name,age,dept) and they upload the filled in excel sheet to the server.

    As a part of validation, i need to find out whether the user is uploading the correct excel sheet or not.
    excel sheet with 3 columns (name, age,dept). one way of identifying whether the user is uploading the correct excel sheet or not , is to read the columns ...if the uploaded excel sheet has 3 columns,(name , age, dept), then it is the correct excel sheet.


    is there any other way of doing this validation? can i set some version number in the downloaded excel sheet(i.e ) excel sheet downloaded by users)and then if the uploaded excel sheet has the same version number? if not , invalid excel sheet.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,997
    Rep Power
    19

    Default

    If you only have the three columns, and all you want to do is check if there are three columns, just give them headers (which ist sounds like you have done) and then check the headers match. That is grab the first row and cycle through cells 1-3 (or is it 0-2, I can never remember) ensuring they aren't null and they equal the header value.

    I'm not sure what else you want to ensure? If they're only allowed to upload the sheet they downloaded then you could stick a value in a second (hidden and password protected) sheet if you want, but that wouldn't prevent the user from doing whatever they wanted on the first sheet.

  3. #3
    Raghuraman K is offline Member
    Join Date
    May 2010
    Posts
    4
    Rep Power
    0

    Default

    hi,

    Thanks for your reply.

    1. i can check the columns,but its not 3, but 20, i dont want to check 20 columns one by one and decide, whether it is the correct template or not.

    Tomorrow, we might add one more columns, that make it 21. if the user is still using the old one(which has 20 columns), i dont want to read the header (21 columns) and decide whether it is the right one or not.

    what i'm looking for is, can i set some kind of attribute or hidden value in the xlsheet to decide whether it is the right one or not?

    is there a way to set a hidden value in any cell of excel sheet? or can i set any attritbue?

    the idea is set the hidden value in the downloded excel sheet, if the user is using the same excel sheet, then it will have the same value when uploaded, i'll decided based on that.

    any thoughts on my idea?

    Many thanks.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,997
    Rep Power
    19

    Default

    OK, I understand now.
    Use the thing I describe in the second paragraph.
    Have a field (a named field would be good, as they can be easier to find using POI/Jexcel) which contains the version number on its own sheet, and hide and password protect that sheet.

    As I say, though, this won't mean they haven't mucked about with the first sheet, but at least you'll know they downloaded the correct one.

Similar Threads

  1. SQL Query resultset into Excel Sheet
    By chandpuri in forum JDBC
    Replies: 8
    Last Post: 01-24-2011, 06:53 PM
  2. getter for filter in excel sheet
    By tamirm in forum Advanced Java
    Replies: 0
    Last Post: 07-18-2010, 11:01 AM
  3. How to create excel sheet?
    By kishan in forum Advanced Java
    Replies: 3
    Last Post: 07-13-2010, 01:15 PM
  4. How to read EXCEL Sheet using XML
    By raju.i in forum New To Java
    Replies: 1
    Last Post: 04-19-2010, 12:39 AM
  5. How to set the AutoFilter to Excel Sheet with Wither POI or JXL
    By lnarayana_boga in forum Advanced Java
    Replies: 0
    Last Post: 01-29-2008, 09:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •