public EbSqlJob()
        {
            ParameterKeyColumnsColl = new List <Param>();

            ParameterKeyColumnsTemp = new List <Param>();

            //ParameterKeyColumns = new List<string>();

            FirstReaderKeyColumnsTemp = new ColumnColletion();

            // FirstReaderKeyColumns = new List<string>();

            FirstReaderKeyColumnsColl = new ColumnColletion();
        }
        public IActionResult Index(string refid)
        {
            var resultlist = this.ServiceClient.Get <EbObjectParticularVersionResponse>(new EbObjectParticularVersionRequest {
                RefId = refid
            });

            Report = EbSerializers.Json_Deserialize <EbReport>(resultlist.Data[0].Json);

            if (Report.DataSourceRefId != string.Empty)
            {
                cresp = this.Redis.Get <DataSourceColumnsResponse>(string.Format("{0}_columns", Report.DataSourceRefId));
                if (cresp.IsNull)
                {
                    cresp = this.ServiceClient.Get <DataSourceColumnsResponse>(new DataSourceColumnsRequest {
                        RefId = Report.DataSourceRefId
                    });
                }

                __columns = (cresp.Columns.Count > 1) ? cresp.Columns[1] : cresp.Columns[0];

                dresp = this.ServiceClient.Get <DataSourceDataResponse>(new DataSourceDataRequest {
                    RefId = Report.DataSourceRefId, Draw = 1, Start = 0, Length = 100
                });
                dt = dresp.Data;
            }

            iTextSharp.text.Rectangle rec = (Report.IsLandscape) ?
                                            new iTextSharp.text.Rectangle(Report.Height, Report.Width) : new iTextSharp.text.Rectangle(Report.Width, Report.Height);

            d = new Document(rec);
            MemoryStream ms1 = new MemoryStream();

            writer = PdfWriter.GetInstance(d, ms1);
            writer.Open();
            d.Open();
            writer.PageEvent   = new HeaderFooter(this);
            writer.CloseStream = true;//important
            cb = writer.DirectContent;
            CalculateSectionHeights();
            d.NewPage();

            DrawReportHeader();
            DrawDetail();
            DrawReportFooter();
            d.Close();
            ms1.Position = 0;
            return(new FileStreamResult(ms1, "application/pdf"));
        }
示例#3
0
        private string GetTreeData(ColumnColletion columns)
        {
            List <string> CNodes = new List <string>();
            //Dictionary<string, List<string>> tree = new Dictionary<string, List<string>>();
            TreeData td = new TreeData();

            td.text = "sxxxx";
            foreach (EbDataColumn column in columns)
            {
                td.nodes.Add(column.ColumnName);
            }
            //tree.Add("xxxx", CNodes);
            var xx = JsonConvert.SerializeObject(td);

            return(xx);
        }
示例#4
0
        private void DrawColumns(ColumnColletion columns)
        {
            for (int i = 0; i < columns.Count; i++)
            {
                this.ColumnDefinitions.Add(new ColumnDefinition());

                Label label = new Label
                {
                    FontAttributes        = FontAttributes.Bold,
                    FontFamily            = (OnPlatform <string>)HelperFunctions.GetResourceValue("Roboto-Medium"),
                    Text                  = columns[i].ColumnName,
                    VerticalTextAlignment = TextAlignment.Center,
                    BackgroundColor       = Color.FromHex("eeeeee"),
                    Padding               = new Thickness(5, 0)
                };

                this.Children.Add(label, i, 0);
            }
        }
示例#5
0
        public List <SingleColumn> GetColumnValues(ColumnColletion columns, EbDataRow row)
        {
            List <SingleColumn> singleColumn = new List <SingleColumn>();

            for (int i = 0; i < row.Count; i++)
            {
                EbDataColumn column = columns.Find(o => o.ColumnIndex == i);

                if (column != null && column.ColumnName != "eb_loc_id" && column.ColumnName != "id")
                {
                    DbTypedValue DTV = GetDbType(column.ColumnName, row[i], column.Type);

                    singleColumn.Add(new SingleColumn
                    {
                        Name  = column.ColumnName,
                        Type  = (int)DTV.Type,
                        Value = DTV.Value
                    });
                }
            }
            return(singleColumn);
        }
示例#6
0
 public void Redraw(ColumnColletion columns)
 {
     if (columns != null)
     {
         this.listBox1.Items.Clear();
         foreach (var col in columns)
         {
             if (col.Type == typeof(System.String))
             {
                 listBox1.Items.Add(new ToolboxItem(typeof(EbReportFieldTextControl))
                 {
                     DisplayName = col.ColumnName
                 });
             }
             else if (col.Type == typeof(System.Int32))
             {
                 listBox1.Items.Add(new ToolboxItem(typeof(EbReportFieldNumericControl))
                 {
                     DisplayName = col.ColumnName
                 });
             }
         }
     }
 }
        private List <SQLiteColumSchema> GetNewControls(List <SQLiteColumSchema> columns, ColumnColletion newColumns)
        {
            List <SQLiteColumSchema> unCreated = new List <SQLiteColumSchema>();

            foreach (SQLiteColumSchema cols in columns)
            {
                EbDataColumn data_col = newColumns.Find(x => x.ColumnName == cols.ColumnName);

                if (data_col == null)
                {
                    unCreated.Add(cols);
                }
            }
            return(unCreated);
        }