惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

博客园 - 赵国亮

诚聘:网站高级程序员 诚聘:网站高级程序员 RSS2.0规范(转) 一则深有寓意的故事! 心情不爽,贴几张以前工作的照片 有效沟通,让程序员不再是兔子! 工作一年 离开公司... VB.NET验证码生成代码 - 赵国亮 - 博客园 ASP与ASP.NET互通COOKIES的一点经验 面向对象设计需要遵循的一些基本原则 数据结构学习笔记 在DataGrid中实现无刷新编辑列的代码(VB.NET 2003) 在DataGrid中实现鼠标指定列特殊显示的代码(VB.NET 2003) 实现向指定Url提交信息并取得返回信息 - 赵国亮 - 博客园 在不同的文本框回车触发指定按钮代码 - 赵国亮 - 博客园 页面选项卡代码 - 赵国亮 - 博客园 图片文件上传入SQL库及显示代码 - 赵国亮 - 博客园 一个比较帅的页面加载效果! - 赵国亮 - 博客园
ASP.NET大型OA中常用的一些报表生成,压缩,下载等操作代码
赵国亮 · 2006-06-16 · via 博客园 - 赵国亮

        一般来说,在一些大型OA中最常用,而且也比较难的部分莫过于一些报表生成,压缩,下载等操作了,下面我就将一些示例代码总结一下:

        通过Excel模板生成Excel报表代码:
        首先进行如下操作,以确保网络用户拥有创建报表的权限:Microsoft Excel 应用程序-》右键属性-》安全-》全部改为自定义加入.NET用户权限。
        Dim mClsExcel As New Reportforms.DataAccess.clsExcel
        Dim mFromPathFile As String
        Dim mToPathFile As String

        mFromPathFile = Server.MapPath("1.xls")
        mToPathFile = "2.xls"

        If File.Exists(mToPathFile) = True Then
            File.Delete(mToPathFile)
        End If
        File.Copy(mFromPathFile, mToPathFile)
        File.SetAttributes(mToPathFile, FileAttributes.Archive)

        Dim ds As DataSet = New DataSet

        mClsExcel.OpenFile(mToPathFile )
            Try
                ds = GetDate()
                mClsExcel.SelectSheet(1)
                mClsExcel.SetExcelCellValue("A", "1", "单位数量")
                mClsExcel.SetExcelCellValue("A", "2", "资料年份:" & SBDate)
                mClsExcel.SetExcelCellValue("A", "3", "填报单位:" & UnitName & "(" & UnitCode & ")")

                If mClsExcel.Addcenter(ds, "10", "C", 1) = True Then

                End If

                ds.Dispose()
                ds = Nothing

            Catch ex As Exception

            End Try
        mClsExcel.CloseFile()

         压缩报表代码:
        Shell(Server.MapPath("rar.exe") & " a -ep " & "1.rar" & " " & "", AppWinStyle.Hide, True)

        报表下载代码:
        System.Web.HttpContext.Current.Response.Redirect("1.rar")