123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using SysBaseLibs;
- using System.Web.UI.HtmlControls;
- namespace SysDataLibs
- {
- public class ReportPrintSet
- {
- public ReportPrintSet(string pcTableName)
- {
- if (pcTableName.Trim().Length > 0)
- {
- DBConnSql loDBConn = new DBConnSql();
- if (loDBConn.Open()&&loDBConn.IsOpened)
- {
- string lcSql = " select CodeValue,DisplayValue from SysStatus where TableName='" + pcTableName + "' and ColName='Report' ";
- rsQuery loQuery = loDBConn.OpenQuery(lcSql);
- if (loQuery != null && loQuery.IsOpened && loQuery.RecCount > 0)
- {
- if (loQuery.GoToRecordByFieldsAndValues("CodeValue", "显示字段"))
- {
- _Columns = new List<string>();
- _ColumnsDis = new List<string>();
- _ColumnsWidth = new List<string>();
- string lcColumns = loQuery.GetString("DisplayValue");
- Array loArr = UtilStr.StrToArray(lcColumns);
- if (loArr != null && loArr.Length >0)
- {
- foreach (string lcStr in loArr)
- {
- if (lcStr.Trim().Length > 0)
- {
- Array loCol = UtilStr.StrToArrayEx(lcStr, ":");
- if (loCol != null && loCol.Length == 3)
- {
- _Columns.Add(loCol.GetValue(0).ToString());
- _ColumnsDis.Add(loCol.GetValue(1).ToString());
- _ColumnsWidth.Add(loCol.GetValue(2).ToString());
- }
- }
- }
- }
- }
- if (loQuery.GoToRecordByFieldsAndValues("CodeValue", "第一页记录数"))
- {
- _FirstPageNum = loQuery.GetInt("DisplayValue");
- }
- if (loQuery.GoToRecordByFieldsAndValues("CodeValue", "其他页记录数"))
- {
- _OtherPageNum = loQuery.GetInt("DisplayValue");
- }
- if (loQuery.GoToRecordByFieldsAndValues("CodeValue", "每页都打印表头"))
- {
- _PrintHeader = loQuery.GetBool("DisplayValue");
- }
- }
- }
- loDBConn.Close();
- }
-
- }
- private List<string> _Columns = null;
- public List<string> Columns
- {
- get { return _Columns; }
- }
- private List<string> _ColumnsDis = null;
- public List<string> ColumnsDis
- {
- get { return _ColumnsDis; }
- }
- private List<string> _ColumnsWidth = null;
- public List<string> ColumnsWidth
- {
- get { return _ColumnsWidth; }
- }
- private int _FirstPageNum = 0;
- public int FirstPageNum
- {
- get { return _FirstPageNum; }
- }
- private int _OtherPageNum=0;
- public int OtherPageNum
- {
- get { return _OtherPageNum; }
- }
- private bool _PrintHeader = false;
- public bool PrintHeader
- {
- get { return _PrintHeader; }
- }
- //public void PrintReport(rsQuery loQuery
- }
- }
|