Beispiel #1
0
        private void btnGridLines_Click(object sender, EventArgs e)
        {
            ExcelFile xls = flexCelImgExport1.Workbook;

            if (xls == null)
            {
                return;
            }

            if (cbAllSheets.Checked)
            {
                int SaveActiveSheet = xls.ActiveSheet;
                for (int sheet = 1; sheet <= xls.SheetCount; sheet++)
                {
                    xls.ActiveSheet    = sheet;
                    xls.PrintGridLines = btnGridLines.Checked;
                }
                xls.ActiveSheet = SaveActiveSheet;
            }
            else
            {
                xls.PrintGridLines = btnGridLines.Checked;
            }
            MainPreview.InvalidatePreview();
        }
Beispiel #2
0
        internal void LoadFile(string FileName)
        {
            openFileDialog.FileName = FileName;
            lbSheets.Items.Clear();

            XlsFile xls = new XlsFile();

            xls.HeadingColWidth        = -1;
            xls.HeadingRowHeight       = -1;
            xls.Protection.OnPassword += new OnPasswordEventHandler(GetPassword);
            xls.Open(FileName);

            for (int i = 1; i <= xls.SheetCount; i++)
            {
                lbSheets.Items.Add(xls.GetSheetName(i));
            }

            lbSheets.SelectedIndex = xls.ActiveSheet - 1;

            flexCelImgExport1.Workbook = xls;
            MainPreview.InvalidatePreview();
            Text = "Custom Preview: " + openFileDialog.FileName;
            //btnHeadings.Checked = flexCelImgExport1.Workbook.PrintHeadings;
            //btnGridLines.Checked = flexCelImgExport1.Workbook.PrintGridLines;
            btnFirst.Enabled     = true; btnPrev.Enabled = true; btnNext.Enabled = true; btnLast.Enabled = true; edPage.Enabled = true;
            btnZoomIn.Enabled    = true; edZoom.Enabled = true; btnZoomOut.Enabled = true;
            btnGridLines.Enabled = true; btnHeadings.Enabled = true; btnRecalc.Enabled = true; btnPdf.Enabled = true;
        }
Beispiel #3
0
 private void btnRecalc_Click(object sender, System.EventArgs e)
 {
     if (flexCelImgExport1.Workbook == null)
     {
         MessageBox.Show("Please open a file before recalculating.");
         return;
     }
     flexCelImgExport1.Workbook.Recalc(true);
     MainPreview.InvalidatePreview();
 }
Beispiel #4
0
 private void cbAllSheets_CheckedChanged(object sender, System.EventArgs e)
 {
     lbSheets.Visible      = !cbAllSheets.Checked;
     sheetSplitter.Visible = lbSheets.Visible;
     flexCelImgExport1.AllVisibleSheets = cbAllSheets.Checked;
     if (flexCelImgExport1.Workbook == null)
     {
         return;
     }
     MainPreview.InvalidatePreview();
 }
Beispiel #5
0
 private void lbSheets_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     if (flexCelImgExport1.Workbook == null)
     {
         return;
     }
     if (lbSheets.Items.Count > flexCelImgExport1.Workbook.SheetCount)
     {
         return;
     }
     flexCelImgExport1.Workbook.ActiveSheet = lbSheets.SelectedIndex + 1;
     MainPreview.InvalidatePreview();
 }