Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

請問 如何將 byte[] 直接讓使用者下載?

4 views
Skip to first unread message

Franma

unread,
Mar 13, 2007, 5:05:12 AM3/13/07
to
請問

小弟在實作 Reporting Service 因權限關係,改採用 WS 的方式呈現。

其中匯出成 Excel 的功能,是轉成 Btye[] 但小弟不想要直接存在 伺服器中。

請問一下,是否能直接轉換成資料流讓使用者下載??

謝謝

璉璉

unread,
Mar 13, 2007, 7:39:57 AM3/13/07
to
Web Service 函數宣告為 As Byte()

==> 本文由 "Franma <Fra...@discussions.microsoft.com>"
> 於 news:8CDEC0D3-9BE1-42BC-AB31-DEB11DB1CB7E%40microsoft.com 發表

--
風禹科技驗證有限公司 ASP.NET Web News Reader 0.2.6 UTF-8 Beta
網站地圖 http://tlcheng.twbbs.org/wwwmap.htm
流域防洪/區域水資源/徐昇網/玫瑰圖/語音通訊 文章與程式
Basic/Fortran/Windows API/.Net/輔助說明檔 原始碼、文章與討論
微軟程式設計、系統管理使用新技術論壇討論區,網友回覆後即時簡訊、電子郵件通知:
MSDN: http://forums.microsoft.com/msdn-cht/default.aspx?siteid=14
TechNet: http://forums.microsoft.com/technet-cht/default.aspx?siteid=23
--
ASPNET News Reader http://tlcheng.twbbs.org/News/Reader.aspx
RSS 2.0 http://tlcheng.twbbs.org/News/rss2.aspx?Action=List&Newsgroup=microsoft.public.tw.dotnet.framework.ado

Franma

unread,
Mar 13, 2007, 10:10:13 PM3/13/07
to
謝謝回應!!

可能是小弟寫的不清楚 ,是 Reporting Service 本身就有提供 WS 可以供小弟呼叫,其回傳的type 就是 byte [] 。
而小弟是想要讓 aspx 頁面就可以讓 byte [] 直接可以當成檔案讓 client 下載。

昨天晚上已經找到方式了,改寫後經測試也可正常使用。

http://support.microsoft.com/default.aspx/kb/812406/zh-tw

其就是自行定義 Response.AddHeader 和 Content 的內容。

謝謝

"璉璉" 來函:

璉璉

unread,
Mar 14, 2007, 2:48:15 AM3/14/07
to
關於輸出 Excel 的部份,還可以看看這個:

鄭子璉,「簡易由網頁自動輸出 Office 文件」,RUN!PC,第 132 期,台北,第 240 - 244 頁,民國 94 年 1 月。
http://tlcheng.twbbs.org/Paper/RunPC/132/Office.htm

==> 本文由 "Franma <Fra...@discussions.microsoft.com>"
> 於 news:99C34AF1-EA45-4AB6-8B6A-4214C75D94A2%40microsoft.com 發表

璉璉

unread,
Mar 14, 2007, 2:46:28 AM3/14/07
to
你先前的確沒寫到 aspx ,所以會搞混。

一樣的概念,我的作法:
http://tlcheng.twbbs.org/TLCheng/Net/NetList.aspx?Action=Function&Module=8&Function=43

==> 本文由 "Franma <Fra...@discussions.microsoft.com>"
> 於 news:99C34AF1-EA45-4AB6-8B6A-4214C75D94A2%40microsoft.com 發表

0 new messages