Hi all,
In my Grid i need to have fileupload option in each row.and when i upload file in each row i have to upload along with corresponding rowno
so i decided to use either free form layout or custom control.
my first try with free form layout giving trouble with script
here's my code:
<html><head><title></title>
<link rel="stylesheet" type="text/css" href="file:///C:\Program Files\a5v9/css/ModernModified/style.css ">
<%a5
dim msg as c
if eval_valid("cmd")
dim fn as c
fn = "C:\A5Webroot\CustomerReport\\" + FileToUpload.filename
file.from_blob(fn, FileToUpload.data)
end if
%>
</head>
<body class="ModernModifiedPageBODY">
{remarks}
<form action=" <%a5 ? request.script_name %> " method="post" enctype="multipart/form-data">
<input type="file" name="FileToUpload" style="WIDTH: 342px; HEIGHT: 22px" size=28><br>
<input type="submit" name="cmd" value="Upload Cust Visit Report" style="WIDTH: 182px; HEIGHT: 24px" size=16>
</form>
</body>
when i write xbasic code in <head> </head> my xbasic code automatically getting deleted,not only here i tried in so many controls by giving reference to script file or completely writing script in HEAD tag is getting deleted automatically.
My try with custom control giving trouble with rownum
Here's my code :
LogicalRecNo__render = <<%html%
<head>
<%a5
dim msg as c
if eval_valid("cmd")
dim fn as c
fn = "C:\A5Webroot\CustomerReport\\" + Data.recno + FileToUpload.filename
file.from_blob(fn, FileToUpload.data)
msg = "<a href=\customerreport\"/" + Data.recno + FileToUpload.filename + "\" target=\"_blank\">" + FileToUpload.filename + "</a> was uploaded<br /><br />"
end if
%>
<%a5 ? msg %>
</head>
<form action=" <%a5 ? request.script_name %> " method="post" enctype="multipart/form-data">
<input type="file" name="FileToUpload" style="WIDTH: 342px; HEIGHT: 22px" size=28><br>
<input type="submit" name="cmd" value="Upload Cust Visit Report" style="WIDTH: 182px; HEIGHT: 24px" size=16>
</form>
%html%
end 'do not delete this line
LogicalRecNo__xbasicError:
This method also failed becuase when my grid has 10 records, here fn = "C:\A5Webroot\CustomerReport\\" + Data.recno + FileToUpload.filename
Data.recno always take my 10th record value for all the rows while uploading which suppose to take corrsponding recno
Any other way to achieve this?
In my Grid i need to have fileupload option in each row.and when i upload file in each row i have to upload along with corresponding rowno
so i decided to use either free form layout or custom control.
my first try with free form layout giving trouble with script
here's my code:
<html><head><title></title>
<link rel="stylesheet" type="text/css" href="file:///C:\Program Files\a5v9/css/ModernModified/style.css ">
<%a5
dim msg as c
if eval_valid("cmd")
dim fn as c
fn = "C:\A5Webroot\CustomerReport\\" + FileToUpload.filename
file.from_blob(fn, FileToUpload.data)
end if
%>
</head>
<body class="ModernModifiedPageBODY">
{remarks}
<form action=" <%a5 ? request.script_name %> " method="post" enctype="multipart/form-data">
<input type="file" name="FileToUpload" style="WIDTH: 342px; HEIGHT: 22px" size=28><br>
<input type="submit" name="cmd" value="Upload Cust Visit Report" style="WIDTH: 182px; HEIGHT: 24px" size=16>
</form>
</body>
when i write xbasic code in <head> </head> my xbasic code automatically getting deleted,not only here i tried in so many controls by giving reference to script file or completely writing script in HEAD tag is getting deleted automatically.
My try with custom control giving trouble with rownum
Here's my code :
LogicalRecNo__render = <<%html%
<head>
<%a5
dim msg as c
if eval_valid("cmd")
dim fn as c
fn = "C:\A5Webroot\CustomerReport\\" + Data.recno + FileToUpload.filename
file.from_blob(fn, FileToUpload.data)
msg = "<a href=\customerreport\"/" + Data.recno + FileToUpload.filename + "\" target=\"_blank\">" + FileToUpload.filename + "</a> was uploaded<br /><br />"
end if
%>
<%a5 ? msg %>
</head>
<form action=" <%a5 ? request.script_name %> " method="post" enctype="multipart/form-data">
<input type="file" name="FileToUpload" style="WIDTH: 342px; HEIGHT: 22px" size=28><br>
<input type="submit" name="cmd" value="Upload Cust Visit Report" style="WIDTH: 182px; HEIGHT: 24px" size=16>
</form>
%html%
end 'do not delete this line
LogicalRecNo__xbasicError:
This method also failed becuase when my grid has 10 records, here fn = "C:\A5Webroot\CustomerReport\\" + Data.recno + FileToUpload.filename
Data.recno always take my 10th record value for all the rows while uploading which suppose to take corrsponding recno
Any other way to achieve this?
Comment