电脑维修第一互动门户_www.PC106.com 为了方便您再次访问电脑维修站,请点击收藏本站!设为首页
操作系统 · 硬件学院 · 软件学院 · 网络学院 · DIY 经验 · 数据恢复 · 网站技术 · 维修网点 · IT 黄 页 · 大师答疑
故障症状 · 电脑优化 · 病毒快报 · 黑客安全 · 维修宝典 · 电脑保养 · 服 务 器 · 在线杀毒 · 在线电视 · 网址服务
维修 CPU·主板·硬盘·内存·显卡·显示器·键盘鼠标·声卡音箱·软驱光驱·打印机·机箱电源·BIOS·网卡·局域网·浏览器
您现在的位置: 电脑维修 >> 网站技术 >> ASP技术 >> ASP技巧 >> 网站技术正文
一篇关于客户端用ASP+rds+VBA参生报表的好东东(高级篇)
作者:佚名 文章来源:不详 点击数: 更新时间:2007-2-14 14:58:01

            .range("C"+trim(RowCnt)+":"+"D"+trim(RowCnt)).merge    
       end with
       RowCnt=RowCnt+1
       HeadRow=HeadRow+1
    loop
    
    'Format the head name of cells (The new page of row=5,6,7)
      
    With xlSheet1
        .Cells(RowCnt-3, 2).Value = "THE JOB INFORMATION TABLE"
        .Cells(RowCnt-3, 3).Value = date()
        .Cells(RowCnt-4, 3).Value = "The "+trim(PageNo)+"/"+trim(TotalPageCnt) +" Pages"
    end with
    'Format the title field name of cells
    With xlSheet1
        .range("A"+trim(RowCnt)  +":B"+trim(RowCnt)).merge           
        .range("A"+trim(RowCnt+1)  +":A"+trim(RowCnt+2)).merge    
        .range("B"+trim(RowCnt+1)  +":B"+trim(RowCnt+2)).merge    
        
        .range("C"+trim(RowCnt)  +":D"+trim(RowCnt)).merge
        .range("C"+trim(RowCnt+1)  +":C"+trim(RowCnt+2)).merge    
        .range("D"+trim(RowCnt+1)  +":D"+trim(RowCnt+2)).merge                  
  
        .Cells(RowCnt,  1).Value = "The job"
        .Cells(RowCnt+1,1).Value = "job_id"
        .Cells(RowCnt+1,2).Value = "job_desc"
        .Cells(RowCnt,  3).Value = "Level"
        .Cells(RowCnt+1,3).Value = "Max level"
        .Cells(RowCnt+1,4).Value = "Min level"
   End With
   RowCnt=int(RowCnt)+3
   PageNo=PageNo+1
end sub

sub foot_title()
    dim FootRow
    FootRow=1
    do while FootRow<= FootRowCnt
       With xlSheet1
            .range("C"+trim(RowCnt)+":"+"D"+trim(RowCnt)).merge    
       end with
       RowCnt=RowCnt+1
       FootRow=FootRow+1
    loop
    With xlSheet1
        .Cells(RowCnt-1, 1).Value = "A:"
        .Cells(RowCnt-1, 2).Value = "B:"
        .Cells(RowCnt-1, 3).Value = "C:"
    end with
end sub

sub format_grid()
dim strCode
dim MyMacro
strCode = _
"sub MyMacro() " & vbCr & _  
"dim HeadRowCnt" & vbCr & _  
"dim TitleRowCnt" & vbCr & _  
"dim ContentRowCnt" & vbCr & _  
"dim FootRowCnt" & vbCr & _  
"dim PageRowCnt" & vbCr & _  
"dim BgnCnt" & vbCr & _  
"HeadRowCnt="& HeadRowCnt &"" & vbCr & _
"TitleRowCnt="& TitleRowCnt &"" & vbCr & _
"ContentRowCnt="& ContentRowCnt &"" & vbCr & _
"FootRowCnt="& FootRowCnt &"" & vbCr & _
"PageRowCnt=HeadRowCnt+TitleRowCnt+ContentRowCnt+FootRowCnt" & vbCr & _
"BgnCnt=1" & vbCr & _  
"PageNo=1" & vbCr & _
"Range(""A""+trim(BgnCnt)+"":D""+trim(BgnCnt)).Select" & vbCr & _
"With sheet1" & vbCr & _
"    .Range(""A1"").ColumnWidth = "& ColumnAWidth&"" & vbCr & _
"    .Range(""B1"").ColumnWidth = "& ColumnBWidth&"" & vbCr & _
"    .Range(""C1"").ColumnWidth = "& ColumnCWidth&"" & vbCr & _
"    .Range(""D1"").ColumnWidth = "& ColumnDWidth&"" & vbCr & _
"End With" & vbCr & _          
"do while PageNo<= "& TotalPageCnt&"" & vbCr & _
   "if PageNo= "& TotalPageCnt& " then" & vbCr & _   
   "   ContentRowCnt="& ContentRowNowCnt &"" & vbCr & _
   "   PageRowCnt=HeadRowCnt+TitleRowCnt+ContentRowCnt+FootRowCnt" & vbCr & _      
   "end if" & vbCr & _   
   "Range(""A""+trim(BgnCnt)+"":D""+trim(BgnCnt+PageRowCnt-1)).Select" & vbCr & _
   "With Range(""A""+trim(BgnCnt)+"":D""+trim(BgnCnt+PageRowCnt-1))" & vbCr & _
   "    .Borders.LineStyle = xlContnuous" & vbCr & _
   "    .Borders.Weight = xlThin" & vbCr & _
   "    .Borders.ColorIndex = 10" & vbCr & _
   "    .RowHeight = 15" & vbCr & _
   "    .VerticalAlignment = xlCenter" & vbCr & _
   "    .HorizontalAlignment = xlLeft" & vbCr & _
   "    .Font.Size = 9" & vbCr & _
   "End With" & vbCr & _    
   "With Range(""A""+trim(BgnCnt)+"":D""+trim(BgnCnt+HeadRowCnt-1))" & vbCr & _
   "    .Font.Size = 11" & vbCr & _
   "    .Font.Bold = True" & vbCr & _
   "    .Borders.LineStyle = xlLineStyleNone" & vbCr & _
   "    .VerticalAlignment = xlCenter" & vbCr & _
   "    .HorizontalAlignment = xlCenter" & vbCr & _
   "    .Orientation = xlHorizontal" & vbCr & _
   "End With" & vbCr & _
   "With Range(""A""+trim(BgnCnt+HeadRowCnt)+"":D""+trim(BgnCnt+HeadRowCnt+TitleRowCnt-1))" & vbCr & _
   "    .WrapText = True" & vbCr & _
   "    .Font.Size = 9" & vbCr & _
   "    .Font.Bold = True" & vbCr & _
   "    .VerticalAlignment = xlCenter" & vbCr & _
   "    .HorizontalAlignment = xlCenter" & vbCr & _
   "    .Orientation = xlHorizontal" & vbCr & _
   "end With" & vbCr & _
   "With Range(""A""+trim(BgnCnt+HeadRowCnt+TitleRowCnt+ContentRowCnt)+"":D""+trim(BgnCnt+HeadRowCnt+TitleRowCnt+ContentRowCnt+FootRowCnt-1))" & vbCr & _
   "    .Font.Size = 9" & vbCr & _
   "    .Font.Bold = True" & vbCr & _
   "    .Borders.LineStyle = xlLineStyleNone" & vbCr & _
   "    .VerticalAlignment = xlCenter" & vbCr & _
   "    .HorizontalAlignment = xlLeft" & vbCr & _
   "    .Orientation = xlHorizontal" & vbCr & _
   "end With" & vbCr & _   
   "PageNo=PageNo+1" & vbCr & _
   "BgnCnt=BgnCnt+PageRowCnt" & vbCr & _
"loop" & vbCr & _   
"With Sheet1.PageSetup" & vbCr & _   
"       .HeaderMargin = application.CentimetersToPoints(0)" & vbCr & _   
"       .LeftMargin = application.CentimetersToPoints(2)" & vbCr &

上一页  [1] [2] [3] 下一页

上网速度更快更爽、更安全下载使用Firefox火狐浏览器

网站技术录入:admin    责任编辑:admin 
  • 上一篇网站技术:

  • 下一篇网站技术:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

     IT图片报道

    14万元天价!640GB闪存硬盘美国问

    双核独显19寸液晶惠普PC机只卖49

    佳能MP160售价仅580元

    神舟双核液晶电脑3999起
     IT热点报道

    普通IT报道 中国电信称三年内实现光纤到户
    普通IT报道 广达个人电脑宣布已开始在江苏投入量产
    普通IT报道 14万元天价!640GB闪存硬盘美国问世
    普通IT报道 节后病毒猖獗系统瘫痪
    普通IT报道 AMD推出6款节能处理器
    推荐IT报道 双核独显19寸液晶惠普PC机只卖4999元
    普通IT报道 微软无奈下调Vista销售预期 XP仍是主角
    普通IT报道 佳能MP160售价仅580元
    推荐IT报道 神舟双核液晶电脑3999起
    推荐IT报道 4999元玩Vista 七喜12寸轻薄本升级
    关于公司 | 免责声明 | 广告服务 | 招贤纳士 | 联系我们 | 友情链接 1 2 3
    Copyright©2005 - 2007  http://www.PC106.com  All Right Reserved   
    桂ICP备06015569号