public override void Imprimir()
        {
            using (internalReport = new Report())
            {
                PrepararImpressao();

                internalReport.RegisterData(Parent.NotasFiscais.ToArray(), "NotaFiscal");
                internalReport.Prepare();

                if (ShowDesign)
                {
                    internalReport.Design();
                }
                else
                {
                    switch (Filtro)
                    {
                    case FiltroDFeReport.Nenhum:
                        if (MostrarPreview)
                        {
                            internalReport.Show();
                        }
                        else
                        {
                            internalReport.Print();
                        }
                        break;

                    case FiltroDFeReport.PDF:
                        var evtPdf = new DANFSeExportEventArgs();
                        evtPdf.Export = new PDFExport
                        {
                            EmbeddingFonts  = true,
                            ShowProgress    = MostrarSetup,
                            OpenAfterExport = MostrarPreview
                        };

                        OnExport.Raise(this, evtPdf);
                        internalReport.Export(evtPdf.Export, NomeArquivo);
                        break;

                    case FiltroDFeReport.HTML:
                        var evtHtml = new DANFSeExportEventArgs();
                        evtHtml.Export = new HTMLExport()
                        {
                            Format        = HTMLExportFormat.MessageHTML,
                            EmbedPictures = true,
                            Preview       = MostrarPreview,
                            ShowProgress  = MostrarSetup
                        };

                        OnExport.Raise(this, evtHtml);
                        internalReport.Export(evtHtml.Export, NomeArquivo);
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }
                }

                internalReport.Dispose();
            }

            internalReport = null;
        }
        private void Imprimir(Stream stream)
        {
            using (internalReport = new Report())
            {
                PrepararImpressao();

                internalReport.RegisterData(Parent.NotasServico.ToArray(), "NotaServico");
                internalReport.Prepare();

                if (isDesign)
                {
                    internalReport.Design();
                }
                else
                {
                    switch (Filtro)
                    {
                    case FiltroDFeReport.Nenhum:
                        if (MostrarPreview)
                        {
                            internalReport.Show();
                        }
                        else
                        {
                            internalReport.Print();
                        }
                        break;

                    case FiltroDFeReport.PDF:
                        var evtPdf = new DANFSeExportEventArgs();
                        evtPdf.Export = new PDFExport
                        {
                            PdfCompliance   = PDFExport.PdfStandard.PdfA_1a,
                            ShowProgress    = MostrarSetup,
                            OpenAfterExport = MostrarPreview
                        };

                        OnExport.Raise(this, evtPdf);
                        if (stream.IsNull())
                        {
                            internalReport.Export(evtPdf.Export, NomeArquivo);
                        }
                        else
                        {
                            internalReport.Export(evtPdf.Export, stream);
                        }
                        break;

                    case FiltroDFeReport.HTML:
                        var evtHtml = new DANFSeExportEventArgs();
                        evtHtml.Export = new HTMLExport()
                        {
                            Format        = HTMLExportFormat.HTML,
                            EmbedPictures = true,
                            Preview       = MostrarPreview,
                            ShowProgress  = MostrarSetup
                        };

                        OnExport.Raise(this, evtHtml);
                        if (stream.IsNull())
                        {
                            internalReport.Export(evtHtml.Export, NomeArquivo);
                        }
                        else
                        {
                            internalReport.Export(evtHtml.Export, stream);
                        }
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }
                }

                internalReport.Dispose();
            }

            internalReport = null;
        }