Welcome! Log In Create A New Profile

Advanced

Re: how to import excel data into hyper file

Posted by Goof.pcs.crosspost 
Goof.pcs.crosspost
Re: how to import excel data into hyper file
May 04, 2009 06:12PM
Muhammad Usman a écrit :
> Thanks for reply Goof. can you give some kind of example related to import data excel to hyper file with validations.
>
>
is interactive validation.
It could be more smart to import data from the xls file into a table
with a check box on the first column, then let the user (un)check or
modify the wrong values. (you could also check the box only on lines
with correct values, according to the database integrity or related files.)
This should be more or less like that.


sFile is string = fSelect("", "", "Select a file ...",
"XLS"+TAB+"*.XLS"+CR+"All files (*.*)"+TAB+"*.*", "XLS", fselOpen+fselExist)
ifXls is int
i is int
IF sFile ="" THEN RETURN
ifXls = xlsOpen(sFile)

IF ifXls = -1 THEN
Info(xlsMsgError(ifXls))
RETURN
END

IF YesNo(Yes,"Import the file ?") = No THEN RETURN

FOR i = 1 TO 200
HReset(table)
table.rub1 = xlsData(ifXls,i,1)
table.rub2 = xlsData(ifXls,i,2)
table.rub3 = xlsData(ifXls,i,3)
table.rub4 = xlsData(ifXls,i,4)
table.rub5 = xlsData(ifXls,i,5)
table.rub6 = xlsData(ifXls,i,6)
IF YesNo(No,"Do you want to import the data '"+table.rub1+"' ?") =
Yes THEN
HAdd(table)
ELSE
IF YesNo(No,"Do you wish to stop the import of data ?") = Yes
THEN RETURN
END
END
Message forwarded from pcsoft.us.windev
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: