Files Download

One way to deliver data to the user for offline use is via a download. In Tornado, you can provide direct and indirect download of Csv or Excel files. You can control which field to include in the download via an SQL query. For very large downloads (>400MB) that cause problem with binarywrite, you have the option to present the download as <A HREF...>. Direct download of physical files (".htm", ".html", ".doc", ".rtf", ".csv", ".xls", ".gif", ".jpg", ".jpeg", ".pdf", ".zip", ".xml", ".txt") can be done with a 'save' or 'open' option.  A dedicated MagicCell data masking can also apply to the download such that the raw data, display grid data and download data can be different. As you can see, there is lot more to binary writing the data to the browser.  These real life 'features' like majority of those in Tornado, is driven by our users over the past 5 years as that is what it takes for them to do their job.

Simple Download

<!--T_Download_1.aspx-->

<script language="vb" runat="server">
Sub Page_Load(Source as Object, E as EventArgs)
   Dim Dload1 As New Tornado.Z()
      With Dload1
      .dbQP="U=1| S=7| PS=10| D=nwind.mdb| Q=orders| ni=prev,next,download| gdf=0,1,2,3| downloadflds=0,1| Th=tit=Small Download (855 Records)"
      .ASPdbNET()
   End With
End Sub
</script>

In this 'Simple' download sample application, you only need one line of code to display 4 fields with a pagesize of 10 and download only 2 fields of the entire recordset.

Excel Download

<!--T_Download_2.aspx-->

<script language="vb" runat="server">
Sub Page_Load(Source as Object, E as EventArgs)
Dim XL As New Tornado.Z()
   XL.dbQP="U=28| M=Dh| S=13| PS=13| D=nwind.mdb| Q=Orders| df=0,1,2,3,4,5,6| Gdf=0| DownloadParams=excel=true| ni=b5,download| Th=Tit=Excel Download"
   XL.ASPdbNET()
End Sub
</script>

PDF Download

<!--T_Download_3.aspx-->

<script language="vb" runat="server">
Sub Page_Load(Source as Object, E as EventArgs)
Dim DL As New Tornado.Z()
   DL.ASPdbDownload("File=d:\tornadodemo\Intro.pdf| DownloadSave=False")

End Sub
</script>

PDF is just one of many direct download file formats. When DownloadSave is set to true, then the PDF file will not display on the browser and instead prompts for 'Save'. In many cases that would mean the pdf file can be downloaded without locking up the computer because PDF file requires filesize x 2 amount of memory to print.  This is just another 'business object' aspect of the Tornado tool in which many odds and ends are being covered so you can focus on the business logic instead. These odds and ends are a result of customer input for the pass 5 years.