예제 #1
0
    static void testReport2() {
      DataTable tbl = new DataTable();
      tbl.Columns.Add(new DataColumn { ColumnName = "ID", DataType = typeof(Int32) });
      tbl.Columns.Add(new DataColumn { ColumnName = "ORGNAME", DataType = typeof(String) });
      tbl.Rows.Add(1, "org 1");
      //tbl.Rows.Add(1, "org 2");

      CXLReportDSConfigs v_dss = new CXLReportDSConfigs();
      v_dss.Add(new CXLReportDSConfig {
        alias = "cdsRpt",
        rangeName = "rngRpt",
        outerDataTable = tbl
      });
      Params prms = new Params();
      prms.Add("org_type", "p");

      String vrsltFileName = CXLReport.BuildReportSync(new CXLReportConfig {
        title = "Заголовок отчета",
        subject = "Описание отчета",
        templateAdv = @"report100(rpt).xls",
        inPrms = prms,
        filenameFmt = "{$code}_{$now}",
        dss = v_dss,
        debug = true
      });
    }
예제 #2
0
    static void testReport1() {
      CXLReportDSConfigs v_dss = new CXLReportDSConfigs();
      v_dss.Add(new CXLReportDSConfig { 
        alias = "cdsRpt", 
        rangeName = "rngRpt",
        sql = "dbo.ant_get_org", 
        commandType = CommandType.StoredProcedure 
      });
      Params prms = new Params();
      prms.Add("@p0", 38);

      String vrsltFileName = CXLReport.BuildReportSync(new CXLReportConfig{
        title = "Заголовок отчета",
        subject = "Описание отчета",
        templateAdv =  @"d:\data\prjs\bioSys-8\Bio.Helpers\Bio.XLFRpt2\Bio.XLFRpt2.Test\bin\Debug\report100(rpt).xls",
        inPrms = prms,
        dataFactoryTypeName = "Bio.Helpers.XLFRpt2.DataFactory.MSSQL.CDataFactory, Bio.Helpers.XLFRpt2.MSSQLDataFactory",
        filenameFmt = "{$code}_{$now}",
        dss = v_dss,
        dbSession = null,
        //dbSession = new CRptDBSession(@"Data Source= EKP51\SQLEXPRESS; Initial Catalog=GIVCORG; Integrated Security=True; User ID=ayrat; Password=rtabh"),
        connStr = @"Data Source= EKP51\SQLEXPRESS; Initial Catalog=GIVCORG; Integrated Security=True; User ID=ayrat; Password=rtabh",
        debug = false
      });
    }