Re: Can zip it before download?
From: ad (ad_at_wfes.tcc.edu.tw)
Date: 09/30/04
- Next message: Tomas PAJER: "bigger buffer corrupts file"
- Previous message: rfontaine: "RE: logon failure to a remote share with a virtual directory"
- In reply to: Mark Fitzpatrick: "Re: Can zip it before download?"
- Next in thread: Pete: "Re: Can zip it before download?"
- Reply: Pete: "Re: Can zip it before download?"
- Reply: AlexL [Xceed]: "Re: Can zip it before download?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 1 Oct 2004 04:48:39 +0800
Thanks,
I have download the shaprzip, it say that scharzip must be built with nant.
I download the source code of nant, but I don't know how to complie it(I
can't find any doc about it)
Can some one help me again?
"Mark Fitzpatrick" <markfitz@fitzme.com> ¼¶¼g©ó¶l¥ó·s»D
:OWeBLzvpEHA.3716@TK2MSFTNGP10.phx.gbl...
> You sure can, you just need another component to do it. Check out shaprzip
> (http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx). It
enables
> you to create a zip file and also to create and add files right into the
new
> zip. You can stream the new zip file to the browser just as you would an
> excel file. Of course your users will have to unzip the file before they
can
> open the excel file, but most users will rather have a smaller, faster
> download than be upset over having to open a zip file.
>
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP - FrontPage
>
> "ad" <ad@wfes.tcc.edu.tw> wrote in message
> news:e%23cnPVvpEHA.596@TK2MSFTNGP11.phx.gbl...
> >I use the code below to export the content of a data set to Excel, the
code
> > come form
> > http://www.dotnetjohn.com/articles.aspx?articleid=36
> >
> > It will take a long time to dolwnload if the excel file if too big.
> > How can I zip the excel file before download?
> >
>
> --------------------------------------------------------------------------
-- > > --------------- > > 'first let's clean up the response.object > > response.Clear() > > response.Charset = "" > > 'set the response mime type for excel > > response.ContentType = "application/vnd.ms-excel" > > 'create a string writer > > Dim stringWrite As New System.IO.StringWriter > > 'create an htmltextwriter which uses the stringwriter > > Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite) > > 'instantiate a datagrid > > Dim dg As New System.Web.UI.WebControls.DataGrid > > 'set the datagrid datasource to the dataset passed in > > dg.DataSource = ds.Tables(0) > > 'bind the datagrid > > dg.DataBind() > > 'tell the datagrid to render itself to our htmltextwriter > > dg.RenderControl(htmlWrite) > > 'all that's left is to output the html > > response.Write(stringWrite.ToString) > > response.End() > > > > > >
- Next message: Tomas PAJER: "bigger buffer corrupts file"
- Previous message: rfontaine: "RE: logon failure to a remote share with a virtual directory"
- In reply to: Mark Fitzpatrick: "Re: Can zip it before download?"
- Next in thread: Pete: "Re: Can zip it before download?"
- Reply: Pete: "Re: Can zip it before download?"
- Reply: AlexL [Xceed]: "Re: Can zip it before download?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|