Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            spreadhelper = new SpreadHelper(ref FpSpread1, 880, 600);
            spreadhelper.OpenExcelTemplate(Request.PhysicalApplicationPath + "模板\\样品交接单.xls");
            spreadhelper.setDateTimeCellType(5, 1);
            spreadhelper.setComboxCellType(3, 6);

            FpSpread1.Sheets.Count = 1;

            // //设置相应单元格类型
            // //spreadhelper.setDateTimeCellType(6,2);

            //FarPoint.Web.Spread.DateTimeCellType dt = new FarPoint.Web.Spread.DateTimeCellType();
            // System.Globalization.DateTimeFormatInfo dtf = new System.Globalization.DateTimeFormatInfo();
            // dtf.LongDatePattern = "D";
            // dtf.ShortDatePattern = "M/d/yyyy";
            // dt.DateTimeFormat = dtf;
            // dt.MaximumValue = new DateTime(2020, 12, 31);
            // dt.MinimumValue = new DateTime(1950, 1, 1);
            // FpSpread1.ActiveSheetView.Cells[0, 0].CellType = dt;
            // FpSpread1.ActiveSheetView.Cells[0, 0].Value = DateTime.Now;
            //FpSpread1.ActiveSheetView.Cells[6, 2].CellType = dc;

            // OpenExcelTemplate();
        }
Пример #2
0
        public PromptsViewModel(string cutxFilePath,
                                string globalFilePath,
                                string cutpartsFilePath,
                                string edgebandFilePath,
                                string hardwareFilePath,
                                string doorstyleFilePath,
                                string name,
                                string imagePath,
                                double width,
                                double height,
                                double depth)
            : this()
        {
            this.Width            = width;
            this.Height           = height;
            this.Depth            = depth;
            this.Name             = name;
            this.ProductImagePath = imagePath + ".jpg";

            BookSet = SpreadHelper.GetProductBaseicBookSet(cutxFilePath, globalFilePath,
                                                           cutpartsFilePath, hardwareFilePath, doorstyleFilePath, edgebandFilePath);

            Book = BookSet.Workbooks["L"];
            var sheet = Book.Worksheets["Prompts"];

            PromptCells = sheet.Cells;

            loadCellPrompts();

            if (PromptTabs.Count == 0)
            {
                PromptTabs.Add("主标签");
            }

            //this.SpecificationGroups = project.SpecificationGroups;
            //this.SelectedSGroup = this.SpecificationGroups[0];
            //this.Qty = 1;

            //var fi = new FileInfo(cutxFilePath);
            //this.Description = fi.Name.Replace(fi.Extension, "");

            //this.ProductHandle = (new Random()).Next(1000000000, 1999999999).ToString();
        }