/// <summary> Constructor for a new instance of this class </summary> /// <param name="resultSet"> Results set to display </param> //public Results_Form(DataTable resultSet, ArrayList resultList, SobekCM_Item bibPackage) public Results_Form(DataTable resultSet, Importer_Type_Enum importerType, bool preview_mode ) { // Initialize this form InitializeComponent(); // Perform some additional work if this was not XP theme if (!Windows_Appearance_Checker.is_XP_Theme) { saveButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; printButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; closeButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; } // Save these values this.resultTable = resultSet; // Show the result set customGrid_Panel1.DataTable = resultSet; // Set some overall styles customGrid_Panel1.Style.Default_Column_Color = System.Drawing.Color.LightBlue; customGrid_Panel1.Style.Header_Back_Color = Color.DarkBlue; customGrid_Panel1.Style.Header_Fore_Color = Color.White; customGrid_Panel1.Style.Default_Column_Color = System.Drawing.Color.LightBlue; // assign the context menu to the custom grid this.customGrid_Panel1.Double_Clicked += new CustomGrid_Panel_Delegate_Single(this.customGrid_Panel1_Double_Clicked); this.customGrid_Panel1.ContextMenu = this.contextMenu1; // determine what should be displayed on the results form switch (importerType) { case Importer_Type_Enum.MARC: // set column styles for displaying the results table customGrid_Panel1.Style.Column_Styles[0].Visible = false; customGrid_Panel1.Style.Column_Styles[1].Header_Text = "Bib ID"; customGrid_Panel1.Style.Column_Styles[1].Fixed_Print_Width = 100; customGrid_Panel1.Style.Column_Styles[1].Width = 100; customGrid_Panel1.Style.Column_Styles[2].Header_Text = "VID"; customGrid_Panel1.Style.Column_Styles[2].Width = 70; customGrid_Panel1.Style.Column_Styles[2].Fixed_Print_Width = 65; customGrid_Panel1.Style.Column_Styles[3].Header_Text = "Comment"; customGrid_Panel1.Style.Column_Styles[3].Width = 200; customGrid_Panel1.Style.Column_Styles[4].Visible = false; customGrid_Panel1.Style.Column_Styles[5].Header_Text = "Aleph"; customGrid_Panel1.Style.Column_Styles[5].Width = 70; customGrid_Panel1.Style.Column_Styles[6].Header_Text = "OCLC"; customGrid_Panel1.Style.Column_Styles[6].Width = 70; customGrid_Panel1.Style.Column_Styles[7].Header_Text = "Bib Title"; customGrid_Panel1.Style.Column_Styles[7].Width = 300; customGrid_Panel1.Style.Column_Styles[7].BackColor = Color.White; customGrid_Panel1.Style.Column_Styles[8].Header_Text = "Volume Title"; customGrid_Panel1.Style.Column_Styles[8].Width = 300; customGrid_Panel1.Style.Column_Styles[8].BackColor = Color.White; customGrid_Panel1.Style.Column_Styles[9].Header_Text = "Author"; customGrid_Panel1.Style.Column_Styles[9].Width = 150; customGrid_Panel1.Style.Column_Styles[9].BackColor = Color.White; customGrid_Panel1.Style.Column_Styles[10].Header_Text = "Type"; customGrid_Panel1.Style.Column_Styles[10].Width = 70; customGrid_Panel1.Style.Column_Styles[11].Header_Text = "Project"; customGrid_Panel1.Style.Column_Styles[11].Width = 70; // set text on menu item this.detailsMenuItem.Text = "Show MARC XML"; this.detailsMenuItem_ContextMenuItem.Text = "Show MARC XML"; this.Text = "MARC Importer - Results Form"; break; case Importer_Type_Enum.METS: case Importer_Type_Enum.Spreadsheet: // set column styles for displaying the results table customGrid_Panel1.Style.Column_Styles[0].Visible = false; customGrid_Panel1.Style.Column_Styles[1].Header_Text = "Bib ID"; customGrid_Panel1.Style.Column_Styles[1].Width = 100; customGrid_Panel1.Style.Column_Styles[1].Fixed_Print_Width = 100; customGrid_Panel1.Style.Column_Styles[2].Header_Text = "VID"; customGrid_Panel1.Style.Column_Styles[2].Width = 70; customGrid_Panel1.Style.Column_Styles[2].Fixed_Print_Width = 65; customGrid_Panel1.Style.Column_Styles[3].Header_Text = "Comment"; customGrid_Panel1.Style.Column_Styles[3].Width = 200; customGrid_Panel1.Style.Column_Styles[4].Visible = false; customGrid_Panel1.Style.Column_Styles[5].Header_Text = "Aleph"; customGrid_Panel1.Style.Column_Styles[5].Width = 70; customGrid_Panel1.Style.Column_Styles[6].Header_Text = "OCLC"; customGrid_Panel1.Style.Column_Styles[6].Width = 70; customGrid_Panel1.Style.Column_Styles[7].Header_Text = "Bib Title"; customGrid_Panel1.Style.Column_Styles[7].Width = 300; customGrid_Panel1.Style.Column_Styles[7].BackColor = Color.White; customGrid_Panel1.Style.Column_Styles[8].Header_Text = "Volume Title"; customGrid_Panel1.Style.Column_Styles[8].Width = 300; customGrid_Panel1.Style.Column_Styles[8].BackColor = Color.White; customGrid_Panel1.Style.Column_Styles[9].Header_Text = "Author"; customGrid_Panel1.Style.Column_Styles[9].Width = 150; customGrid_Panel1.Style.Column_Styles[9].BackColor = Color.White; customGrid_Panel1.Style.Column_Styles[10].Header_Text = "Type"; customGrid_Panel1.Style.Column_Styles[10].Width = 70; customGrid_Panel1.Style.Column_Styles[11].Header_Text = "Project"; customGrid_Panel1.Style.Column_Styles[11].Width = 70; // set text on menu item this.detailsMenuItem.Text = "Show METS"; this.detailsMenuItem_ContextMenuItem.Text = "Show METS"; if ( importerType == Importer_Type_Enum.METS ) this.Text = "METS Importer - Results Form"; else this.Text = "SpreadSheet Importer - Results Form"; break; } if (preview_mode) { this.Text = this.Text + " (PREVIEW ONLY!)"; } // Set the default print as landscape printDocument1.DefaultPageSettings.Landscape = true; // Create the object to print the grid gridPrinter = new CustomGrid_Printer( customGrid_Panel1, printDocument1 ); }
/// <summary> Constructor for a new instance of this class </summary> /// <param name="resultSet"> Results set to display </param> //public Results_Form(DataTable resultSet, ArrayList resultList, SobekCM_Item bibPackage) public Results_Form(DataTable resultSet, Importer_Type_Enum importerType, bool preview_mode) { // Initialize this form InitializeComponent(); // Perform some additional work if this was not XP theme if (!Windows_Appearance_Checker.is_XP_Theme) { saveButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; printButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; closeButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; } // Save these values this.resultTable = resultSet; // Show the result set customGrid_Panel1.DataTable = resultSet; // Set some overall styles customGrid_Panel1.Style.Default_Column_Color = System.Drawing.Color.LightBlue; customGrid_Panel1.Style.Header_Back_Color = Color.DarkBlue; customGrid_Panel1.Style.Header_Fore_Color = Color.White; customGrid_Panel1.Style.Default_Column_Color = System.Drawing.Color.LightBlue; // assign the context menu to the custom grid this.customGrid_Panel1.Double_Clicked += new CustomGrid_Panel_Delegate_Single(this.customGrid_Panel1_Double_Clicked); this.customGrid_Panel1.ContextMenu = this.contextMenu1; // determine what should be displayed on the results form switch (importerType) { case Importer_Type_Enum.MARC: // set column styles for displaying the results table customGrid_Panel1.Style.Column_Styles[0].Visible = false; customGrid_Panel1.Style.Column_Styles[1].Header_Text = "Bib ID"; customGrid_Panel1.Style.Column_Styles[1].Fixed_Print_Width = 100; customGrid_Panel1.Style.Column_Styles[1].Width = 100; customGrid_Panel1.Style.Column_Styles[2].Header_Text = "VID"; customGrid_Panel1.Style.Column_Styles[2].Width = 70; customGrid_Panel1.Style.Column_Styles[2].Fixed_Print_Width = 65; customGrid_Panel1.Style.Column_Styles[3].Header_Text = "Comment"; customGrid_Panel1.Style.Column_Styles[3].Width = 200; customGrid_Panel1.Style.Column_Styles[4].Visible = false; customGrid_Panel1.Style.Column_Styles[5].Header_Text = "Aleph"; customGrid_Panel1.Style.Column_Styles[5].Width = 70; customGrid_Panel1.Style.Column_Styles[6].Header_Text = "OCLC"; customGrid_Panel1.Style.Column_Styles[6].Width = 70; customGrid_Panel1.Style.Column_Styles[7].Header_Text = "Bib Title"; customGrid_Panel1.Style.Column_Styles[7].Width = 300; customGrid_Panel1.Style.Column_Styles[7].BackColor = Color.White; customGrid_Panel1.Style.Column_Styles[8].Header_Text = "Volume Title"; customGrid_Panel1.Style.Column_Styles[8].Width = 300; customGrid_Panel1.Style.Column_Styles[8].BackColor = Color.White; customGrid_Panel1.Style.Column_Styles[9].Header_Text = "Author"; customGrid_Panel1.Style.Column_Styles[9].Width = 150; customGrid_Panel1.Style.Column_Styles[9].BackColor = Color.White; customGrid_Panel1.Style.Column_Styles[10].Header_Text = "Type"; customGrid_Panel1.Style.Column_Styles[10].Width = 70; customGrid_Panel1.Style.Column_Styles[11].Header_Text = "Project"; customGrid_Panel1.Style.Column_Styles[11].Width = 70; // set text on menu item this.detailsMenuItem.Text = "Show MARC XML"; this.detailsMenuItem_ContextMenuItem.Text = "Show MARC XML"; this.Text = "MARC Importer - Results Form"; break; case Importer_Type_Enum.METS: case Importer_Type_Enum.Spreadsheet: // set column styles for displaying the results table customGrid_Panel1.Style.Column_Styles[0].Visible = false; customGrid_Panel1.Style.Column_Styles[1].Header_Text = "Bib ID"; customGrid_Panel1.Style.Column_Styles[1].Width = 100; customGrid_Panel1.Style.Column_Styles[1].Fixed_Print_Width = 100; customGrid_Panel1.Style.Column_Styles[2].Header_Text = "VID"; customGrid_Panel1.Style.Column_Styles[2].Width = 70; customGrid_Panel1.Style.Column_Styles[2].Fixed_Print_Width = 65; customGrid_Panel1.Style.Column_Styles[3].Header_Text = "Comment"; customGrid_Panel1.Style.Column_Styles[3].Width = 200; customGrid_Panel1.Style.Column_Styles[4].Visible = false; customGrid_Panel1.Style.Column_Styles[5].Header_Text = "Aleph"; customGrid_Panel1.Style.Column_Styles[5].Width = 70; customGrid_Panel1.Style.Column_Styles[6].Header_Text = "OCLC"; customGrid_Panel1.Style.Column_Styles[6].Width = 70; customGrid_Panel1.Style.Column_Styles[7].Header_Text = "Bib Title"; customGrid_Panel1.Style.Column_Styles[7].Width = 300; customGrid_Panel1.Style.Column_Styles[7].BackColor = Color.White; customGrid_Panel1.Style.Column_Styles[8].Header_Text = "Volume Title"; customGrid_Panel1.Style.Column_Styles[8].Width = 300; customGrid_Panel1.Style.Column_Styles[8].BackColor = Color.White; customGrid_Panel1.Style.Column_Styles[9].Header_Text = "Author"; customGrid_Panel1.Style.Column_Styles[9].Width = 150; customGrid_Panel1.Style.Column_Styles[9].BackColor = Color.White; customGrid_Panel1.Style.Column_Styles[10].Header_Text = "Type"; customGrid_Panel1.Style.Column_Styles[10].Width = 70; customGrid_Panel1.Style.Column_Styles[11].Header_Text = "Project"; customGrid_Panel1.Style.Column_Styles[11].Width = 70; // set text on menu item this.detailsMenuItem.Text = "Show METS"; this.detailsMenuItem_ContextMenuItem.Text = "Show METS"; if (importerType == Importer_Type_Enum.METS) { this.Text = "METS Importer - Results Form"; } else { this.Text = "SpreadSheet Importer - Results Form"; } break; } if (preview_mode) { this.Text = this.Text + " (PREVIEW ONLY!)"; } // Set the default print as landscape printDocument1.DefaultPageSettings.Landscape = true; // Create the object to print the grid gridPrinter = new CustomGrid_Printer(customGrid_Panel1, printDocument1); }