This topic is locked

Import Excel to Table

6/4/2010 9:09:16 AM
ASPRunnerPro General questions
W
wisdom2009 author

Hi,
Hope everyone is OK!!!
I have template that i am using to import data from excel to table using the import function and it is work good. Recently i had to add a header and legend in the template which missed up the import function, the header start from Row 1 to Row 13. how can i import only record starting Row 14.
Thank you

A
ann 6/4/2010

Hi,
use Before Insert Record event on the Events tab to check whether you want import (return true) or not(return false). Here is a sample:

if ($values["Field1"] && $values["Field2"] && ...)

return true;

else

return false;
W
wisdom2009 author 6/4/2010



Hi,
use Before Insert Record event on the Events tab to check whether you want import (return true) or not(return false). Here is a sample:

if ($values["Field1"] && $values["Field2"] && ...)

return true;

else

return false;



Hi Ann,
Thanks for your prompt response. i tried the below and i received the following error " Microsoft VBScript compilation error: Invalid character in line 1" when click on check syntax.
if ($values["sCustID"] && $values["sCustName"])

return true;

else

return false;
BeforeInsert=true

A
ann 6/4/2010

Hi,
it's my fault. Here is a correct code:

if not IsNull(values("Field1")) AND (not IsNull(values("Field2"))) AND ... then

BeforeInsert=true

else

BeforeInsert=false

end if



delete all code inside the function before insert.

W
wisdom2009 author 6/4/2010



Hi,
it's my fault. Here is a correct code:

if not IsNull(values("Field1")) AND (not IsNull(values("Field2"))) AND ... then

BeforeInsert=true

else

BeforeInsert=false

end if



delete all code inside the function before insert.


No luck, now i am receiving the error "Import didn't succed, couldn't find followind fields: F1, CustID, Transaction No, OAR Unique Trx ID, Case Number, Activity Number" it looks like it's reading the header and not from the field a selected.

A
ann 6/7/2010

Hi,
unfortunately, import function works in the way that first row in the imported file should be field names, then you can add header.