Exemplo n.º 1
0
        private bool Print()
        {
            string message;

            if (!CanPrint(out message))
            {
                AltUtil.ShowError(string.Format("Cannot print: {0}", message));
                return(false);
            }
            object          document = _owner.Document;
            C1Report        report   = document as C1Report;
            C1PrintDocument printDoc = report == null ? (C1PrintDocument)document : report.C1Document;
            PrinterSettings ps       = new PrinterSettings();

            ps.PrinterName = OutputFileName;
            if (!ps.IsValid)
            {
                return(false);
            }
            printDoc.Print(ps);
            return(true);
        }