protected void GanttControlExporting_ServerPdfExporting(object sender, Syncfusion.JavaScript.Web.GanttEventArgs e) { PdfExport exp = new PdfExport(); GanttPdfExportSettings settings = new GanttPdfExportSettings(); settings.Theme = GanttExportTheme.FlatLime; settings.Locale = e.Arguments["locale"].ToString(); //Create footer template RectangleF bounds = new RectangleF(0, 0, 762, 25); PdfSolidBrush brush = new PdfSolidBrush(new PdfColor(51, 51, 51)); PdfPen pen = new PdfPen(new PdfColor(200, 200, 200)); PdfFont font = new PdfTrueTypeFont(new Font("Segoe UI", 10), true); PdfStringFormat format = new PdfStringFormat(); format.Alignment = PdfTextAlignment.Center; format.LineAlignment = PdfVerticalAlignment.Middle; PdfPageTemplateElement footer = new PdfPageTemplateElement(bounds); PdfPageNumberField pageNumber = new PdfPageNumberField(font, brush); PdfCompositeField compositeField = new PdfCompositeField(font, brush, "Page {0}", pageNumber); compositeField.StringFormat = format; compositeField.Bounds = footer.Bounds; footer.Graphics.DrawRectangle(pen, bounds); compositeField.Draw(footer.Graphics, new PointF(0, 0)); PdfDocumentTemplate footerTemplate = new PdfDocumentTemplate(); footerTemplate.Bottom = footer; settings.PdfDocumentTemplate = footerTemplate; PdfDocument document = exp.Export(this.GanttControlExporting.Model, (IEnumerable)this.GanttControlExporting.DataSource, settings, false); document = exp.Export(this.GanttControlDesign.Model, (IEnumerable)this.GanttControlDesign.DataSource, settings, document, false); exp.Export(this.GanttControlImplementation.Model, (IEnumerable)this.GanttControlImplementation.DataSource, settings, "Gantt", document, true); }
private void pdfExportSearchedClick(object sender, RoutedEventArgs e) { SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter = "PDF(*.pdf)|*.pdf"; dialog.ShowDialog(); string path = dialog.FileName; ArrayList bandsToPdf = new ArrayList(); var queryBands = bandListView.ItemsSource; foreach (var band in queryBands) { Band bandToProcess = (Band)band; bandsToPdf.Add(band); } try { PdfExport.processBandsToPdf(bandsToPdf, path, 12); } catch { this.NavigationService.Navigate(new BandsAdmin()); } }
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(); }
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"); }
public void PdfExport(SectionReport report, string path) { using (var exporter = new PdfExport()) { exporter.Export(report.Document, path); } }
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(); }
/// <summary> /// Export data tables to PDF. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void exportPDF(object sender, RoutedEventArgs e) { try { SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter = "PDF(*.pdf)|*.pdf"; dialog.ShowDialog(); string path = dialog.FileName; List <Band> bands; ArrayList bandsToPdf = new ArrayList(); using (var db = new LiteDatabase(LiteDbConnection.getDbName())) { var dbBands = db.GetCollection <Band>("Bands"); bands = dbBands.FindAll().ToList(); foreach (Band bandToProcess in bands) { bandsToPdf.Add(bandToProcess); } PdfExport.processBandsToPdf(bandsToPdf, path, 12); } } catch (Exception ex) { this.NavigationService.Navigate(new BandsAdmin()); } }
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); }
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"); }
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"); }
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 ExportToPdfGenero(string GridModel) { PdfExport exp = new PdfExport(); var DataSource = context.Generoes.ToList(); GridProperties obj = (GridProperties)Syncfusion.JavaScript.Utils.DeserializeToModel(typeof(GridProperties), GridModel); exp.Export(obj, DataSource, "PDFGenero.pdf", false, false, "flat-saffron"); }
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); }
public void CanPdfDocument() { var temporary = Path.GetTempFileName(); using (var exporter = new PdfExport()) { Assert.IsTrue(exporter.Convert(temporary, Path.ChangeExtension(temporary, "pdf"))); } }
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"); }
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)); }
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"); }
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"); }
public void ExportToPdf(string TreeGridModel) { PdfExport exp = new PdfExport(); var DataSource = this.GetLQASData(); TreeGridProperties obj = ConvertTreeGridObject(TreeGridModel); exp.Export(obj, DataSource, new TreeGridExportSettings() { Theme = ExportTheme.FlatSaffron }, "Export"); }
protected void EmployeesGrid_ServerPdfExporting(object sender, Syncfusion.JavaScript.Web.GridEventArgs e) { PdfExport exp = new PdfExport(); GridProperties obj = ConvertGridObject(e.Arguments["model"].ToString()); GridPdfExport exp1 = new GridPdfExport() { IsTemplateColumnIncluded = true, IsHideColumnIncude = false, Theme = "flat-lime", FileName = "Export.pdf" }; exp.Export(obj, (IEnumerable)EmployeesGrid.DataSource, exp1); }
public void ExportToPdfAlbum(string GridModel) { PdfExport exp = new PdfExport(); var DataSource = context.Albums.ToList(); //GridProperties obj = (GridProperties)Syncfusion.JavaScript.Utils.DeserializeToModel(typeof(GridProperties), GridModel); GridProperties obj = ConvertGridObject(GridModel); obj.Columns[2].DataSource = context.Artistas.ToList(); obj.Columns[3].DataSource = context.Generoes.ToList(); exp.Export(obj, DataSource, "PDFAlbum.pdf", false, false, "flat-saffron"); }
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 courseGrid_ServerPdfExporting(object sender, Syncfusion.JavaScript.Web.GridEventArgs e) { try { PdfExport exp = new PdfExport(); exp.Export(courseGrid.Model, (IEnumerable)courseGrid.DataSource, "Export.pdf", false, false, true, "flat-lime"); } catch (Exception ex) { MessageBox.swalModal(this.Page, "error", "en:internal error[" + ex.Message.Replace("'", "") + "]", ""); } }
public void PdfExport(string GanttModel, bool isFitToWidth) { PdfExport exp = new PdfExport(); var DataSource = this.GetEditingDataSource(); GanttProperties obj = ConvertGanttObject(GanttModel); GanttPdfExportSettings settings = new GanttPdfExportSettings(); settings.Theme = GanttExportTheme.FlatSaffron; settings.Locale = Request.Form["locale"]; settings.IsFitToWidth = isFitToWidth; exp.Export(obj, 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"); }
protected void gvDepartment_ServerPdfExporting(object sender, Syncfusion.JavaScript.Web.GridEventArgs e) { try { PdfExport exp = new PdfExport(); for (var i = 0; i < this.gvDepartment.Columns.Count(); i++) { if (this.gvDepartment.Columns[i].HeaderText == "Action") // use the template column HeaderText here. { gvDepartment.Model.Columns.RemoveAt(i); // remove the respective column i--; } } PdfDocument doc = new PdfDocument(); doc.PageSettings.Orientation = PdfPageOrientation.Landscape; doc.PageSettings.Size = PdfPageSize.A4; doc.PageSettings.Width = 750; RectangleF rect = new RectangleF(0, 0, doc.PageSettings.Width, 15); //create a header pager template PdfPageTemplateElement header = new PdfPageTemplateElement(rect); //create a footer pager template PdfPageTemplateElement footer = new PdfPageTemplateElement(rect); //Font f = new System.Drawing.Font("Helvetica", 10, FontStyle.Bold); // PdfFont font = new PdfTrueTypeFont(f, true); // header.Graphics.DrawString(ReportTitle, font, PdfBrushes.Black, new Point(300, 0)); //Add custom text to the Header // doc.Template.Top = header; //Append custom template to the document // footer.Graphics.DrawString("Report Generated Date: " + DateTime.Now.ToString("dd-MMM-yyyy hh:mm tt"), font, PdfBrushes.Gray, new Point(280, 0));//Add Custom text to footer doc.Template.Bottom = footer;//Add the footer template to document doc.DocumentInformation.Title = ReportTitle; doc.DocumentInformation.Keywords = "PDF"; doc.DocumentInformation.Subject = ReportTitle; doc.DocumentInformation.Producer = "SMS"; doc.DocumentInformation.CreationDate = DateTime.Now; // doc.DocumentInformation.Author = CU.CurrentUserFullName; doc.ViewerPreferences.FitWindow = true; doc.ViewerPreferences.PageLayout = PdfPageLayout.SinglePage; doc.ViewerPreferences.PageScaling = PageScalingMode.AppDefault; exp.Export(gvDepartment.Model, (IEnumerable)gvDepartment.DataSource, ExportFileName + ".pdf", false, false, "flat-saffron", false, doc, ""); } catch (Exception ex) { // CU.LogError(ex); } }
public void MultipleExportToPdf(string[] GanttModel) { PdfExport exp = new PdfExport(); var PlanData = this.GetPlanDataSource(); var DesignData = this.GetDesignDataSource(); var ImplementationData = this.GetImplementationDataSource(); PdfDocument document = null; GanttPdfExportSettings settings = new GanttPdfExportSettings(); settings.Theme = GanttExportTheme.FlatSaffron; settings.Locale = Request.Form["locale"]; //Create footer template RectangleF bounds = new RectangleF(0, 0, 762, 25); PdfSolidBrush brush = new PdfSolidBrush(new PdfColor(51, 51, 51)); PdfPen pen = new PdfPen(new PdfColor(200, 200, 200)); PdfFont font = new PdfTrueTypeFont(new Font("Segoe UI", 10), true); PdfStringFormat format = new PdfStringFormat(); format.Alignment = PdfTextAlignment.Center; format.LineAlignment = PdfVerticalAlignment.Middle; PdfPageTemplateElement footer = new PdfPageTemplateElement(bounds); PdfPageNumberField pageNumber = new PdfPageNumberField(font, brush); PdfCompositeField compositeField = new PdfCompositeField(font, brush, "Page {0}", pageNumber); compositeField.StringFormat = format; compositeField.Bounds = footer.Bounds; footer.Graphics.DrawRectangle(pen, bounds); compositeField.Draw(footer.Graphics, new PointF(0, 0)); PdfDocumentTemplate footerTemplate = new PdfDocumentTemplate(); footerTemplate.Bottom = footer; settings.PdfDocumentTemplate = footerTemplate; int count = 1; foreach (string gridProperty in GanttModel) { GanttProperties gridProp = this.ConvertGanttObject(gridProperty); if (count == 1) { document = exp.Export(gridProp, (IEnumerable)PlanData, settings, false); } else if (count == 2) { document = exp.Export(gridProp, (IEnumerable)DesignData, settings, document, false); } else { exp.Export(gridProp, (IEnumerable)ImplementationData, settings, "Gantt", document, true); } count++; } }
public void CanSetPageSize() { var temporary = Path.GetTempFileName(); using (var exporter = new PdfExport()) { exporter.UseDefaultPageSettings = false; exporter.PageWidth = 1; exporter.PageHeight = 1; Assert.IsTrue(exporter.Convert(temporary, Path.ChangeExtension(temporary, "pdf"))); } }
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 HierarchyExportToPdf(string GridModel) { PdfExport exp = new PdfExport(); var DataSource = emp; GridProperties gridProp = ConvertGridModel(GridModel); gridProp.ChildGrid.DataSource = _context.Orders.Take(100).ToList(); GridPdfExport pdfExp = new GridPdfExport(); pdfExp.FileName = "Export.pdf"; pdfExp.Theme = "flat-saffron"; pdfExp.IncludeChildGrid = true; return(exp.Export(gridProp, DataSource, pdfExp)); }
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)); }
private void ExportToPdf(object sender, EventArgs e) { string filename = ""; using (var dlg = new SaveFileDialog()) { dlg.Filter = "PDF Files (*.pdf)|*.pdf|All files (*.*)|*.*"; if (dlg.ShowDialog(this) != DialogResult.OK) { return; } filename = dlg.FileName; } var pdf = new PdfExport(); viewer1.Export(pdf, new FileInfo(filename)); }
/////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Gets exporter object by identificator. /// </summary> /// <param name="identificator">Export type identificator (name or file extension).</param> /// <returns>Unifed document exporter.</returns> private static IDocumentExport _GetExporter(string identificator) { Debug.Assert(!string.IsNullOrEmpty(identificator)); IDocumentExport export = null; // select export format type switch (identificator) { case EXPORT_EXTENSION_HTM: case EXPORT_TYPE_NAME_HTM: export = new HtmlExport(); break; case EXPORT_EXTENSION_PDF: case EXPORT_TYPE_NAME_PDF: export = new PdfExport(); break; case EXPORT_EXTENSION_RTF: case EXPORT_TYPE_NAME_RTF: export = new RtfExport(); break; case EXPORT_EXTENSION_TIF: case EXPORT_TYPE_NAME_TIF: export = new TiffExport(); break; case EXPORT_EXTENSION_TXT: case EXPORT_TYPE_NAME_TXT: export = new TextExport(); break; case EXPORT_EXTENSION_XLS: case EXPORT_TYPE_NAME_XLS: export = new XlsExport(); break; default: Debug.Assert(false); // NOTE: not supported break; } return export; }