Beispiel #1
0
        protected void EmployeesGrid_ServerPdfExporting(object sender, Syncfusion.JavaScript.Web.GridEventArgs e)
        {
            PdfExport   exp      = new PdfExport();
            PdfDocument document = exp.Export(EmployeesGrid.Model, (IEnumerable)EmployeesGrid.DataSource, "Export.pdf", true, true, "flat-lime", true);

            exp.Export(OrdersGrid.Model, (IEnumerable)OrdersGrid.DataSource, "Export.pdf", true, true, "flat-lime", false, document, "Second Grid");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ActiveReport rpt = null;

            if (Session["ReportType"].ToString() == "SR")
            {
                rpt = new Reports.rptSR();
            }
            else if (Session["ReportType"].ToString() == "GPassBFA")
            {
                rpt = new Reports.rptGPass();
            }


            rpt.Run(false);
            Response.ContentType = "application/pdf";
            Response.AddHeader("content-disposition", "inline; filename=MyPDF.PDF");

            // Create the PDF export object
            PdfExport pdf = new PdfExport();

            // Create a new memory stream that will hold the pdf output
            System.IO.MemoryStream memStream = new System.IO.MemoryStream();
            // Export the report to PDF:
            pdf.Export(rpt.Document, memStream);
            // Write the PDF stream out
            Response.BinaryWrite(memStream.ToArray());
            // Send all buffered content to the client
            Response.End();
        }
    protected void FlatGrid_ServerPdfExporting(object sender, Syncfusion.JavaScript.Web.GridEventArgs e)

    {
        PdfExport exp = new PdfExport();

        exp.Export(FlatGrid.Model, (IEnumerable)FlatGrid.DataSource, "Export.pdf", true, true, "flat-lime");
    }
Beispiel #4
0
 public void PdfExport(SectionReport report, string path)
 {
     using (var exporter = new PdfExport())
     {
         exporter.Export(report.Document, path);
     }
 }
Beispiel #5
0
        public void ExportToPdf(string GridModel)
        {
            var orders = db.Orders
                         .Include(p => p.Client).Include(p => p.DeviceUser)
                         .OrderByDescending(o => o.OrderId)
                         .ToList()
                         .Select(s => new OrderViewModel()
            {
                OrderId          = s.OrderId,
                RemoteId         = s.RemoteId,
                SalesPersonCode  = s.DeviceUser.SalesPersonId,
                Status           = s.Status.ToString(),
                Total            = s.GetTotal(),
                CardCode         = s.Client.CardCode,
                Comment          = s.Comment,
                DeliveryDate     = s.DeliveryDate,
                DateCreated      = s.CreatedDate.ToShortDateString(),
                LastErrorMessage = s.LastErrorMessage
            });

            PdfExport exp = new PdfExport();

            GridProperties obj = (GridProperties)Syncfusion.JavaScript.Utils.DeserializeToModel(typeof(GridProperties), GridModel);

            exp.Export(obj, orders, "Export.pdf", false, false, "flat-saffron");
        }
Beispiel #6
0
        public MemoryStream ExecuteReport1()
        {
            //Response.Buffer = true;
            Orchestrator.Reports.ReportBase rpt = GetManifestReport();
            if (rpt == null)
            {
                Response.Clear();
                Response.ClearContent();
                Response.Write("<br /><br />The report failed to generate, please try again. If this problem continues please contact support.");
                if (Utilities.LastError != null)
                {
                    Response.Write("<br />" + Utilities.LastError.Message);
                    Response.Write("<br />" + Utilities.LastError.StackTrace);
                }
                else
                {
                    Response.Write("<br />No error stored");
                }
                Response.End();

                return(null);
            }


            MemoryStream memStream = new MemoryStream();

            // Create the PDF export object
            using (PdfExport pdf = new PdfExport())
            {
                // pdf.Export(rpt.Document, Path.Combine(PDFPath, System.Environment.TickCount.ToString().Substring(0, 4) + ".pdf"));
                pdf.Export(rpt.Document, memStream);
            }

            return(memStream);
        }
Beispiel #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ActiveReport     report          = ReportFactory.GetReport();
            PageDataTransfer transferedData  = new PageDataTransfer(HttpContext.Current.Request.Path);
            string           requestedReport = (string)(transferedData.GetTransferedData("RequestedReport"));

            report.Run(false);
//            Response.AddHeader("Cache-Control", "no-cache");
            Response.ContentType = "application/pdf";
            Response.AddHeader("content-disposition", string.Format("inline; filename={0}.PDF", requestedReport));

            // Create the PDF export object
            PdfExport pdf = new PdfExport();

            // Create a new memory stream that will hold the pdf output
            System.IO.MemoryStream memStream = new System.IO.MemoryStream();
            // Export the report to PDF:
            pdf.Export(report.Document, memStream);
            // Write the PDF stream out
            Response.BinaryWrite(memStream.ToArray());
            // Send all buffered content to the client
            Response.End();

            transferedData.RemoveAllData();
        }
Beispiel #8
0
        protected void TreeGridControlExporting_ServerPdfExporting(object sender, Syncfusion.JavaScript.Web.TreeGridEventArgs e)
        {
            PdfExport   exp      = new PdfExport();
            PdfDocument document = exp.Export(this.TreeGridControlExporting.Model, (IEnumerable)this.TreeGridControlExporting.DataSource, new TreeGridExportSettings()
            {
                Theme = ExportTheme.FlatLime
            }, false, "Planning Phase");

            document = exp.Export(this.TreeGridControlDesign.Model, (IEnumerable)this.TreeGridControlDesign.DataSource, new TreeGridExportSettings()
            {
                Theme = ExportTheme.FlatLime
            }, "Export", document, false, "Design Phase");
            exp.Export(this.TreeGridControlImplementation.Model, (IEnumerable)this.TreeGridControlImplementation.DataSource, new TreeGridExportSettings()
            {
                Theme = ExportTheme.FlatLime
            }, "Export", document, true, "Implementation Phase");
        }
Beispiel #9
0
        protected void TreeGridControlExporting_ServerPdfExporting(object sender, Syncfusion.JavaScript.Web.TreeGridEventArgs e)
        {
            PdfExport exp = new PdfExport();
            TreeGridExportSettings settings = new TreeGridExportSettings();

            settings.Theme = ExportTheme.FlatLime;
            exp.Export(this.TreeGridControlExporting.Model, (IEnumerable)this.TreeGridControlExporting.DataSource, settings, "Export");
        }
        public void ExportToPdf(string GridModel)
        {
            PdfExport      exp        = new PdfExport();
            var            DataSource = new NorthwindDataContext().OrdersViews.Take(100).ToList();
            GridProperties obj        = ConvertGridObject(GridModel);

            exp.Export(obj, DataSource, "Export.pdf", false, false, "flat-saffron");
        }
        public void ColumnTemplateExportToPdf(string GridModel)
        {
            PdfExport      exp        = new PdfExport();
            var            DataSource = new NorthwindDataContext().EmployeeViews.Take(8).ToList();
            GridProperties obj        = ConvertGridObject(GridModel);

            obj.PdfColumnTemplateInfo = PdfTemplateInfo;
            exp.Export(obj, DataSource, "Export.pdf", false, true, "flat-saffron");
        }
Beispiel #12
0
        public static void ExportToPdf(string gridModel, IEnumerable data, string fileName, string theme)
        {
            GridProperties gridProperties = ModelToObject(gridModel);

            PdfExport export = new PdfExport();

            export.Export(gridProperties, data, fileName, false, false, true, theme); // UNICODE = true
            //export.Export(gridProperties, data, fileName, false, false, theme);
        }
Beispiel #13
0
        public ActionResult ExportToPdf(string GridModel)
        {
            PdfExport      exp        = new PdfExport();
            var            DataSource = _context.Orders.Take(100).ToList();
            GridProperties gridProp   = ConvertGridObject(GridModel);
            GridPdfExport  pdfExp     = new GridPdfExport();

            pdfExp.FileName = "Export.pdf"; pdfExp.Theme = "flat-saffron";
            return(exp.Export(gridProp, DataSource, pdfExp));
        }
Beispiel #14
0
        public void ExportToPdf(string GridModel)
        {
            PdfExport exp        = new PdfExport();
            var       DataSource = TempData["ExportData"];

            TempData["ExportData"] = DataSource;
            GridProperties obj = (GridProperties)Syncfusion.JavaScript.Utils.DeserializeToModel(typeof(GridProperties), GridModel);

            //exp.Export(obj, DataSource, "Export.pdf", false, false, "flat-saffron");
            exp.Export(gridmaodel: obj, datasource: DataSource, fileName: "Export.pdf", isHideColumnIncude: false, isTemplateColumnIclude: false, theme: "flat-saffron");
        }
Beispiel #15
0
        protected void grdVillageM_ServerPdfExporting(object sender, GridEventArgs e)
        {
            PdfExport exp            = new PdfExport();
            DataTable VillageDetails = dsAllVillageDetails.Tables[0];
            //List<DataRow> list = FamilyDetails.AsEnumerable().ToList();
            List <DataRow> listVillage = new List <DataRow>(VillageDetails.Select());

            //PdfDocument pdfDocument = exp.Export(grdVillageM.Model, (IEnumerable)listVillage, "AllVillageDetails.pdf", true, true, "flat-lime", true);
            exp.Export(grdVillageM.Model, (IEnumerable)listVillage, "AllVillageDetails.pdf", false, false, true, "flat-saffron");
            //exp.Export(obj, DataSource, "Export.pdf", false, false, true, "flat-saffron");
        }
Beispiel #16
0
        public void PdfExport()
        {
            GanttProperties        gantt    = getGanttProperties();
            PdfExport              exp      = new PdfExport();
            GanttPdfExportSettings settings = new GanttPdfExportSettings();

            settings.EnableFooter = true;
            settings.ProjectName  = "Project Tracker";
            settings.IsFitToWidth = true;
            settings.Theme        = GanttExportTheme.FlatLime;
            exp.Export(gantt, (IEnumerable)gantt.DataSource, settings, "Gantt");
        }
        protected void GanttControlExporting_ServerPdfExporting(object sender, Syncfusion.JavaScript.Web.GanttEventArgs e)
        {
            PdfExport exp = new PdfExport();
            GanttPdfExportSettings settings = new GanttPdfExportSettings();

            settings.EnableFooter = true;
            settings.ProjectName  = "Project Tracker";
            settings.Locale       = e.Arguments["locale"].ToString();
            settings.Theme        = GanttExportTheme.FlatLime;
            settings.IsFitToWidth = this.EnablePageBreak.Checked;
            exp.Export(this.GanttControlExporting.Model, (IEnumerable)this.GanttControlExporting.DataSource, settings, "Gantt");
        }
        public void ExportHierarchyToPdf(string GridModel)
        {
            PdfExport      exp        = new PdfExport();
            var            DataSource = new NorthwindDataContext().EmployeeViews.ToList();
            GridProperties obj        = ConvertGridObject(GridModel);

            obj.ChildGrid.DataSource = new NorthwindDataContext().OrdersViews.Take(100).ToList();
            GridPdfExport expo = new GridPdfExport();

            expo.IncludeChildGrid = true;
            expo.Unicode          = true;
            exp.Export(obj, DataSource, expo);
        }
        public ActionResult ExportToPdf(string GanttModel)
        {
            PdfExport       exp        = new PdfExport();
            var             DataSource = GetExportEditingTaskData();
            GanttProperties ganttProp  = ConvertGridObject(GanttModel);
            GanttPdfExport  pdfExp     = new GanttPdfExport();

            pdfExp.FileName       = "GanttExport";
            pdfExp.ExportSettings = new GanttPdfExportSettings()
            {
                Theme = GanttExportTheme.FlatSaffron
            };
            return(exp.Export(ganttProp, DataSource, pdfExp));
        }
Beispiel #20
0
        public void MultipleExportToPdf(string[] GridModel)
        {
            PdfExport   exp          = new PdfExport();
            var         EmployeeData = new NorthwindDataContext().EmployeeViews.Take(5).ToList();
            var         OrderData    = new NorthwindDataContext().OrdersViews.Take(5).ToList();
            PdfDocument document     = null;
            bool        initial      = true;

            foreach (string gridProperty in GridModel)
            {
                GridProperties gridProp = ConvertObject(gridProperty);
                if (initial)
                {
                    gridProp.Locale = "";
                    document        = exp.Export(gridProp, EmployeeData, "Export.pdf", true, true, "flat-saffron", true);
                    initial         = false;
                }
                else
                {
                    exp.Export(gridProp, OrderData, "Export.pdf", true, true, "flat-saffron", false, document, "Second Grid");
                }
            }
        }