Hi,
In a NetwebForm I create a link, calls a procedure that generates an Excel fil and shows a link to the user to download the file.
Below code is grabbed from one of the demo's (can't remember which one).
The Excel file is correctly created and placed in the ExcelFiles folder but the downloadlink is not working.
Between the webpage and the folder/filename is inserted the procedurename and a number of spaces like this:
http://webpage:88/ProcedureName%20%20%20%20%20%20%20%20ExcelFiles/97142171_varepriser.xlsWhat could be wrong in my code:
g:ExelFilename = clip(p_web.GSV('Kundenummer')) & '_varepriser.xls'
reportpage='\web\ExcelFiles\' & clip(g:ExelFilename)
reporturl=LongPath() & reportpage
p_web.SSV('reportlink','Click to open new Excel file.')
p_web.SSV('reporturl',CLIP(SUB(p_web.requestReferer, 1, INSTRING('IndexPage',p_web.requestReferer,1,1)-1) & 'ExcelFiles/' & clip(g:ExelFilename)))
if Exists(reporturl)
Remove(reporturl)
end
CreateExcelFile(p_Web, g:ExelFilename )
The ViewReport procedure that shows the link has this routine:
Guts Routine
packet.append(p_web.AsciiToUTF(|
'<<!-- Net:PageHeaderTag--><13,10>'&|
'<<h2 fontcolor="Navy">Done: Excel file created!<</h2><<p /> <<a href="<<!-- Net:s:reporturl-->"><<!-- Net:s:reportlink--><</a> <<p /><13,10>'&|
'<<a href="javascript:history.go(-1)">Back<</a><13,10>'&|
'<<!-- Net:PageFooterTag--><13,10>'&|
'',net:OnlyIfUTF,net:StoreAsAscii))
Cheers,
/Poul