基于office interop的自定义报表系统
来源:互联网 发布:淘宝贷款客服电话 编辑:程序博客网 时间:2024/06/05 19:37
老曹是个老计算机手了。与他共同研究的报表系统雏形终于编制成功了
请看
报表定义
字段定义
字段添加
- public void AddField(string caption, int reportid, bool isCombo, ArrayList infoset, ArrayList column,
- ArrayList dispNull, ArrayList dispMulti, ArrayList dispAll, ArrayList dispWhich,
- ArrayList orderby, ArrayList asc, string cond, string conditionControlStatus)
- {
- DBAccess dbaccess = new DBAccess(DBAccess.DBType.SQL);
- dbaccess.Exe("insert into reportfield(reportid,iscombo) values(", reportid, isCombo, ")");
- long reportfieldid = dbaccess.getIdentity();
- reportDoc.AddFieldOnSelect(caption,(int)reportfieldid);
- for (int i = 0; i < infoset.Count; i++)
- {
- dbaccess.Exe(
- "insert into reportfieldcolumn(reportfieldid,infoset,column_,dispnull,dispmulti,dispAll,dispwhich,orderby,asc_desc,condition,clausecontrol) values(",
- reportfieldid, infoset[i], column[i], dispNull[0], dispMulti[0], dispAll[0], dispWhich[0],
- orderby[0], asc[0], cond,conditionControlStatus,")");
- }
- dbaccess.Close();
- }
reportDoc.AddFieldOnSelect使用了bridge模式,分离word/excel实现
excel的
- public void AddFieldOnSelect(string caption, int id)
- {
- setCell(2, eApp.ActiveCell.Column, caption);
- setCell(3, eApp.ActiveCell.Column, id.ToString());
- }
word的复杂点
- public void AddFieldOnSelect( string caption, int id)
- {
- Word.Selection sln = eApp.Selection;
- eApp.Options.Overtype = false;
- Word.Document WordDoc = null;
- Object N = Type.Missing;
- WordDoc = (Word.Document)webBrowser.Document;
- Object Type1 = WdFieldType.wdFieldMacroButton;
- object pos = sln.Start;
- object pos2 = sln.End;
- Word.Range rng = WordDoc.Range(ref pos, ref pos2);
- Word.Field Field1 = WordDoc.Fields.Add(rng, ref Type1, ref N, ref N);
- Field1.Code.Text = "MACROBUTTON " + "field_ganbureport_" + id + " " + caption;
- }
- 基于office interop的自定义报表系统
- 系统找不到 Microsoft.Office.Interop.Word ---解决方案
- window2008 64位系统无法调用Microsoft.Office.Interop组件进行文件另存的解决办法
- 引用Microsoft.Office.Interop.Excel的解决方法
- Microsoft.Office.Interop.Excel的用法
- Microsoft.Office.Interop.Excel的用法
- Microsoft.Office.Interop.Excel的用法
- Microsoft.Office.Interop.Excel的用法
- crm创建基于fetch的自定义报表
- 基于报表系统的的企业数据管理
- Imports Microsoft.Office.Interop
- 基于水晶报表的统一报表系统设计
- 关于引用Microsoft.Office.Interop.Excel的问题的解决方法
- Microsoft.Office.Interop.Excel 打开的Excel进程的关闭
- C# Office编程——Word 错误类型:“系统找不到 Microsoft.Office.Interop.Word"
- Office 2003 主 Interop 程序集的安装和使用
- Office 2003 主 Interop 程序集的安装和使用
- 引用Microsoft.Office.Interop.Excel出现的问题
- imp,exp提示ORA-12154: TNS:could not resolve the connect identifier specified
- EJB注释-1(EJB学习笔记)
- 文件目录操作函数
- DataBinder.Eval有关
- Ajax自动验证设置焦点与密码值丢失解决
- 基于office interop的自定义报表系统
- 一些免费的网络硬盘
- 嵌入式开发计划1 - linux学习
- 全面理解javascript的caller,callee,call,apply
- 申报项目
- sina不能上传PNG格式的图片
- C# 下的HTTP断点续传
- 【深度完美精简版 5.10】 Deepin-LiteXP-5.10
- Google Earth KML中文说明