Example #1
0
        public void ListCompleted()
        {
            _initialSelectLoad = false;
            CreateHtmlFromItems();

            var html = new StringBuilder();

            html.Append("<!DOCTYPE html>");
            html.Append("<html><head><meta charset=\"UTF-8\">");
            html.Append("<style>");
            html.Append(_fontFamiliesStyle);
            html.Append("</style>");
            html.Append("<script type='text/javascript'>");
            html.Append(" function fireEvent(name, data)");
            html.Append(" {");
            html.Append("   var event = new MessageEvent(name, {'data' : data});");
            html.Append("   document.dispatchEvent(event);");
            html.Append(" }");
            html.Append("</script>");
            html.Append("<style>");
            html.Append("ul { border: 0px solid black; display: inline-block; margin:0px; padding:0px; } ");
            html.Append("ul li { display: inline-block; list-style: none; vertical-align: top: } ");
            html.Append("ul li ul { border: 0px; padding: 0px; } ");
            html.AppendFormat("ul li ul li {{ cursor: pointer; display: list-item; white-space: nowrap; height:30px; list-style: none; text-align:left; width: {0}px; color:black; }} ", ColumnWidth.ToString());
            html.Append("ul li ul li.selected { color:blue; } ");
            html.Append("ul li ul li.hover { background-color: #CCCCCC; } ");
            html.Append("</style>");
            html.Append("</head>");
            html.AppendFormat("<body style='background:{0}; width:{1}; overflow-x:hidden' id='mainbody'><ul id='main'></ul>",
                              System.Drawing.ColorTranslator.ToHtml(BackColor),
                              this.Width);

            // The following line is removed at this point and done later as a change to the inner
            // html because otherwise the browser blows up because of the length of the
            // navigation line.  Leaving this and this comment in as a warning to anyone who
            // may be tempted to try the same thing.
            html.Append("</body></html>");
            SetHtml(html.ToString());
        }
Example #2
0
 public override string Column(ColumnWidth columnWidth, IEnumerable <(Breakpoint breakpoint, bool offset)> rules)
Example #3
0
        /// <summary>
        /// calculate the positions for the columns
        ///
        ///
        /// </summary>
        /// <returns>void</returns>
        protected void InitColumnLayout()
        {
            System.Int32 lowestlevel;
            double       MostRightPosition;
            double       MostRightPosition2;

            System.Int32 Counter;
            String       ColumnFormat;
            TVariant     ColumnPosition;
            TVariant     ColumnPositionIndented;

            lowestlevel = this.Results.GetDeepestVisibleLevel();
            Parameters.Add("lowestLevel", new TVariant(lowestlevel), -1, ReportingConsts.APPLICATIONPARAMETERS);

            // use the columns of the first subreport (it always exists) to calculate the position of the columns and the width of the report
            // but setting parameters has to be done in the global settings (subreport = 1)
            Parameters.Add("CurrentSubReport", new TVariant(0), -1);

            // get the most right position of the descr columns of the lowest level
            MostRightPosition = 0;

            if (Parameters.Exists("ColumnPosition", ReportingConsts.COLUMNLEFT + 1, lowestlevel))
            {
                MostRightPosition = MostRightPosition + Parameters.Get("ColumnPosition", ReportingConsts.COLUMNLEFT + 1, lowestlevel).ToDouble();
            }

            if (Parameters.Exists("ColumnWidth", ReportingConsts.COLUMNLEFT + 1, lowestlevel))
            {
                MostRightPosition = MostRightPosition + Parameters.Get("ColumnWidth", ReportingConsts.COLUMNLEFT + 1, lowestlevel).ToDouble();
            }

            MostRightPosition2 = 0;

            if (Parameters.Exists("ColumnPosition", ReportingConsts.COLUMNLEFT + 2, lowestlevel))
            {
                MostRightPosition2 = MostRightPosition2 + Parameters.Get("ColumnPosition", ReportingConsts.COLUMNLEFT + 2, lowestlevel).ToDouble();
            }

            if (Parameters.Exists("ColumnWidth", ReportingConsts.COLUMNLEFT + 2, lowestlevel))
            {
                MostRightPosition2 = MostRightPosition2 + Parameters.Get("ColumnWidth", ReportingConsts.COLUMNLEFT + 2, lowestlevel).ToDouble();
            }

            if (MostRightPosition2 > MostRightPosition)
            {
                MostRightPosition = MostRightPosition2;
            }

            for (Counter = 0; Counter <= Results.GetMaxDisplayColumns() - 1; Counter += 1)
            {
                // space between columns
                MostRightPosition = MostRightPosition + 0.0;

                if (Parameters.Exists("ColumnPosition", Counter))
                {
                    MostRightPosition = Parameters.Get("ColumnPosition", Counter).ToDouble();
                }

                ColumnPosition         = new TVariant(MostRightPosition);
                ColumnPositionIndented = Parameters.Get("ColumnPositionIndented", Counter);
                TVariant ColumnWidth = new TVariant();

                if (!Parameters.Exists("ColumnWidth", Counter))
                {
                    if (Parameters.Exists("ColumnFormat", Counter, -1, eParameterFit.eExact))
                    {
                        // todo: width of currency depends on thousandsonly, nodecimals, etc.
                        ColumnFormat = Parameters.Get("ColumnFormat", Counter, -1, eParameterFit.eExact).ToString();

                        // all measurements in cm
                        if (ColumnFormat == "percentage")
                        {
                            // was 2.0, but the caption needs space as well, so same width as currency
                            ColumnWidth = new TVariant(2.5);
                        }
                        else if (ColumnFormat == "currency")
                        {
                            ColumnWidth = new TVariant(2.5);
                        }
                        else
                        {
                            ColumnWidth = new TVariant(3);
                        }

                        ColumnPositionIndented = new TVariant(0.5);
                    }
                    else
                    {
                        ColumnWidth = new TVariant(4);
                    }
                }
                else
                {
                    ColumnWidth = Parameters.Get("ColumnWidth", Counter);
                }

                MostRightPosition = MostRightPosition + ColumnWidth.ToDouble();

                if (!ColumnPositionIndented.IsNil())
                {
                    MostRightPosition = MostRightPosition + ColumnPositionIndented.ToDouble();
                }

                // save the values to the global report level
                Parameters.Add("CurrentSubReport", new TVariant(-1), -1);
                Parameters.Add("ColumnPosition", new TVariant(ColumnPosition), Counter);
                Parameters.Add("ColumnWidth", new TVariant(ColumnWidth), Counter);

                if (!ColumnPositionIndented.IsNil())
                {
                    Parameters.Add("ColumnPositionIndented", ColumnPositionIndented, Counter);
                }

                Parameters.Add("CurrentSubReport", new TVariant(0), -1);
            }

            Parameters.Add("CurrentSubReport", new TVariant(-1), -1);
            Parameters.Add("ReportWidth", new TVariant(MostRightPosition));
        }
Example #4
0
        public void OnColumnResize(Guid columnId, int newSize)
        {
            ContentDomain provider = Common.GetContentDomain(ClassifiacationTypeView);
            List<ColumnWidth> columnWidths = provider.ColumnWidths.Where(p => p.ClassificationTreeID == this.RequestClassificationTreeID).ToList();

            if (columnWidths.Count(p => p.ColumnID == columnId) > 0)
            {
                ColumnWidth width = columnWidths.Single(p => p.ColumnID == columnId);
                width.Width = newSize;
                provider.SubmitChanges();
            }
            else
            {
                ColumnWidth width = new ColumnWidth();
                width.ID = Guid.NewGuid();
                width.ClassificationTreeID = this.RequestClassificationTreeID;
                width.ColumnID = columnId;
                width.UserID = User.ID;
                width.Width = newSize;
                provider.ColumnWidths.InsertOnSubmit(width);
                provider.SubmitChanges();
            }
        }
 public abstract string Col(ColumnWidth columnWidth, Breakpoint breakpoint, bool offset);
Example #6
0
 public string Column( ColumnWidth columnWidth, IEnumerable<(Breakpoint breakpoint, bool offset)> rules ) => null;
Example #7
0
        public bool Equals([AllowNull] Table other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) &&
                   (Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) &&
                   (UId == other.UId && UId != null && other.UId != null && UId.Equals(other.UId)) &&
                   (Equals(Ids, other.Ids) || Ids != null && other.Ids != null && Ids.SequenceEqual(other.Ids)) &&
                   (Equals(CustomData, other.CustomData) || CustomData != null && other.CustomData != null && CustomData.SequenceEqual(other.CustomData)) &&
                   (Meta == other.Meta && Meta != null && other.Meta != null && Meta.Equals(other.Meta)) &&
                   (Equals(MetaArray, other.MetaArray) || MetaArray != null && other.MetaArray != null && MetaArray.SequenceEqual(other.MetaArray)) &&
                   (HoverInfo == other.HoverInfo && HoverInfo != null && other.HoverInfo != null && HoverInfo.Equals(other.HoverInfo)) &&
                   (Equals(HoverInfoArray, other.HoverInfoArray) || HoverInfoArray != null && other.HoverInfoArray != null && HoverInfoArray.SequenceEqual(other.HoverInfoArray)) &&
                   (HoverLabel == other.HoverLabel && HoverLabel != null && other.HoverLabel != null && HoverLabel.Equals(other.HoverLabel)) &&
                   (Stream == other.Stream && Stream != null && other.Stream != null && Stream.Equals(other.Stream)) &&
                   (UiRevision == other.UiRevision && UiRevision != null && other.UiRevision != null && UiRevision.Equals(other.UiRevision)) &&
                   (Domain == other.Domain && Domain != null && other.Domain != null && Domain.Equals(other.Domain)) &&
                   (ColumnWidth == other.ColumnWidth && ColumnWidth != null && other.ColumnWidth != null && ColumnWidth.Equals(other.ColumnWidth)) &&
                   (Equals(ColumnWidthArray, other.ColumnWidthArray) || ColumnWidthArray != null && other.ColumnWidthArray != null && ColumnWidthArray.SequenceEqual(other.ColumnWidthArray)) &&
                   (Equals(ColumnOrder, other.ColumnOrder) || ColumnOrder != null && other.ColumnOrder != null && ColumnOrder.SequenceEqual(other.ColumnOrder)) &&
                   (Header == other.Header && Header != null && other.Header != null && Header.Equals(other.Header)) &&
                   (Cells == other.Cells && Cells != null && other.Cells != null && Cells.Equals(other.Cells)) &&
                   (IdsSrc == other.IdsSrc && IdsSrc != null && other.IdsSrc != null && IdsSrc.Equals(other.IdsSrc)) &&
                   (CustomDataSrc == other.CustomDataSrc && CustomDataSrc != null && other.CustomDataSrc != null && CustomDataSrc.Equals(other.CustomDataSrc)) &&
                   (MetaSrc == other.MetaSrc && MetaSrc != null && other.MetaSrc != null && MetaSrc.Equals(other.MetaSrc)) &&
                   (HoverInfoSrc == other.HoverInfoSrc && HoverInfoSrc != null && other.HoverInfoSrc != null && HoverInfoSrc.Equals(other.HoverInfoSrc)) &&
                   (ColumnWidthSrc == other.ColumnWidthSrc && ColumnWidthSrc != null && other.ColumnWidthSrc != null && ColumnWidthSrc.Equals(other.ColumnWidthSrc)) &&
                   (ColumnOrderSrc == other.ColumnOrderSrc && ColumnOrderSrc != null && other.ColumnOrderSrc != null && ColumnOrderSrc.Equals(other.ColumnOrderSrc)));
        }
        private static Column AddField(DataColumn col, bool useMeasureModule,
                                       DataTemplate vTemplate, DataTemplate vTemplateNoBindMeasure, ColumnWidth columnWidth)
        {
            var fld = new UnboundColumn
            {
                Key        = col.ColumnName,
                Width      = columnWidth,
                IsReadOnly = true,
                HorizontalContentAlignment = HorizontalAlignment.Right,
                VerticalContentAlignment   = VerticalAlignment.Center,
                DataViewType = col.DataType,
                IsGroupable  = false,
                IsFilterable = true,
                ItemTemplate = useMeasureModule ? vTemplate : vTemplateNoBindMeasure,
            };

            //Settings =
            //{
            //    //AllowResize = true,
            //    //LabelTextWrapping = TextWrapping.WrapWithOverflow,
            //    //LabelPresenterStyle = nameStyle,
            //    AutoSizeOptions = FieldAutoSizeOptions.None,
            //    Width = width,
            //    //AllowSummaries = false,
            //    SummaryUIType = SummaryUIType.MultiSelect,
            //    //SummaryDisplayArea = SummaryDisplayAreas.TopFixed,
            //    FilterComparer = comparer,
            //    FilterOperandUIType = FilterOperandUIType.Combo,
            //    //EditAsType = col.DataType,
            //    AllowRecordFiltering = true,
            //},
            //ValueToTextConverter = valueConverter,

            return(fld);
        }
        public int Save()
        {
            int reportColumnRowIndex = ReportColumnRowIndex;

            #region 保存行数列数等信息。
            report.MainReportSetting.HeaderSetting.TopSetting.RowCount    = TopRowCount;
            report.MainReportSetting.HeaderSetting.BottomSetting.RowCount = BottomRowCount;
            report.MainReportSetting.HeaderSetting.ColumnCount            = sheetMain.Columns.Count;
            #endregion
            #region 保存行高信息。
            #region 保存报表列的行高。
            report.MainReportSetting.HeaderSetting.ReportColumnHeight = sheetMain.Rows[reportColumnRowIndex].Height;
            #endregion
            report.MainReportSetting.HeaderSetting.TopSetting.RowHeightList = new List <RowHeight>();
            for (int i = 0; i < reportColumnRowIndex; i++)
            {
                RowHeight rowHeight = new RowHeight();
                rowHeight.Row    = i;
                rowHeight.Height = sheetMain.Rows[i].Height;
                report.MainReportSetting.HeaderSetting.TopSetting.RowHeightList.Add(rowHeight);
            }
            report.MainReportSetting.HeaderSetting.BottomSetting.RowHeightList = new List <RowHeight>();
            for (int i = reportColumnRowIndex + 1; i < sheetMain.Rows.Count; i++)
            {
                RowHeight rowHeight = new RowHeight();
                //需要减少报表行序号。
                rowHeight.Row    = i - reportColumnRowIndex - 1;
                rowHeight.Height = sheetMain.Rows[i].Height;
                report.MainReportSetting.HeaderSetting.BottomSetting.RowHeightList.Add(rowHeight);
            }
            #endregion
            #region 保存列宽信息。
            report.MainReportSetting.HeaderSetting.ColumnWidthList = new List <ColumnWidth>();
            for (int i = 0; i < sheetMain.Columns.Count; i++)
            {
                ColumnWidth columnWidth = new ColumnWidth();
                columnWidth.Column = i;
                columnWidth.Width  = sheetMain.Columns[i].Width;
                report.MainReportSetting.HeaderSetting.ColumnWidthList.Add(columnWidth);
            }
            #endregion
            #region 保存斜线列表。
            report.MainReportSetting.HeaderSetting.TopSetting.BevelLineList    = new List <BevelLine>();
            report.MainReportSetting.HeaderSetting.BottomSetting.BevelLineList = new List <BevelLine>();
            //对于在报表列下方的斜线,统一将Row减少报表列的序号。
            foreach (BevelLine bevelLine in bevelLineList)
            {
                //表首斜线列表。
                if (bevelLine.StartCellRow < reportColumnRowIndex)
                {
                    report.MainReportSetting.HeaderSetting.TopSetting.BevelLineList.Add(bevelLine);
                }
                //表尾斜线列表。
                else
                {
                    #region 将斜线的行序号减少报表列序号。
                    BevelLine bevelLineTemp = bevelLine.Clone();
                    bevelLineTemp.StartCellRow -= reportColumnRowIndex + 1;
                    bevelLineTemp.EndCellRow   -= reportColumnRowIndex + 1;
                    #endregion
                    report.MainReportSetting.HeaderSetting.BottomSetting.BevelLineList.Add(bevelLineTemp);
                }
            }
            #endregion
            #region 保存Cell信息。
            report.MainReportSetting.HeaderSetting.TopSetting.CellInfoList    = GetVisibleCellInfo(0, reportColumnRowIndex - 1);
            report.MainReportSetting.HeaderSetting.BottomSetting.CellInfoList = GetVisibleCellInfo(reportColumnRowIndex + 1, sheetMain.Rows.Count - 1);
            //将行序号减少报表列序号。
            foreach (CellInfo cellInfo in report.MainReportSetting.HeaderSetting.BottomSetting.CellInfoList)
            {
                cellInfo.Row -= reportColumnRowIndex + 1;
            }
            #endregion
            return(1);
        }
 public XmlColumnWidth(ColumnWidth columnWidth)
 {
     m_value    = columnWidth.Value;
     m_unitType = columnWidth.UnitType;
 }
 public XmlColumnWidth( ColumnWidth columnWidth )
 {
   m_value = columnWidth.Value;
   m_unitType = columnWidth.UnitType;
 }
 private FluentLayouts SetWidth(ColumnWidth width)
 {
     return(SetCurrentLayout(CurrentLayout.WithWidth(width)));
 }
Example #13
0
        protected Workbook createWorkbook()
        {
            Workbook workbook = new Workbook();

            workbook.Sheets.Add(SheetType.Worksheet);
            Worksheet worksheet = workbook.ActiveWorksheet;

            worksheet.Name = "OTE RT";
            List <TaskB> tasks = new List <TaskB>();

            try {
                string recFilter = gridMain.MasterTableView.FilterExpression;
                GridSortExpressionCollection gridSortExxpressions = gridMain.MasterTableView.SortExpressions;
                TasksController cont       = new TasksController();
                int             tasksCount = cont.CountAllTasks(recFilter);
                tasks = cont.GetAllTasks(0, tasksCount, recFilter, gridSortExxpressions);
            }
            catch (Exception) { }
            prepareDocument(worksheet);
            int         currentRow = 1;
            CellBorder  border     = new CellBorder(CellBorderStyle.Thin, tcBlack);
            CellBorders borders    = new CellBorders(border, border, border, border, null, null, null, null);
            double      fontSize   = 12;

            foreach (TaskB curTask in tasks)
            {
                worksheet.Cells[currentRow, 0].SetValue(curTask.ID.ToString());
                worksheet.Cells[currentRow, 0].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 0].SetBorders(borders);
                worksheet.Cells[currentRow, 1].SetValue(curTask.RegNo);
                worksheet.Cells[currentRow, 1].SetFormat(new CellValueFormat("@"));
                worksheet.Cells[currentRow, 1].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 1].SetBorders(borders);
                worksheet.Cells[currentRow, 2].SetValue(curTask.OrderDate);
                worksheet.Cells[currentRow, 2].SetFormat(new CellValueFormat(dateFormat));
                worksheet.Cells[currentRow, 2].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 2].SetBorders(borders);
                worksheet.Cells[currentRow, 3].SetValue(curTask.Customer.NameGR);
                worksheet.Cells[currentRow, 3].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 3].SetBorders(borders);
                worksheet.Cells[currentRow, 4].SetValue(curTask.Job.Name);
                worksheet.Cells[currentRow, 4].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 4].SetBorders(borders);
                string distance = curTask.Distance.Position1 + " - " + curTask.Distance.Position2 + " (" + curTask.Distance.KM.ToString() + ")";
                worksheet.Cells[currentRow, 5].SetValue(distance);
                worksheet.Cells[currentRow, 5].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 5].SetBorders(borders);
                worksheet.Cells[currentRow, 6].SetValue(curTask.DateTimeStartOrder.GetValueOrDefault());
                worksheet.Cells[currentRow, 6].SetFormat(new CellValueFormat(dateFormat));
                worksheet.Cells[currentRow, 6].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 6].SetBorders(borders);
                worksheet.Cells[currentRow, 7].SetValue(curTask.DateTimeEndOrder.GetValueOrDefault());
                worksheet.Cells[currentRow, 7].SetFormat(new CellValueFormat(dateFormat));
                worksheet.Cells[currentRow, 7].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 7].SetBorders(borders);
                worksheet.Cells[currentRow, 8].SetValue(curTask.DateTimeDurationOrder);
                worksheet.Cells[currentRow, 8].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 8].SetBorders(borders);
                worksheet.Cells[currentRow, 9].SetValue(double.Parse(curTask.AddedCharges.GetValueOrDefault().ToString()));
                worksheet.Cells[currentRow, 9].SetFormat(new CellValueFormat(currencyFormat));
                worksheet.Cells[currentRow, 9].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 9].SetBorders(borders);
                worksheet.Cells[currentRow, 10].SetValue(double.Parse(curTask.CostCalculated.GetValueOrDefault().ToString()));
                worksheet.Cells[currentRow, 10].SetFormat(new CellValueFormat(currencyFormat));
                worksheet.Cells[currentRow, 10].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 10].SetBorders(borders);
                if (curTask.DateTimeStartActual.GetValueOrDefault().Year > 2000)
                {
                    worksheet.Cells[currentRow, 11].SetValue(curTask.DateTimeStartActual.GetValueOrDefault());
                }
                else
                {
                    worksheet.Cells[currentRow, 11].SetValue("");
                }
                worksheet.Cells[currentRow, 11].SetFormat(new CellValueFormat(dateFormat));
                worksheet.Cells[currentRow, 11].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 11].SetBorders(borders);
                if (curTask.DateTimeEndActual.GetValueOrDefault().Year > 2000)
                {
                    worksheet.Cells[currentRow, 12].SetValue(curTask.DateTimeEndActual.GetValueOrDefault());
                }
                else
                {
                    worksheet.Cells[currentRow, 12].SetValue("");
                }
                worksheet.Cells[currentRow, 12].SetFormat(new CellValueFormat(dateFormat));
                worksheet.Cells[currentRow, 12].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 12].SetBorders(borders);
                if (curTask.IsCanceled == true)
                {
                    worksheet.Cells[currentRow, 13].SetValue(0);
                }
                else
                {
                    worksheet.Cells[currentRow, 13].SetValue(curTask.DateTimeDurationActual.GetValueOrDefault());
                }
                worksheet.Cells[currentRow, 13].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 13].SetBorders(borders);
                if (curTask.PaymentDateOrder.GetValueOrDefault().Year > 2000)
                {
                    worksheet.Cells[currentRow, 14].SetValue(curTask.PaymentDateOrder.GetValueOrDefault());
                }
                else
                {
                    worksheet.Cells[currentRow, 14].SetValue("");
                }
                worksheet.Cells[currentRow, 14].SetFormat(new CellValueFormat(dateFormat));
                worksheet.Cells[currentRow, 14].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 14].SetBorders(borders);
                worksheet.Cells[currentRow, 15].SetValue(double.Parse(curTask.CostActual.GetValueOrDefault().ToString()));
                worksheet.Cells[currentRow, 15].SetFormat(new CellValueFormat(currencyFormat));
                worksheet.Cells[currentRow, 15].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 15].SetBorders(borders);
                if (curTask.PaymentDateCalculated.GetValueOrDefault().Year > 2000)
                {
                    worksheet.Cells[currentRow, 16].SetValue(curTask.PaymentDateCalculated.GetValueOrDefault());
                }
                else
                {
                    worksheet.Cells[currentRow, 16].SetValue("");
                }
                worksheet.Cells[currentRow, 16].SetFormat(new CellValueFormat(dateFormat));
                worksheet.Cells[currentRow, 16].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 16].SetBorders(borders);
                //if (curTask.PaymentDateActual.GetValueOrDefault().Year > 2000) {
                //    worksheet.Cells[currentRow, 17].SetValue(curTask.PaymentDateActual.GetValueOrDefault());
                //} else {
                //    worksheet.Cells[currentRow, 17].SetValue("");
                //}
                //worksheet.Cells[currentRow,17].SetFormat(new CellValueFormat(dateFormat));
                //worksheet.Cells[currentRow,17].SetFontSize(fontSize);
                //worksheet.Cells[currentRow,17].SetBorders(borders);
                string isCanc = "ΟΧΙ";
                if (curTask.IsCanceled == true)
                {
                    isCanc = "ΝΑΙ";
                }
                worksheet.Cells[currentRow, 17].SetValue(isCanc);
                worksheet.Cells[currentRow, 17].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 17].SetBorders(borders);
                worksheet.Cells[currentRow, 18].SetValue(curTask.Comments);
                worksheet.Cells[currentRow, 18].SetIsWrapped(true);
                worksheet.Cells[currentRow, 18].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 18].SetBorders(borders);
                worksheet.Cells[currentRow, 19].SetValue(curTask.InvoceComments);
                worksheet.Cells[currentRow, 19].SetIsWrapped(true);
                worksheet.Cells[currentRow, 19].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 19].SetBorders(borders);
                worksheet.Cells[currentRow, 20].SetValue(curTask.EnteredByUser);
                worksheet.Cells[currentRow, 20].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 20].SetBorders(borders);
                worksheet.Cells[currentRow, 21].SetValue(curTask.DateStamp);
                worksheet.Cells[currentRow, 21].SetFormat(new CellValueFormat(dateFormat));
                worksheet.Cells[currentRow, 21].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 21].SetBorders(borders);
                currentRow++;
            }
            for (int i = 0; i < worksheet.Columns.Count; i++)
            {
                worksheet.Columns[i].AutoFitWidth();
            }
            for (int i = 0; i < worksheet.Columns.Count; i++)
            {
                if (i == 18 || i == 19)
                {
                    worksheet.Columns[i].SetWidth(new ColumnWidth(300, true));
                }
                ColumnSelection columnSelection = worksheet.Columns[i];
                ColumnWidth     columnWidth     = columnSelection.GetWidth().Value;
                double          curColWidth     = columnWidth.Value + 10;
                if (curColWidth > 2000)
                {
                    curColWidth = 2000;
                }
                columnSelection.SetWidth(new ColumnWidth(curColWidth, columnWidth.IsCustom));
            }
            ColumnSelection columnSelection4 = worksheet.Columns[4];
            ColumnWidth     columnWidth4     = columnSelection4.GetWidth().Value;
            double          curColWidth4     = columnWidth4.Value + 10;

            if (curColWidth4 > 2000)
            {
                curColWidth4 = 2000;
            }
            columnSelection4.SetWidth(new ColumnWidth(curColWidth4, columnWidth4.IsCustom));
            return(workbook);
        }
Example #14
0
 public virtual string Col(ColumnWidth columnWidth, IEnumerable <(Breakpoint breakpoint, bool offset)> rules) =>
Example #15
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (Type != null)
                {
                    hashCode = hashCode * 59 + Type.GetHashCode();
                }

                if (Visible != null)
                {
                    hashCode = hashCode * 59 + Visible.GetHashCode();
                }

                if (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }

                if (UId != null)
                {
                    hashCode = hashCode * 59 + UId.GetHashCode();
                }

                if (Ids != null)
                {
                    hashCode = hashCode * 59 + Ids.GetHashCode();
                }

                if (CustomData != null)
                {
                    hashCode = hashCode * 59 + CustomData.GetHashCode();
                }

                if (Meta != null)
                {
                    hashCode = hashCode * 59 + Meta.GetHashCode();
                }

                if (MetaArray != null)
                {
                    hashCode = hashCode * 59 + MetaArray.GetHashCode();
                }

                if (HoverInfo != null)
                {
                    hashCode = hashCode * 59 + HoverInfo.GetHashCode();
                }

                if (HoverInfoArray != null)
                {
                    hashCode = hashCode * 59 + HoverInfoArray.GetHashCode();
                }

                if (HoverLabel != null)
                {
                    hashCode = hashCode * 59 + HoverLabel.GetHashCode();
                }

                if (Stream != null)
                {
                    hashCode = hashCode * 59 + Stream.GetHashCode();
                }

                if (UiRevision != null)
                {
                    hashCode = hashCode * 59 + UiRevision.GetHashCode();
                }

                if (Domain != null)
                {
                    hashCode = hashCode * 59 + Domain.GetHashCode();
                }

                if (ColumnWidth != null)
                {
                    hashCode = hashCode * 59 + ColumnWidth.GetHashCode();
                }

                if (ColumnWidthArray != null)
                {
                    hashCode = hashCode * 59 + ColumnWidthArray.GetHashCode();
                }

                if (ColumnOrder != null)
                {
                    hashCode = hashCode * 59 + ColumnOrder.GetHashCode();
                }

                if (Header != null)
                {
                    hashCode = hashCode * 59 + Header.GetHashCode();
                }

                if (Cells != null)
                {
                    hashCode = hashCode * 59 + Cells.GetHashCode();
                }

                if (IdsSrc != null)
                {
                    hashCode = hashCode * 59 + IdsSrc.GetHashCode();
                }

                if (CustomDataSrc != null)
                {
                    hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
                }

                if (MetaSrc != null)
                {
                    hashCode = hashCode * 59 + MetaSrc.GetHashCode();
                }

                if (HoverInfoSrc != null)
                {
                    hashCode = hashCode * 59 + HoverInfoSrc.GetHashCode();
                }

                if (ColumnWidthSrc != null)
                {
                    hashCode = hashCode * 59 + ColumnWidthSrc.GetHashCode();
                }

                if (ColumnOrderSrc != null)
                {
                    hashCode = hashCode * 59 + ColumnOrderSrc.GetHashCode();
                }

                return(hashCode);
            }
        }
        private static Column AddFieldAndSummary(DataColumn col, IFValueComparer comparer, bool useMeasureModule,
                                                 DataTemplate vTemplate, DataTemplate vTemplateNoBindMeasure, ColumnWidth columnWidth)
        {
            var fld = AddField(col, useMeasureModule, vTemplate, vTemplateNoBindMeasure, columnWidth);

            return(fld);
        }
    internal static string ToString( ColumnWidth columnWidth, CultureInfo cultureInfo )
    {
      if( columnWidth.UnitType == ColumnWidthUnitType.Star )
      {
        if( columnWidth.Value != 1d )
          return ( Convert.ToString( columnWidth.Value, cultureInfo ) + "*" );

        return "*";
      }

      return Convert.ToString( columnWidth.Value, cultureInfo );
    }
Example #18
0
 public FormGroup(ColumnWidth width = ColumnWidth.Large, Glyphicon glyphiconAddon = Glyphicon.Custom)
 {
     Width = width;
     GlyphiconAddon = glyphiconAddon;
 }
Example #19
0
        protected Workbook createWorkbook()
        {
            Workbook workbook = new Workbook();

            workbook.Sheets.Add(SheetType.Worksheet);
            Worksheet worksheet = workbook.ActiveWorksheet;

            worksheet.Name = "KET " + forDate.ToString("dd-MM-yyyy");
            List <TaskForH> tasks = getTasksForHelpers(forDate);

            prepareDocument(worksheet);
            int         currentRow = 1;
            CellBorder  border     = new CellBorder(CellBorderStyle.Thin, tcBlack);
            CellBorders borders    = new CellBorders(border, border, border, border, null, null, null, null);
            double      fontSize   = 12;

            foreach (TaskForH curTask in tasks)
            {
                worksheet.Cells[currentRow, 0].SetValue(curTask.Count.ToString());
                worksheet.Cells[currentRow, 0].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 0].SetBorders(borders);
                worksheet.Cells[currentRow, 1].SetValue(curTask.Customer);
                worksheet.Cells[currentRow, 1].SetFormat(new CellValueFormat("@"));
                worksheet.Cells[currentRow, 1].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 1].SetBorders(borders);
                worksheet.Cells[currentRow, 2].SetValue(curTask.FromPlace);
                worksheet.Cells[currentRow, 2].SetFormat(new CellValueFormat("@"));
                worksheet.Cells[currentRow, 2].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 2].SetBorders(borders);
                worksheet.Cells[currentRow, 3].SetValue(curTask.FromTime + " - " + curTask.ToTime);
                worksheet.Cells[currentRow, 3].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 3].SetBorders(borders);
                worksheet.Cells[currentRow, 4].SetValue(curTask.Comments);
                worksheet.Cells[currentRow, 4].SetIsWrapped(true);
                worksheet.Cells[currentRow, 4].SetFontSize(fontSize);
                worksheet.Cells[currentRow, 4].SetBorders(borders);
                currentRow++;
            }
            for (int i = 0; i < worksheet.Columns.Count; i++)
            {
                worksheet.Columns[i].AutoFitWidth();
            }
            for (int i = 0; i < worksheet.Columns.Count; i++)
            {
                if (i == 4)
                {
                    worksheet.Columns[i].SetWidth(new ColumnWidth(500, true));
                }
                ColumnSelection columnSelection = worksheet.Columns[i];
                ColumnWidth     columnWidth     = columnSelection.GetWidth().Value;
                double          curColWidth     = columnWidth.Value + 10;
                if (curColWidth > 2000)
                {
                    curColWidth = 2000;
                }
                columnSelection.SetWidth(new ColumnWidth(curColWidth, columnWidth.IsCustom));
            }
            ColumnSelection columnSelection4 = worksheet.Columns[4];
            ColumnWidth     columnWidth4     = columnSelection4.GetWidth().Value;
            double          curColWidth4     = columnWidth4.Value + 10;

            if (curColWidth4 > 2000)
            {
                curColWidth4 = 2000;
            }
            columnSelection4.SetWidth(new ColumnWidth(curColWidth4, columnWidth4.IsCustom));
            return(workbook);
        }