Re: how to import excel data into hyper file

Startbeitrag von Goof.pcs.crosspost am 04.05.2009 16:12

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

Antworten:

Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.