NetTalk Central

Author Topic: Data Download Advice  (Read 3683 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Data Download Advice
« on: May 02, 2009, 06:19:31 AM »
Hi,
I need to replace the functionality of an ASP site.
It has a simple browse and a link with which the user obtains the Excel file of the browse records.
I´ve done it by making an excel file with the Softmasters free template, but it takes too long compared with the ASP site which is almost inmediate.
How can I achive the same ASP speed?
Thanks
Alberto
-----------
Regards
Alberto

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Data Download Advice
« Reply #1 on: May 02, 2009, 11:51:46 PM »
Hi Alberto,

I think Capesoft's Office Inside miight be a solution here.

Rene Simons
Rene Simons
NT14.14

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: Data Download Advice
« Reply #2 on: May 03, 2009, 02:31:53 AM »
Hi Alberto,

In ASP they will be rendering the results directly from SQL into CSV and pumping it down into the browser as if it were a simple HTML page.

You could do this easily in a NetWebPage (with a pagename extension of .CSV so the receiving browser could decide what to do with it) procedure that generates each line of CSV and transmits it using:


packet = clip(packet) & CLIP(Field1) &',' & CLIP(Field2) & CRLF
do sendpacket


This way will be fast as no temp files are created, but you'll need to hook into the browsers filter property so you can match what was displayed in the NetWebBrowse procedure.

There are lots of simple tricks with CSV like wrapping text values in double quotes and stripping other double quotes etc.

Regards
Bill Shields

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Data Download Advice
« Reply #3 on: May 03, 2009, 10:39:13 PM »
Hi Alberto,

yes, one way is to make a CSV file.

There are fundamentally 3 ways to make "excel" files. The first, and quickest, is to make a CSV export from your app. This is easy enough to do in clarion using the ASCII, Basic or DOS file drivers. Or, as Bill suggests, use the View generated by the browse (although that is a tad more complex.)

CSV is really fast, but you can only export data - no formatting. An alternative is to use a tool that "creates" excel files directly. There is a product by Klarisoft that lets you do this, although I've not used it directly myself.

The 3rd option is to use Excel to create the Excel file. This is the slowest (because Excel is slow) but also the most feature rich because you can do anything Excel can do. This is the approach you're currently taking using Softmasters - and Office Inside _may_ be an improvement, but ultimately it's bound by the speed of Excel.

Cheers
Bruce