public ActionResult PrintCitizen(string jsonString)
        {
            List <Citizen> Citizens = JsonConvert.DeserializeObject <List <Citizen> >(jsonString);

            Report report = new Report();

            report.Load($"{AppDomain.CurrentDomain.BaseDirectory}Reports\\Citizens.frx");
            report.RegisterData(Citizens, "Citizens");
            report.Prepare();
            //report.Design();

            var exportPDF = new PDFExport();
            var ms        = new MemoryStream {
                Position = 0
            };

            exportPDF.Export(report, ms);
            ms.Flush();
            ms.Close();

            string destinationFileName = Convert.ToBase64String(ms.ToArray());

            ms.Close();

            return(Json(destinationFileName));

            //return Json(null);
        }
Example #2
0
        private void btnSilentExport_Click(object sender, EventArgs e)
        {
#if USER_MANAGE_FONTS
            TrueTypeCollection.OnRequestFontData += new RequestFontHandler(LoadFontStream);
#elif true
            TrueTypeCollection.OnGetFontPath += new GetFontPathHandler(GetFontPath);
#endif

            // create report instance
            Report report = new Report();

            // load the existing report
            report.Load(@"../../report.frx");

            // register the dataset
            report.RegisterData(fontList);

            // run the report
            report.Prepare();

            // create export instance
            PDFExport export = new PDFExport();
            export.AllowOpenAfter  = true;
            export.EmbeddingFonts  = true;
            export.OpenAfterExport = true;

            // export the report
            report.Export(export, "result.pdf");

            TrueTypeCollection.OnGetFontPath -= GetFontPath;

            // free resources used by report
            report.Dispose();
        }
Example #3
0
        private void miReports_Click(object sender, EventArgs e)
        {
            CreateDataSet();
            // Form8 frm = new Form8();
            //  frm.ShowDialog();
            // create report instance
            Report report = new Report();

            // load the existing report
            report.Load(@"..\..\..\report.frx");

            // register the dataset
            report.RegisterData(FDataSet);

            // run the report
            report.Prepare();

            // create export instance
            PDFExport export = new PDFExport();

            export.Export(report);

            // free resources used by report
            report.Dispose();
        }
Example #4
0
        static void Main(string[] args)
        {
            Report report = new Report();

            report.Load(@"C:\Users\Dima\Desktop\FR\frx\1.frx");

            //report.InitialPageNumber = 1;

            RichObject rich = new RichObject();

            try
            {
                using (StreamReader reader = new StreamReader(@"C:\Users\Dima\Desktop\Новый документ в формате RTF.RTF", Encoding.Default))
                {
                    rich.Text = reader.ReadToEnd();
                    reader.Close();
                }
            }
            catch (Exception)
            {
            }

            Console.WriteLine(rich.Text);

            report.SetParameterValue("Parameter.Parameter", rich.Text);

            report.Prepare();

            PDFExport export = new PDFExport();

            report.Export(export, "result.pdf");

            report.Dispose();
            Console.ReadKey();
        }
        public ActionResult getReport(string from, string to, string prod)
        {
            string    lang = Session["T_LANG"].ToString();
            DataTable dt   = repository.getReport(lang, from, to, prod);

            dt.TableName = "R12016";
            //dt.WriteXmlSchema(Server.MapPath("~/Report/xml/R12016.xml"));
            //return View();
            using (var Report = new FastReport.Report())
            {
                Report.Report.Load(Server.MapPath("~/Report/Report/R12016.frx"));
                Report.Report.RegisterData(dt, "R12016");
                Report.Report.Prepare();
                using (var strm = new MemoryStream())
                {
                    var pdfExport = new PDFExport();
                    Report.Export(pdfExport, strm);
                    Response.ClearContent();
                    Response.ClearHeaders();
                    Response.Buffer      = true;
                    Response.ContentType = "Application/PDF";
                    Response.BinaryWrite(strm.ToArray());
                    Response.End();
                }
                ViewBag.WebReport = Report;
            }

            return(View());
        }
Example #6
0
        public static bool ExportToPdf(Report report)
        {
            bool exported = false;

            try
            {
                var webReport = GetPreview(HttpContext.Current, report.ConnectionString, report.DatabaseType, report.Query, report.Id.ToString());

                webReport.Report.Prepare();
                PDFExport pdfExport = new PDFExport();
                pdfExport.ShowProgress   = false;
                pdfExport.Compressed     = true;
                pdfExport.AllowPrint     = true;
                pdfExport.EmbeddingFonts = true;

                Extend.OpenNetworkConnection(networkFilePath =>
                {
                    webReport.Report.Export(pdfExport, @networkFilePath + "/" + report.Id + ".pdf");
                    exported = true;
                });
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }

            return(exported);
        }
Example #7
0
        public override void Init(ExportBase export)
        {
            base.Init(export);
            PDFExport pdfExport = Export as PDFExport;

            cbCompressed.Checked     = pdfExport.Compressed;
            cbEmbedded.Checked       = pdfExport.EmbeddingFonts;
            cbBackground.Checked     = pdfExport.Background;
            cbPrintOptimized.Checked = pdfExport.PrintOptimized;
            tbTitle.Text             = pdfExport.Title;
            tbAuthor.Text            = pdfExport.Author;
            tbSubject.Text           = pdfExport.Subject;
            tbKeywords.Text          = pdfExport.Keywords;
            tbCreator.Text           = pdfExport.Creator;
            tbProducer.Text          = pdfExport.Producer;

            tbOwnerPassword.Text            = pdfExport.OwnerPassword;
            tbUserPassword.Text             = pdfExport.UserPassword;
            cbPrintTheDocument.Checked      = pdfExport.AllowPrint;
            cbModifyTheDocument.Checked     = pdfExport.AllowModify;
            cbCopyOfTextAndGraphics.Checked = pdfExport.AllowCopy;
            cbAnnotations.Checked           = pdfExport.AllowAnnotate;

            cbHideToolbar.Checked  = pdfExport.HideToolbar;
            cbHideMenubar.Checked  = pdfExport.HideMenubar;
            cbHideUI.Checked       = pdfExport.HideWindowUI;
            cbFitWindow.Checked    = pdfExport.FitWindow;
            cbCenterWindow.Checked = pdfExport.CenterWindow;
            cbPrintScaling.Checked = pdfExport.PrintScaling;
            cbOutline.Checked      = pdfExport.Outline;

            // not implemented yet
            //pageControlSecurity.Parent = null;
            cbOutline.Visible = false;
        }
Example #8
0
        private void EmailPDF_Click(object sender, RoutedEventArgs e)
        {
            PDFExport pdf = new PDFExport();
            string    filename;

            Stone stone = StonesView.GetCurrentSelectedStone();

            if (stone.MediaType == 2)
            {
                MessageBox.Show("You can't create PDF for a video");

                return;
            }

            if (stone != null)
            {
                filename = pdf.CreateRawPDFinTemp(stone);
                if (!String.IsNullOrWhiteSpace(filename))
                {
                    List <string> files = new List <string>();
                    files.Add(stone.FullFilePath);
                    files.Add(filename);
                    SharingUtils.OpenNewEmailWithOutlook(files);
                }
            }
        }
Example #9
0
        protected override void Done()
        {
            base.Done();
            PDFExport pdfExport = Export as PDFExport;

            pdfExport.Compressed     = cbCompressed.Checked;
            pdfExport.EmbeddingFonts = cbEmbedded.Checked;
            pdfExport.Background     = cbBackground.Checked;
            pdfExport.PrintOptimized = cbPrintOptimized.Checked;
            pdfExport.Title          = tbTitle.Text;
            pdfExport.Author         = tbAuthor.Text;
            pdfExport.Subject        = tbSubject.Text;
            pdfExport.Keywords       = tbKeywords.Text;
            pdfExport.Creator        = tbCreator.Text;
            pdfExport.Producer       = tbProducer.Text;

            pdfExport.OwnerPassword = tbOwnerPassword.Text;
            pdfExport.UserPassword  = tbUserPassword.Text;
            pdfExport.AllowPrint    = cbPrintTheDocument.Checked;
            pdfExport.AllowModify   = cbModifyTheDocument.Checked;
            pdfExport.AllowCopy     = cbCopyOfTextAndGraphics.Checked;
            pdfExport.AllowAnnotate = cbAnnotations.Checked;

            pdfExport.HideToolbar  = cbHideToolbar.Checked;
            pdfExport.HideMenubar  = cbHideMenubar.Checked;
            pdfExport.HideWindowUI = cbHideUI.Checked;
            pdfExport.FitWindow    = cbFitWindow.Checked;
            pdfExport.CenterWindow = cbCenterWindow.Checked;
            pdfExport.PrintScaling = cbPrintScaling.Checked;
            pdfExport.Outline      = cbOutline.Checked;
        }
Example #10
0
        //导出
        void UCReport_ExportEvent(object sender, EventArgs e)
        {
            string fileName = GetDefaultStyleFile();

            // create report instance
            FastReport.Report report = new FastReport.Report();
            if (!string.IsNullOrEmpty(fileName))
            {
                report.Load(fileName);
                report.RegisterData(dt, styleObject);
            }
            else
            {
                Report.FastReportEx reportEx = new Report.FastReportEx();
                reportEx.dicSpanRows = dicSpanRows;
                reportEx.dt          = dt;
                reportEx.styleObject = styleObject;
                reportEx.styleTitle  = styleTitle;
                report = reportEx.DefaultReport();
            }
            if (report == null)
            {
                return;
            }
            report.Prepare();
            PDFExport export = new PDFExport();

            export.Export(report);
            report.Dispose();
        }
Example #11
0
        public string ExportToFile(Report report)
        {
            ExportBase export   = null;
            string     fileName = Path.GetTempPath() + @"\_rpt" + DateTime.Now.ToString("yyyyMMddhhmmss") + "_" + Loginer.CurrentUser.Account;

            if (ExportType.IMG == _exportType)
            {
                fileName = fileName + ".png";
                export   = new ImageExport();
                (export as ImageExport).ImageFormat = ImageExportFormat.Png;
            }
            else if (ExportType.PDF == _exportType)
            {
                fileName = fileName + ".pdf";
                export   = new PDFExport();
            }
            else if (ExportType.XLS == _exportType)
            {
                fileName = fileName + ".xls";
                export   = new XMLExport();
            }
            else if (ExportType.HTML == _exportType)
            {
                fileName = fileName + ".html";
                export   = new HTMLExport();
            }

            export.AllowOpenAfter = false;
            report.Export(export, fileName);

            return(fileName);
        }
Example #12
0
        private async void Create_Clicked(object sender, EventArgs e)
        {
            List <Monate>     monate     = new List <Monate>();
            List <Status>     status     = new List <Status>();
            IDataStore <Item> DataStore  = DependencyService.Get <IDataStore <Item> >();
            List <Item>       items      = new List <Item>();
            Boolean           exportGeb  = (TaufButton.BackgroundColor != Color.LightGreen);
            Boolean           exportTauf = (GebButton.BackgroundColor != Color.LightGreen);

            for (int i = 0; i < buttonList.Count; i++)
            {
                if (buttonList[i].BackgroundColor == Color.LightGreen)
                {
                    if (i < 12)
                    {
                        monate.Add((Monate)i);
                    }
                    else
                    {
                        status.Add((Status)(i - 12));
                    }
                }
            }
            foreach (var item in await DataStore.GetItemsAsync())
            {
                if (status.Contains(item.realStatus))
                {
                    items.Add(item);
                }
            }
            FileInfo file = null;

            if (MonatsButton.BackgroundColor == Color.LightGreen)
            {
                if (monate.Count == 0)
                {
                    await this.DisplayAlert("Keinen Monat ausgewählt", "Für den Export muss mindestens ein Monat ausgewählt sein", "OK");

                    return;
                }
                else if (status.Count == 0)
                {
                    await this.DisplayAlert("Keinen Status ausgeählt", "Für den Export muss mindestens ein Status ausgewählt sein", "OK");

                    return;
                }
                file = new PDFExport().ExportAsPDF(items, monate, exportGeb, exportTauf);
            }
            else
            {
                file = new PDFExport().ExportAsPDF(items, (GemVorButton.BackgroundColor == Color.LightGreen));
            }
            await Launcher.OpenAsync(new OpenFileRequest
            {
                File = new ReadOnlyFile(file.FullName)
            });
        }
Example #13
0
        private async void Export_Clicked(object sender, EventArgs e)
        {
            FileInfo file = new PDFExport().ExportMonthAsPDF(viewModel.Geburtstagskinder.ToList(), viewModel.Taufkinder.ToList(), viewModel.Month);

            await Launcher.OpenAsync(new OpenFileRequest
            {
                File = new ReadOnlyFile(file.FullName)
            });
        }
        private void Imprimir()
        {
            internalReport.Prepare();

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

                case FiltroDFeReport.PDF:
                    var pdfExport = new PDFExport
                    {
                        EmbeddingFonts  = true,
                        ShowProgress    = MostrarSetup,
                        PdfCompliance   = PDFExport.PdfStandard.PdfA_3b,
                        OpenAfterExport = MostrarPreview
                    };

                    internalReport.Export(pdfExport, NomeArquivo);
                    break;

                case FiltroDFeReport.HTML:
                    var htmlExport = new HTMLExport
                    {
                        Format        = HTMLExportFormat.MessageHTML,
                        EmbedPictures = true,
                        Preview       = MostrarPreview,
                        ShowProgress  = MostrarSetup
                    };

                    internalReport.Export(htmlExport, NomeArquivo);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }

            internalReport.Dispose();
            internalReport = null;
        }
        public byte[] PrintResultPDF(string userNo)
        {
            try
            {
                Config.WebMode = true;
                Report rep = new Report();
                rep.Load(Server.MapPath("~/App_Data/rptResult.frx"));

                using (VShapeUpDataContext _context = new VShapeUpDataContext())
                {
                    var data = (from x in _context.V_ChallengeResult_Reports
                                where x.UserNo == userNo
                                select x).ToList().ToDataTable();

                    rep.RegisterData(data, "Report");
                    DataBand band = rep.FindObject("Data") as DataBand;
                    band.DataSource = rep.GetDataSource("Report");
                }

                if (rep.Report.Prepare())
                {
                    PDFExport pdfExport = new PDFExport();
                    pdfExport.ShowProgress   = false;
                    pdfExport.Compressed     = true;
                    pdfExport.AllowPrint     = true;
                    pdfExport.EmbeddingFonts = true;

                    MemoryStream strm = new MemoryStream();
                    rep.Report.Export(pdfExport, strm);
                    rep.Dispose();
                    pdfExport.Dispose();
                    strm.Position = 0;

                    return(strm.ToArray());


                    //ImageExport export = new ImageExport();
                    //MemoryStream strm = new MemoryStream();
                    //rep.Report.Export(export, strm);
                    //rep.Dispose();
                    //export.Dispose();
                    //strm.Position = 0;

                    //return strm.ToArray();
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
        //getDate
        public ActionResult getReport(string fromDate, string toDate)
        {
            var    site = Session["T_SITE_CODE"].ToString();
            string lang = Session["T_LANG"].ToString();

            DataTable dtInfor   = repository.GetInforData(site, lang);
            DataTable dtDetails = repository.GetDetails(site, fromDate, toDate);

            //DataTable dtUnitInfo = repository.GetR12215CollectedUnit(site, entryDate);

            dtInfor.TableName   = "R12260Infor";
            dtDetails.TableName = "R12260Details";
            // dtUnitInfo.TableName = "R12215UnitInfo";

            DataSet dSet = new DataSet();

            dSet.Tables.Add(dtInfor);
            dSet.Tables.Add(dtDetails);
            // dSet.Tables.Add(dtUnitInfo);


            // dSet.WriteXmlSchema(Server.MapPath("~/Report/xml/R12260.xml"));

            // return View();
            using (var webReport = new FastReport.Report())
            {
                webReport.Report.Load(Server.MapPath("~/Report/Report/R12260.frx"));
                //webReport.Report.Load(Server.MapPath("~/Report/Report/R12260_Test.frx"));
                webReport.RegisterData(dtInfor, "R12260Infor");
                webReport.RegisterData(dtDetails, "R12260Details");
                webReport.Report.SetParameterValue("FromDate", fromDate);
                webReport.Report.SetParameterValue("ToDate", toDate);
                // webReport.RegisterData(dtUnitInfo, "R12215UnitInfo");

                webReport.Report.Prepare();

                using (var report = new MemoryStream())
                {
                    var pdfExport = new PDFExport();
                    webReport.Export(pdfExport, report);

                    Response.ClearContent();
                    Response.ClearHeaders();
                    Response.Buffer      = true;
                    Response.ContentType = "Application/PDF";
                    Response.BinaryWrite(report.ToArray());
                    Response.End();
                }

                ViewBag.ReportR12215 = webReport;
            }

            return(View());
        }
Example #17
0
        /// <summary>
        /// Converte o DANFE para PDF e copia para o stream
        /// </summary>
        /// <param name="outputStream">Variável do tipo Stream para output</param>
        public void ExportarPdf(Stream outputStream, bool progress = true)
        {
            Relatorio.Prepare();
            var varPDFExport = new PDFExport()
            {
                ShowProgress = progress
            };

            Relatorio.Export(varPDFExport, outputStream);
            outputStream.Position = 0;
        }
Example #18
0
        /// <summary>
        /// Converte o DANFE para PDF e salva-o no caminho/arquivo indicado
        /// </summary>
        /// <param name="arquivo">Caminho/arquivo onde deve ser salvo o PDF do DANFE</param>
        /// <param name="progress">Padrão True. Mostra a barra de progresso de geração do PDF. </param>
        public void ExportarPdf(string arquivo, bool progress = true)
        {
            FastReport.Utils.Config.ReportSettings.ShowProgress = progress;
            Relatorio.Prepare();
            var varPDFExport = new PDFExport()
            {
                ShowProgress = progress
            };

            Relatorio.Export(varPDFExport, arquivo);
        }
        public ActionResult getR12065_Report(string patno)
        {
            // string siteCode = Session["T_SITE_CODE"].ToString();
            DataTable dt = repository.getR12065_Report(patno);


            dt.TableName = "R12065";
            //dt_1.TableName = "R12302_xmatchHistory";
            //T12302_Site_.TableName = "R12302_Site";

            // DataSet ds = new DataSet();
            // ds.Tables.Add(dt);
            // ds.Tables.Add(dt_1);
            //ds.Tables.Add(T12302_Site_);
            //foreach (DataTable V in dt.Rows)
            //{

            //}
            //----------- for barcode start-----------------
            dt.Columns.Add("Pat_BarCode", typeof(Bitmap));
            Image myimg = Code128Rendering.MakeBarcodeImage(dt.Rows[0]["T_UNIT_NO"].ToString(), int.Parse("2"), true);

            dt.Rows[0]["Pat_BarCode"] = myimg;
            //----------- for barcode end-----------------


            //dt.WriteXmlSchema(Server.MapPath("~/Report/xml/R12065.xml"));
            // return View();
            using (var Report = new FastReport.Report())
            {
                Report.Report.Load(Server.MapPath("~/Report/Report/R12065.frx"));
                System.Data.DataSet dataSet = new System.Data.DataSet();
                Report.Report.RegisterData(dt, "R12065");

                //Report.Report.RegisterData(dt_1, "R12302_xmatchHistory");
                // Report.Report.RegisterData(T12302_Site_, "R12302_Site");
                Report.Report.Prepare();
                using (var strm = new MemoryStream())
                {
                    var pdfExport = new PDFExport();
                    Report.Export(pdfExport, strm);
                    Response.ClearContent();
                    Response.ClearHeaders();
                    Response.Buffer      = true;
                    Response.ContentType = "Application/PDF";
                    Response.BinaryWrite(strm.ToArray());
                    Response.End();
                }
                ViewBag.WebReport = Report;
            }

            return(View());
        }
Example #20
0
        /// <summary>
        /// Converte o DAMDFe para PDF e copia para o stream
        /// </summary>
        /// <param name="outputStream">Variável do tipo Stream para output</param>
        /// <param name="progress">Padrão True. Mostra a barra de progresso de geração do PDF. </param>
        public void ExportarPdf(Stream outputStream, bool progress = true)
        {
            FastReport.Utils.Config.ReportSettings.ShowProgress = progress;
            Relatorio.Prepare();
            var varPDFExport = new PDFExport()
            {
                ShowProgress = progress
            };

            Relatorio.Export(varPDFExport, outputStream);
            outputStream.Position = 0;
        }
        public ActionResult UNIT_Report_R12219(string entryDate)
        {
            int    site = Convert.ToInt32(Session["T_SITE_CODE"].ToString());
            string lang = Session["T_LANG"].ToString();

            DataTable dtSite     = repository_R12215.GetR12215SiteCode(site, lang);
            DataTable dtSummery  = repository_R12215.GetR12215Summery(entryDate, site, entryDate);
            DataTable dtUnitInfo = repository_R12215.GetR12215CollectedUnit(site, entryDate);

            dtSite.TableName     = "R12215Site";
            dtSummery.TableName  = "R12215Summery";
            dtUnitInfo.TableName = "R12215UnitInfo";

            DataSet dSet = new DataSet();

            dSet.Tables.Add(dtSite);
            dSet.Tables.Add(dtSummery);
            dSet.Tables.Add(dtUnitInfo);


            //dSet.WriteXmlSchema(Server.MapPath("~/Report/xml/R12215.xml"));


            using (var webReport = new FastReport.Report())
            {
                webReport.Report.Load(Server.MapPath("~/Report/Report/R12215.frx"));

                webReport.RegisterData(dtSite, "R12215Site");
                webReport.RegisterData(dtSummery, "R12215Summery");
                webReport.RegisterData(dtUnitInfo, "R12215UnitInfo");

                webReport.Report.Prepare();

                using (var report = new MemoryStream())
                {
                    var pdfExport = new PDFExport();
                    webReport.Export(pdfExport, report);

                    Response.ClearContent();
                    Response.ClearHeaders();
                    Response.Buffer      = true;
                    Response.ContentType = "Application/PDF";
                    Response.BinaryWrite(report.ToArray());
                    Response.End();
                }

                ViewBag.ReportR12215 = webReport;
            }

            return(View());
        }
Example #22
0
        public string ImprimirReporte()
        {
            PDFExport pdf       = new PDFExport();
            DataUtils datautils = new DataUtils();

            System.Data.DataTable dtbdatos = new DataTable();
            System.Data.DataSet   dst      = new DataSet();
            dtbdatos.TableName = "Tareas";
            dtbdatos           = datautils.ToDataTable <tb_Tarea>(this.Listar());
            dst.Tables.Add(dtbdatos);
            string filename = pdf.SavePDF(dst, "Listado de Tareas", null);

            return(filename);
        }
        public ActionResult GetReport(string donTiFrom, string donTiTo, string siteCode, string bloodGrp, string product)
        {
            var dtT12025 = repository.GetReport(Session["T_LANG"].ToString(), donTiFrom, donTiTo, siteCode, bloodGrp, product);

            dtT12025.TableName = "T12025";

            //----------- for barcode start-----------------
            // dtT12025.Columns.Add("Pat_BarCode", typeof(Bitmap));
            // Image myimg = Code128Rendering.MakeBarcodeImage(dtT12204.Rows[0]["T_BAG_BARCODE"].ToString(), int.Parse("2"), true);
            //  dtT12025.Rows[0]["Pat_BarCode"] = myimg;
            //----------- for barcode end-----------------

            // dtT12204.Columns.Add("Time", typeof(string));
            //dtT12204.Rows[0]["Time"] = Session["Hou_Min"].ToString();

            // dtT12025.WriteXmlSchema(Server.MapPath("~/Report/xml/T12025.xml"));
            //  return View();
            using (var webReport = new FastReport.Report())
            {
                webReport.Report.Load(Server.MapPath("~/Report/Report/R12025.frx"));
                System.Data.DataSet dataSet = new System.Data.DataSet();
                webReport.Report.RegisterData(dtT12025, "T12025");
                webReport.Report.Prepare();
                using (var Report = new MemoryStream())
                {
                    // var excelExport = new Excel2007Export();
                    // webReport.Report.Export(excelExport, strm);
                    // var pdfExport = new PDFExport();
                    // webReport.Report.Export(pdfExport, strm);
                    // Response.ClearContent();
                    // Response.ClearHeaders();
                    // Response.Buffer = true;
                    //// Response.ContentType = "Application/vnd.ms-excel";
                    //  Response.ContentType = "Application/PDF";
                    // Response.BinaryWrite(strm.ToArray());
                    // Response.End();
                    var pdfExport = new PDFExport();
                    webReport.Export(pdfExport, Report);
                    Response.ClearContent();
                    Response.ClearHeaders();
                    Response.Buffer      = true;
                    Response.ContentType = "Application/PDF";
                    Response.BinaryWrite(Report.ToArray());
                    Response.End();
                }
                ViewBag.WebReport = webReport;
            }

            return(View());
        }
        //------------------------------------Report----------------------------
        public ActionResult getR12046_Report(string reqno)
        {
            string site = Session["T_SITE_CODE"].ToString();
            string lang = Session["T_LANG"].ToString();

            DataTable dt_site   = repository.GetSite(site);
            DataTable dt_xMatch = repository.getR12046_xMatch(reqno, site, lang);
            DataTable dt_issue  = repository.getR12046_Issue(reqno, site, lang);

            dt_site.TableName   = "R12046_Site";
            dt_xMatch.TableName = "R12046";
            dt_issue.TableName  = "R12046i";


            DataSet ds = new DataSet();

            ds.Tables.Add(dt_site);
            ds.Tables.Add(dt_xMatch);
            ds.Tables.Add(dt_issue);


            //ds.WriteXmlSchema(Server.MapPath("~/Report/xml/R12046.xml"));


            using (var webReport = new FastReport.Report())
            {
                webReport.Report.Load(Server.MapPath("~/Report/Report/R12046.frx"));

                webReport.Report.RegisterData(dt_site, "R12046_Site");
                webReport.Report.RegisterData(dt_xMatch, "R12046");
                webReport.Report.RegisterData(dt_issue, "R12046i");


                webReport.Report.Prepare();
                using (var Report = new MemoryStream())
                {
                    var pdfExport = new PDFExport();
                    webReport.Export(pdfExport, Report);
                    Response.ClearContent();
                    Response.ClearHeaders();
                    Response.Buffer      = true;
                    Response.ContentType = "Application/PDF";
                    Response.BinaryWrite(Report.ToArray());
                    Response.End();
                }
                ViewBag.WebReport = webReport;
            }

            return(View());
        }
        public ActionResult TAT_Report_R12219(string dateFrom)
        {
            //string lang = Session["T_LANG"].ToString();
            //dt.TableName = "R12006";

            string site = Session["T_SITE_CODE"].ToString();
            string lang = Session["T_LANG"].ToString();
            //DataTable dt = repository.getReport(lang, patNo);
            DataTable dtReportInfo = repository.GetReportInfo();
            DataTable dtReportData = repository.GetReportData();

            dtReportInfo.TableName = "Table1";
            dtReportData.TableName = "Table2";

            DataSet ds = new DataSet();

            ds.DataSetName = "R12219";
            ds.Tables.Add(dtReportInfo);
            ds.Tables.Add(dtReportData);


            //ds.WriteXmlSchema(Server.MapPath("~/Report/xml/R12219.xml"));


            using (var webReport = new FastReport.Report())
            {
                webReport.Report.Load(Server.MapPath("~/Report/Report/R12219.frx"));

                webReport.Report.RegisterData(dtReportInfo, "Table1");
                webReport.Report.RegisterData(dtReportData, "Table2");


                webReport.Report.Prepare();
                using (var report = new MemoryStream())
                {
                    var pdfExport = new PDFExport();
                    webReport.Export(pdfExport, report);
                    Response.ClearContent();
                    Response.ClearHeaders();
                    Response.Buffer      = true;
                    Response.ContentType = "Application/PDF";
                    Response.BinaryWrite(report.ToArray());
                    Response.End();
                }
                ViewBag.WebReport = webReport;
            }

            return(View());
        }
        private void Print()
        {
            internalReport.Prepare();

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

            case ExtratoFiltro.PDF:
                var pdfExport = new PDFExport
                {
                    EmbeddingFonts  = true,
                    ShowProgress    = MostrarSetup,
                    JpegCompression = true,
                    JpegQuality     = 9,
                    OpenAfterExport = MostrarPreview
                };

                internalReport.Export(pdfExport, NomeArquivo);
                break;

            case ExtratoFiltro.HTML:
                var htmlExport = new HTMLExport
                {
                    Format        = HTMLExportFormat.MessageHTML,
                    EmbedPictures = true,
                    Preview       = MostrarPreview,
                    ShowProgress  = MostrarSetup
                };

                internalReport.Export(htmlExport, NomeArquivo);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            internalReport.Dispose();
            internalReport = null;
        }
Example #27
0
        //
        public void PrintPDFReports(List <LisReport> reportList, string modelName)
        {
            DataSet ds = CreateDataSet("ReportTables.frd");

            FillDataSet(reportList, ds);
            Report report = new Report();

            report.Load(modelName);
            report.RegisterData(ds);
            report.Prepare();
            PDFExport export = new PDFExport();

            report.Export(export, "result.pdf");
            report.Dispose();
        }
Example #28
0
        public void GenderPDFReport(LisReport lr, string rootPath, DataSet ds)
        {
            //清空数据库
            ClearDataSet(ds);
            //填充数据
            FillDataSet(lr, ds);
            Report report = new Report();
            //获取模板
            string modelName = GetReportModelName(lr);
            //获取生成文件全路径
            string fileFullName = GenderFileFullName(lr.ReportInfo, rootPath, lr.OrderNo);

            report.Load(GetReprotModelPath(modelName));
            report.RegisterData(ds);
            report.Prepare();
            PDFExport export = new PDFExport();

            //这里针对像流式这种生成PDF之后还要处理的情况。
            if (AfterCreatPDF(lr.ReportInfo.SectionNo))
            {
                string linshi = rootPath + "\\liushi\\linshi.pdf";
                report.Export(export, linshi);
                report.Dispose();
                List <MyMergePdf> lm = new List <MyMergePdf>();
                lm.Add(new MyMergePdf {
                    Name = linshi
                });
                string liushiPDFname = getliushiname(lr.ReportInfo.SerialNo, lr.ReportInfo.SampleNo, rootPath);
                if (liushiPDFname != "")
                {
                    try
                    {
                        int page = Convert.ToInt32(liushiPDFname.Split('_')[2].Split('.')[0]);
                        lm.Add(new MyMergePdf {
                            Name = rootPath + "\\liushi\\" + liushiPDFname, PagCount = page
                        });
                    }
                    catch { }
                }
                mergePDFFiles(lm, fileFullName);
            }
            //一般情况。
            else
            {
                report.Export(export, fileFullName);
                report.Dispose();
            }
        }
        //getR12036A_Report
        public ActionResult getR12012_Report(string reqno)
        {
            string    site    = Session["T_SITE_CODE"].ToString();
            string    lang    = Session["T_LANG"].ToString();
            DataTable dt      = repository.getR12012_Report(reqno, site, lang);
            DataTable dt_site = repository.GetSite(site);

            dt.TableName      = "R12012";
            dt_site.TableName = "R12012_site";

            DataSet ds = new DataSet();

            ds.Tables.Add(dt);
            ds.Tables.Add(dt_site);


            //ds.WriteXmlSchema(Server.MapPath("~/Report/xml/R12012.xml"));


            using (var webReport = new FastReport.Report())
            {
                webReport.Report.Load(Server.MapPath("~/Report/Report/R12012.frx"));

                webReport.Report.RegisterData(dt, "R12012");
                webReport.Report.RegisterData(dt_site, "R12012_site");


                var HijriDTFI = new CultureInfo("ar-SA", false).DateTimeFormat;
                HijriDTFI.Calendar = new HijriCalendar();
                webReport.SetParameterValue("RequestDate_H", Convert.ToDateTime(dt.Rows[0]["T_REQUEST_DATE"].ToString()).ToString("dd/MM/yyyy", HijriDTFI));

                webReport.Report.Prepare();
                using (var Report = new MemoryStream())
                {
                    var pdfExport = new PDFExport();
                    webReport.Export(pdfExport, Report);
                    Response.ClearContent();
                    Response.ClearHeaders();
                    Response.Buffer      = true;
                    Response.ContentType = "Application/PDF";
                    Response.BinaryWrite(Report.ToArray());
                    Response.End();
                }
                ViewBag.WebReport = webReport;
            }

            return(View());
        }
Example #30
0
 public void GenderPDFReport(LisReport lr, string rootPath)
 {
     //DataSet ds = CreateDataSet("ReportTables.frd");
     DataSet ds = GetPrintDataSet("ReportTables.frd");
     FillDataSet(lr, ds);
     Report report = new Report();
     //获取模板
     string modelName = GetReportModelName(lr);
     //获取生成文件全路径
     string fileFullName = GenderFileFullName(lr.ReportInfo, rootPath, lr.OrderNo);
     report.Load(GetReprotModelPath(modelName));
     report.RegisterData(ds);
     report.Prepare();
     PDFExport export = new PDFExport();
     report.Export(export, fileFullName);
     report.Dispose();
 }
        private void Rapor(int id, string path, string xpath, string baslik)
        {
            WebReport rapor = new WebReport();
            string    str   =
                "SELECT B.OlusturmaTarihi, kr.Adi,br.Adi,B.Konu,B.CevapTarihi,B.CevapMesaji, B.BasvuruYolu, B.Mesaj, B.Tur, B.EPosta, B.Gsm, B.TcId, B.Ip, B.GrupId, B.Durum, B.Ad, B.Soyad,gr.Adi " +
                " FROM bildirimler B" +
                " left join kurumlar kr on kr.id=B.KurumId" +
                " left join birimler br on br.id=B.BirimId" +
                " left join gruplar gr on gr.id=B.GrupId " + "where B.Id=" + id + "";
            var con                 = new MySqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
            var cmd                 = new MySqlCommand(str, con);
            MySqlDataAdapter da     = new MySqlDataAdapter(cmd);
            DataTable        Tamami = new DataTable();

            da.Fill(Tamami);
            rapor.RegisterData(Tamami, "rapor");
            string pdfadi = "Bildirim_" + id;

            rapor.Report.Load(Server.MapPath(path));
            rapor.Report.RegisterData(Tamami, "Tamami");
            // rapor.Load("D:/Projeler/idari/cs/KarmedWeb/MerkeziGorusOneri/HastaneOneriWeb/Rapor/rapor.frx");

            if (rapor.Report.Prepare())
            {
                var pdfExport = new PDFExport
                {
                    ShowProgress   = false,
                    Subject        = "Subject",
                    Title          = "Rapor",
                    Compressed     = true,
                    AllowPrint     = true,
                    EmbeddingFonts = true
                };

                rapor.Report.Export(pdfExport, Server.MapPath(xpath + pdfadi));
                pdfExport.Dispose();

                string url = @"loadPencere('Rapor/Raporx/Downloader.aspx?dosya={0}','Rapor',1000,500);";

                //wr.Report.Print();
                X.ResourceManager.AddScript(string.Format(url, pdfadi));

                //rapor.Show();
            }
        }
Example #32
0
        private string GenderPDF(string model, DataSet ds)
        {
            FastReport.Report report = new FastReport.Report();
            report.Load(model);
            report.RegisterData(ds);

            report.Prepare();
            //report.PreparePhase1();
            //report.PreparePhase2();

            //初始化输出类
            PDFExport export = new PDFExport();
            //输出
            string path = "E:\\lis\\temp.pdf";
            export.Export(report, path);

            return path;
        }
Example #33
0
 public void GenderPDFReport(LisReport lr, string rootPath,DataSet ds)
 {
     //清空数据库
     ClearDataSet(ds);
     //填充数据
     FillDataSet(lr, ds);
     Report report = new Report();
     //获取模板
     string modelName = GetReportModelName(lr);
     //获取生成文件全路径
     string fileFullName = GenderFileFullName(lr.ReportInfo, rootPath, lr.OrderNo);
     report.Load(GetReprotModelPath(modelName));
     report.RegisterData(ds);
     report.Prepare();
     PDFExport export = new PDFExport();
     //这里针对像流式这种生成PDF之后还要处理的情况。
     if (AfterCreatPDF(lr.ReportInfo.SectionNo))
     {
         string linshi = rootPath + "\\liushi\\linshi.pdf";
         report.Export(export, linshi);
         report.Dispose();
         List<MyMergePdf> lm = new List<MyMergePdf>();
         lm.Add(new MyMergePdf { Name = linshi });
         string liushiPDFname = getliushiname(lr.ReportInfo.SerialNo, lr.ReportInfo.SampleNo, rootPath);
         if (liushiPDFname != "")
         {
             try
             {
                 int page = Convert.ToInt32(liushiPDFname.Split('_')[2].Split('.')[0]);
                 lm.Add(new MyMergePdf { Name = rootPath + "\\liushi\\" + liushiPDFname, PagCount = page });
             }
             catch { }
         }
         mergePDFFiles(lm, fileFullName);
     }
     //一般情况。
     else
     {
         report.Export(export, fileFullName);
         report.Dispose();
     }
 }
Example #34
0
        // Problems 3 - 4
        private void exportPdfXml_Click(object sender, EventArgs e)
        {
            var startDate = startDatePdfXml.Value.ToString("dd-MM-yyyy");
            var endDate = endDatePdfXml.Value.ToString("dd-MM-yyyy");

            if (toPDF.Checked)
            {
                var pdfExp = new PDFExport();

                pdfExp.GeneratePDFReport(startDatePdfXml.Value, endDatePdfXml.Value);
                 MessageBox.Show(@"Task complete.");
            }
            else if (ToXML.Checked)
            {
                XmlWriter.GenerateXmlReport(startDate, endDate);
            }
            else
            {
                MessageBox.Show(@"Please select PDF or XML before to generate a report.");
            }
        }
Example #35
0
 private string GenderPDF(string model, DataSet ds)
 {
     //
     using (FastReport.Report report = new FastReport.Report())
     {
         report.Load(model);
         report.RegisterData(ds);
         report.Prepare(); //报告准备
         //report.PreparePhase1();
         //report.PreparePhase2();
         //初始化PDF输出类
         using (PDFExport export = new PDFExport())
         {
             this.InitPDFExport(export);
             //输出PDF
             string fileFullName = GetFileFullName();
             export.Export(report, fileFullName);
             return fileFullName;
         }
     }
 }
Example #36
0
 private void InitPDFExport(PDFExport export)
 {
 }
Example #37
0
        //导出
        void UCReport_ExportEvent(object sender, EventArgs e)
        {
            string fileName = GetDefaultStyleFile();
            // create report instance
            FastReport.Report report = new FastReport.Report();
            if (!string.IsNullOrEmpty(fileName))
            {
                report.Load(fileName);
                report.RegisterData(dt, styleObject);
            }
            else
            {

                Report.FastReportEx reportEx = new Report.FastReportEx();
                reportEx.dicSpanRows = dicSpanRows;
                reportEx.dt = dt;
                reportEx.styleObject = styleObject;
                reportEx.styleTitle = styleTitle;
                report = reportEx.DefaultReport();
            }
            if (report == null)
            {
                return;
            }
            report.Prepare();
            PDFExport export = new PDFExport();
            export.Export(report);
            report.Dispose();
        }
Example #38
0
 //
 public void PrintPDFReports(List<LisReport> reportList, string modelName)
 {
     DataSet ds = CreateDataSet("ReportTables.frd");
     FillDataSet(reportList, ds);
     Report report = new Report();
     report.Load(modelName);
     report.RegisterData(ds);
     report.Prepare();
     PDFExport export = new PDFExport();
     report.Export(export, "result.pdf");
     report.Dispose();
 }