Exemplo n.º 1
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);
    }
Exemplo n.º 2
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);
    }
Exemplo n.º 3
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);
        }
    }