Exemplo n.º 1
0
        public ViewReport(IReport report, IskMultiplier valuesShown)
        {
            InitializeComponent();

            this.valuesShown = valuesShown;
            this.report = report;
            allowSort = report.GetAllowSort();

            BuildDataTable();

            view = new DataView(table);
            view.RowFilter = "Visible = 'True'";

            // Set a few things to improve performance...
            reportGrid.EnableHeadersVisualStyles = false;
            reportGrid.CellBorderStyle = DataGridViewCellBorderStyle.None;
            reportGrid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
            reportGrid.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None;

            reportGrid.DataSource = view;
            reportGrid.VirtualMode = true;

            // Clear the header text on the row headers column.
            reportGrid.Columns["RowHeaders"].HeaderText = "";
            // Make the row names, visible and expanded columns invisible.
            reportGrid.Columns["RowNames"].Visible = false;
            reportGrid.Columns["Visible"].Visible = false;
            reportGrid.Columns["Expanded"].Visible = false;
            // Set column header text.
            foreach (DataGridViewColumn column in reportGrid.Columns)
            {
                column.HeaderText = table.Columns[column.Name].Caption;
                column.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
            }
            // Add a column to hold the expand/collapse icons
            DataGridViewImageColumn expandersColumn = new DataGridViewImageColumn();
            expandersColumn.Name = "Expanders";
            expandersColumn.HeaderText = "";
            expandersColumn.DisplayIndex = 1;
            reportGrid.Columns.Add(expandersColumn);

            reportGrid.CellValueNeeded += new DataGridViewCellValueEventHandler(reportGrid_CellValueNeeded);
            reportGrid.CellClick += new DataGridViewCellEventHandler(reportGrid_CellClick);
            reportGrid.KeyDown += new KeyEventHandler(reportGrid_KeyDown);
            reportGrid.KeyUp += new KeyEventHandler(reportGrid_KeyUp);

            // Check if a logo is to be used and load it if needed.
            string logoFile = UserAccount.CurrentGroup.Settings.Rpt_LogoFile;
            if (!logoFile.Equals("") && File.Exists(logoFile))
            {
                imgLogo.Image = Image.FromFile(logoFile);
                int sideLength = Math.Min(180, Math.Max(imgLogo.Image.Width, imgLogo.Image.Height));
                imgLogo.Width = sideLength;
                imgLogo.Height = sideLength;
                imgLogo.Visible = true;
            }
            else
            {
                imgLogo.Visible = false;
            }
        }
Exemplo n.º 2
0
 private void cmbValuesIn_SelectedIndexChanged(object sender, EventArgs e)
 {
     showAmountsIn = (IskMultiplier)Enum.Parse(Type.GetType("EveMarketMonitorApp.Reporting.IskMultiplier"),
         cmbValuesIn.Text);
 }
Exemplo n.º 3
0
 private void ShowReport(IReport report, IskMultiplier showValues)
 {
     Cursor = Cursors.WaitCursor;
     try
     {
         ViewReport viewRptForm = new ViewReport(report, showValues);
         viewRptForm.MdiParent = this.MdiParent;
         viewRptForm.Show();
     }
     finally
     {
         Cursor = Cursors.Default;
     }
 }
Exemplo n.º 4
0
 public IskAmount(decimal amount, IskMultiplier outputValue)
 {
     this.amount = amount;
     outputMultiplier = outputValue;
 }