/// <summary>
        /// Export to PDF
        /// </summary>
        public void ExportToPDF()
        {
            // If there are no rows in the grid then we cannot export
            if (this.applicationsDataSet.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("There is no data to Export", "Export Error");
            }

            else
            {
                // We need to temporarily set the grid view to 'Resize all columns' in order to get
                // the resultant PDF file formatted correctly.
                AutoFitStyle oldStyle = applicationsGridView.DisplayLayout.AutoFitStyle;
                applicationsGridView.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;

                // First browse for the folder / file that we will save
                SaveFileDialog saveFileDialog = new SaveFileDialog();
                saveFileDialog.ValidateNames = false;
                saveFileDialog.FileName      = headerLabel.Text + ".pdf";
                saveFileDialog.Filter        = "Adobe Acrobat Document (*.pdf)|*.pdf";

                if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
                {
                    UltraGridDocumentExporter exporter = new UltraGridDocumentExporter();
                    exporter.Export(applicationsGridView, saveFileDialog.FileName, GridExportFileFormat.PDF);
                    DesktopAlert.ShowDesktopAlert("Data successfully exported to '" + saveFileDialog.FileName + "'");
                }

                // Populate the old autofit style
                this.applicationsGridView.DisplayLayout.AutoFitStyle = oldStyle;
            }
        }
Example #2
0
        /// <summary>
        /// Export to PDF
        /// </summary>
        public void ExportToPDF()
        {
            // If there are no rows in the grid then we cannot export
            if (this._currentGrid.Rows.Count == 0)
            {
                MessageBox.Show("There is no data to Export", "Export Error");
            }

            else
            {
                // We need to temporarily set the grid view to 'Resize all columns' in order to get
                // the resultant PDF file formatted correctly.
                AutoFitStyle oldStyle = _currentGrid.DisplayLayout.AutoFitStyle;
                _currentGrid.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;

                // First browse for the folder / file that we will save
                SaveFileDialog saveFileDialog = new SaveFileDialog();
                saveFileDialog.ValidateNames = false;
                saveFileDialog.FileName      = "AuditWizardData.pdf";
                saveFileDialog.Filter        = "Adobe Acrobat Document (*.pdf)|*.pdf";

                if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
                {
                    UltraGridExporter.Export(saveFileDialog.FileName
                                             , ""
                                             , ""
                                             , ""
                                             , _currentGrid
                                             , Infragistics.Documents.Reports.Report.FileFormat.PDF);

                    DesktopAlert.ShowDesktopAlert("Data successfully exported to '" + saveFileDialog.FileName + "'");
                }

                // Populate the old autofit style
                this._currentGrid.DisplayLayout.AutoFitStyle = oldStyle;
            }
        }
Example #3
0
        /// <summary>
        /// Export to PDF
        /// </summary>
        public void ExportToPDF()
        {
            // If there are no rows in the grid then we cannot export
            if (this.OSDataSet.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("There is no data to Export", "Export Error");
            }

            else
            {
                // We need to temporarily set the grid view to 'Resize all columns' in order to get
                // the resultant PDF file formatted correctly.
                AutoFitStyle oldStyle = OSGridView.DisplayLayout.AutoFitStyle;
                OSGridView.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;

                // First browse for the folder / file that we will save
                SaveFileDialog saveFileDialog = new SaveFileDialog();
                saveFileDialog.ValidateNames = false;
                saveFileDialog.FileName      = headerLabel.Text + ".pdf";
                saveFileDialog.Filter        = "Adobe Acrobat Document (*.pdf)|*.pdf";

                if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
                {
                    UltraGridExporter.Export(saveFileDialog.FileName
                                             , "AuditWizard Applications View : " + OSGridView.Text
                                             , "Generated by AuditWizard from Layton Technology, Inc."
                                             , DataStrings.Disclaimer
                                             , OSGridView
                                             , Infragistics.Documents.Reports.Report.FileFormat.PDF);
                    DesktopAlert.ShowDesktopAlert("Data successfully exported to '" + saveFileDialog.FileName + "'");
                }

                // Populate the old autofit style
                this.OSGridView.DisplayLayout.AutoFitStyle = oldStyle;
            }
        }
Example #4
0
 public void SetGridColumnStyle(UltraGrid ug_list, AutoFitStyle style)
 {
     ug_list.DisplayLayout.AutoFitStyle = style;
 }