Ejemplo n.º 1
0
    //根据查询SQL,产生提供给报表生成需要的 或 JSON 数据,根据RecordsetQuerySQL获取报表明细数据,根据ParameterQuerySQL获取报表参数数据
    protected static void DoGenEntireData(System.Web.UI.Page DataPage, string RecordsetQuerySQL, string ParameterQuerySQL, ResponseDataType DataType, bool IsJSON)
    {
        OleDbConnection myConn = new OleDbConnection(OleDbConnStr);

        myConn.Open();

        OleDbDataAdapter myda = new OleDbDataAdapter(RecordsetQuerySQL, myConn);
        DataSet          myds = new DataSet();

        myda.Fill(myds);

        OleDbCommand    mycmd = new OleDbCommand(ParameterQuerySQL, myConn);
        OleDbDataReader mydr  = mycmd.ExecuteReader(CommandBehavior.CloseConnection);

        if (IsJSON)
        {
            string ParameterPart = JSONReportData.GenParameterText(mydr);
            JSONReportData.GenEntireData(DataPage, myds, ref ParameterPart, DataType);
        }
        else
        {
            string ParameterPart = XMLReportData.GenParameterText(mydr);
            XMLReportData.GenEntireData(DataPage, myds, ref ParameterPart, DataType);
        }

        myConn.Close();
    }
Ejemplo n.º 2
0
    //根据查询SQL,产生提供给报表生成需要的 XML 数据,字段值为空也产生数据
    public static void FullGenNodeXmlData(System.Web.UI.Page DataPage, string QuerySQL, bool ToCompress)
    {
        SqlConnection ReportConn        = new SqlConnection(SqlConnStr);
        SqlCommand    ReportDataCommand = new SqlCommand(QuerySQL, ReportConn);

        ReportConn.Open();
        SqlDataReader ReportDataReader = ReportDataCommand.ExecuteReader();

        XMLReportData.GenNodeXmlDataFromReader(DataPage, ReportDataReader, ToCompress? ResponseDataType.ZipBinary : ResponseDataType.PlainText);
        ReportDataReader.Close();
        ReportConn.Close();
    }
Ejemplo n.º 3
0
    //根据查询SQL,产生提供给报表生成需要的 XML 数据,字段值为空也产生数据
    public static void FullGenNodeXmlData(System.Web.UI.Page DataPage, string QuerySQL, bool ToCompress)
    {
        OleDbConnection myConn    = new OleDbConnection(OleDbConnStr);
        OleDbCommand    myCommand = new OleDbCommand(QuerySQL, myConn);

        myConn.Open();
        OleDbDataReader myReader = myCommand.ExecuteReader();

        XMLReportData.GenNodeXmlDataFromReader(DataPage, myReader, ToCompress? ResponseDataType.ZipBinary : ResponseDataType.PlainText);
        myReader.Close();
        myConn.Close();
    }
Ejemplo n.º 4
0
    //根据查询SQL,产生提供给报表生成需要的 XML 数据,采用 Sql 数据引擎, 根据RecordsetQuerySQL获取报表明细数据,根据ParameterQuerySQL获取报表参数数据
    public static void GenEntireReportData(System.Web.UI.Page DataPage, string RecordsetQuerySQL, string ParameterQuerySQL, bool ToCompress)
    {
        SqlConnection ReportConn    = new SqlConnection(SqlConnStr);
        DataSet       ReportDataSet = new DataSet();

        ReportConn.Open();
        SqlDataAdapter DataAdapter1 = new SqlDataAdapter(RecordsetQuerySQL, ReportConn);

        DataAdapter1.Fill(ReportDataSet, "Detail");
        SqlDataAdapter DataAdapter2 = new SqlDataAdapter(ParameterQuerySQL, ReportConn);

        DataAdapter2.Fill(ReportDataSet, "Master");
        ReportConn.Close();
        XMLReportData.GenDataSet(DataPage, ReportDataSet, ReportDataBase.DefaultDataType);
    }
Ejemplo n.º 5
0
    public static void GenMultiRecordset(System.Web.UI.Page DataPage, ArrayList QueryList)
    {
        SqlConnection ReportConn    = new SqlConnection(SqlConnStr);
        DataSet       ReportDataSet = new DataSet();

        ReportConn.Open();

        foreach (ReportQueryItem item in QueryList)
        {
            SqlDataAdapter DataAdapter = new SqlDataAdapter(item.QuerySQL, ReportConn);
            DataAdapter.Fill(ReportDataSet, item.RecordsetName);
        }

        ReportConn.Close();

        XMLReportData.GenDataSet(DataPage, ReportDataSet, ReportDataBase.DefaultDataType);
    }
Ejemplo n.º 6
0
    //<<protected function
    //根据查询SQL,产生提供给报表生成需要的 XML 或 JSON 数据
    protected static void DoGenDetailData(System.Web.UI.Page DataPage, string QuerySQL, ResponseDataType DataType, bool IsJSON)
    {
        SqlConnection  ReportConn        = new SqlConnection(SqlConnStr);
        SqlDataAdapter ReportDataAdapter = new SqlDataAdapter(QuerySQL, ReportConn);
        DataSet        ReportDataSet     = new DataSet();

        ReportConn.Open();
        ReportDataAdapter.Fill(ReportDataSet);
        ReportConn.Close();

        if (IsJSON)
        {
            JSONReportData.GenDataSet(DataPage, ReportDataSet, DataType);
        }
        else
        {
            XMLReportData.GenDataSet(DataPage, ReportDataSet, DataType);
        }
    }
Ejemplo n.º 7
0
    //根据查询 SQL,产生提供给报表生成需要的 XML 或 JSON 数据,这里只产生报表参数数据
    //当报表没有明细时,调用本方法生成数据,查询 SQL 应该只能查询出一条记录
    protected static void DoGenParameterData(System.Web.UI.Page DataPage, string ParameterQuerySQL, bool IsJSON)
    {
        OleDbConnection myConn    = new OleDbConnection(OleDbConnStr);
        OleDbCommand    myCommand = new OleDbCommand(ParameterQuerySQL, myConn);

        myConn.Open();
        OleDbDataReader myReader = myCommand.ExecuteReader();

        if (IsJSON)
        {
            JSONReportData.GenParameterData(DataPage, myReader);
        }
        else
        {
            XMLReportData.GenParameterData(DataPage, myReader);
        }
        myReader.Close();
        myConn.Close();
    }
Ejemplo n.º 8
0
    //<<protected function
    //根据查询SQL,产生提供给报表生成需要的 XML 或 JSON 数据
    protected static void DoGenDetailData(System.Web.UI.Page DataPage, string QuerySQL, ResponseDataType DataType, bool IsJSON)
    {
        OleDbConnection  myConn = new OleDbConnection(OleDbConnStr);
        OleDbDataAdapter myda   = new OleDbDataAdapter(QuerySQL, myConn);
        DataSet          myds   = new DataSet();

        myConn.Open();
        myda.Fill(myds);
        myConn.Close();

        if (IsJSON)
        {
            JSONReportData.GenDetailData(DataPage, myds, DataType);
        }
        else
        {
            XMLReportData.GenDetailData(DataPage, myds, DataType);
        }
    }