1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804 |
- using FastReport.Export.Csv;
- using FastReport.Export.Dbf;
- using FastReport.Export.Html;
- using FastReport.Export.Mht;
- using FastReport.Export.Odf;
- using FastReport.Export.OoXML;
- using FastReport.Export.Pdf;
- using FastReport.Export.RichText;
- using FastReport.Export.Text;
- using FastReport.Export.Xml;
- using System;
- using System.ComponentModel;
- using System.IO;
- using System.Text;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- namespace FastReport.Web
- {
- public partial class WebReport : WebControl, INamingContainer
- {
- #region RTF format
- /// <summary>
- /// Switches a visibility of RTF export in toolbar.
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowRtfExport
- {
- get { return Prop.ShowRtfExport; }
- set { Prop.ShowRtfExport = value; }
- }
- /// <summary>
- /// Gets or sets the quality of Jpeg images in RTF file.
- /// </summary>
- /// <remarks>
- /// Default value is 90. This property will be used if you select Jpeg
- /// in the <see cref="RtfImageFormat"/> property.
- /// </remarks>
- [DefaultValue(90)]
- [Category("Rtf Format")]
- [Browsable(true)]
- public int RtfJpegQuality
- {
- get { return Prop.RtfJpegQuality; }
- set { Prop.RtfJpegQuality = value; }
- }
- /// <summary>
- /// Gets or sets the image format that will be used to save pictures in RTF file.
- /// </summary>
- /// <remarks>
- /// Default value is <b>Metafile</b>. This format is better for exporting such objects as
- /// <b>MSChartObject</b> and <b>ShapeObject</b>.
- /// </remarks>
- [DefaultValue(RTFImageFormat.Metafile)]
- [Category("Rtf Format")]
- [Browsable(true)]
- public RTFImageFormat RtfImageFormat
- {
- get { return Prop.RtfImageFormat; }
- set { Prop.RtfImageFormat = value; }
- }
- /// <summary>
- /// Gets or sets a value indicating that pictures are enabled.
- /// </summary>
- [DefaultValue(true)]
- [Category("Rtf Format")]
- [Browsable(true)]
- public bool RtfPictures
- {
- get { return Prop.RtfPictures; }
- set { Prop.RtfPictures = value; }
- }
- /// <summary>
- /// Gets or sets a value indicating that page breaks are enabled.
- /// </summary>
- [DefaultValue(true)]
- [Category("Rtf Format")]
- [Browsable(true)]
- public bool RtfPageBreaks
- {
- get { return Prop.RtfPageBreaks; }
- set { Prop.RtfPageBreaks = value; }
- }
- /// <summary>
- /// Gets or sets a value that determines whether the wysiwyg mode should be used
- /// for better results.
- /// </summary>
- [DefaultValue(true)]
- [Category("Rtf Format")]
- [Browsable(true)]
- public bool RtfWysiwyg
- {
- get { return Prop.RtfWysiwyg; }
- set { Prop.RtfWysiwyg = value; }
- }
- /// <summary>
- /// Gets or sets the creator of the document.
- /// </summary>
- [DefaultValue("FastReport")]
- [Category("Rtf Format")]
- [Browsable(true)]
- public string RtfCreator
- {
- get { return Prop.RtfCreator; }
- set { Prop.RtfCreator = value; }
- }
- /// <summary>
- /// Gets or sets a value that determines whether the rows in the resulting table
- /// should calculate its height automatically.
- /// </summary>
- [DefaultValue(false)]
- [Category("Rtf Format")]
- [Browsable(true)]
- public bool RtfAutoSize
- {
- get { return Prop.RtfAutoSize; }
- set { Prop.RtfAutoSize = value; }
- }
- #endregion RTF format
- #region MHT format
- /// <summary>
- /// Switches a visibility of MHT (web-archive) export in toolbar.
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowMhtExport
- {
- get { return Prop.ShowMhtExport; }
- set { Prop.ShowMhtExport = value; }
- }
- /// <summary>
- /// Gets or sets a value indicating that pictures are enabled.
- /// </summary>
- [DefaultValue(true)]
- [Category("Mht Format")]
- [Browsable(true)]
- public bool MhtPictures
- {
- get { return Prop.MhtPictures; }
- set { Prop.MhtPictures = value; }
- }
- /// <summary>
- /// Gets or sets a value that determines whether the wysiwyg mode should be used
- /// for better results.
- /// </summary>
- [DefaultValue(true)]
- [Category("Mht Format")]
- [Browsable(true)]
- public bool MhtWysiwyg
- {
- get { return Prop.MhtWysiwyg; }
- set { Prop.MhtWysiwyg = value; }
- }
- #endregion MHT format
- #region ODS format
- /// <summary>
- /// Switches a visibility of Open Office Spreadsheet (ODS) export in toolbar.
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowOdsExport
- {
- get { return Prop.ShowOdsExport; }
- set { Prop.ShowOdsExport = value; }
- }
- /// <summary>
- /// Gets or sets a value indicating that page breaks are enabled.
- /// </summary>
- [DefaultValue(true)]
- [Category("Ods Format")]
- [Browsable(true)]
- public bool OdsPageBreaks
- {
- get { return Prop.OdsPageBreaks; }
- set { Prop.OdsPageBreaks = value; }
- }
- /// <summary>
- /// Gets or sets a value that determines whether the wysiwyg mode should be used
- /// for better results.
- /// </summary>
- [DefaultValue(true)]
- [Category("Ods Format")]
- [Browsable(true)]
- public bool OdsWysiwyg
- {
- get { return Prop.OdsWysiwyg; }
- set { Prop.OdsWysiwyg = value; }
- }
- /// <summary>
- /// Gets or sets the creator of the document.
- /// </summary>
- [DefaultValue("FastReport")]
- [Category("Ods Format")]
- [Browsable(true)]
- public string OdsCreator
- {
- get { return Prop.OdsCreator; }
- set { Prop.OdsCreator = value; }
- }
- #endregion ODS format
- #region ODT format
- /// <summary>
- /// Switches a visibility of Open Office Text (ODT) export in toolbar
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowOdtExport
- {
- get { return Prop.ShowOdtExport; }
- set { Prop.ShowOdtExport = value; }
- }
- /// <summary>
- /// Gets or sets a value indicating that page breaks are enabled.
- /// </summary>
- [DefaultValue(true)]
- [Category("Odt Format")]
- [Browsable(true)]
- public bool OdtPageBreaks
- {
- get { return Prop.OdtPageBreaks; }
- set { Prop.OdtPageBreaks = value; }
- }
- /// <summary>
- /// Gets or sets a value that determines whether the wysiwyg mode should be used
- /// for better results.
- /// </summary>
- [DefaultValue(true)]
- [Category("Odt Format")]
- [Browsable(true)]
- public bool OdtWysiwyg
- {
- get { return Prop.OdtWysiwyg; }
- set { Prop.OdtWysiwyg = value; }
- }
- /// <summary>
- /// Gets or sets the creator of the document.
- /// </summary>
- [DefaultValue("FastReport")]
- [Category("Odt Format")]
- [Browsable(true)]
- public string OdtCreator
- {
- get { return Prop.OdtCreator; }
- set { Prop.OdtCreator = value; }
- }
- #endregion ODT format
- #region XPS format
- /// <summary>
- /// Switches a visibility of XPS export in toolbar.
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowXpsExport
- {
- get { return Prop.ShowXpsExport; }
- set { Prop.ShowXpsExport = value; }
- }
- #endregion XPS format
- #region DBF format
- /// <summary>
- /// Switches a visibility of DBF export in toolbar.
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowDbfExport
- {
- get { return Prop.ShowDbfExport; }
- set { Prop.ShowDbfExport = value; }
- }
- #endregion DBF format
- #region Word2007 format
- /// <summary>
- /// Switches a visibility of Word 2007 export in toolbar.
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowWord2007Export
- {
- get { return Prop.ShowWord2007Export; }
- set { Prop.ShowWord2007Export = value; }
- }
- /// <summary>
- /// Enable or disable a matrix view of Word 2007 document.
- /// </summary>
- [DefaultValue(true)]
- [Category("Word 2007 Format")]
- [Browsable(true)]
- public bool DocxMatrixBased
- {
- get { return Prop.DocxMatrixBased; }
- set { Prop.DocxMatrixBased = value; }
- }
- /// <summary>
- /// Enable or disable the WYSIWYG for Word 2007 document.
- /// </summary>
- [DefaultValue(true)]
- [Category("Word 2007 Format")]
- [Browsable(true)]
- public bool DocxWysiwyg
- {
- get { return Prop.DocxWysiwyg; }
- set { Prop.DocxWysiwyg = value; }
- }
- /// <summary>
- /// Enable or disable a paragraph view of Word 2007 document.
- /// </summary>
- [DefaultValue(false)]
- [Category("Word 2007 Format")]
- [Browsable(true)]
- public bool DocxParagraphBased
- {
- get { return Prop.DocxParagraphBased; }
- set { Prop.DocxParagraphBased = value; }
- }
- /// <summary>
- /// Enable or disable the print optimized images in Word 2007 document.
- /// </summary>
- [DefaultValue(false)]
- [Category("Word 2007 Format")]
- [Browsable(true)]
- public bool DocxPrintOptimized
- {
- get { return Prop.DocxPrintOptimized; }
- set { Prop.DocxPrintOptimized = value; }
- }
- /// <summary>
- /// Gets or sets a value of RowHeightIs Word 2007 document.
- /// </summary>
- [DefaultValue("")]
- [Category("Word 2007 Format")]
- [Browsable(true)]
- public string DocxRowHeightIs
- {
- get { return Prop.DocxRowHeightIs; }
- set { Prop.DocxRowHeightIs = value; }
- }
- #endregion Word2007 format
- #region Excel2007 format
- /// <summary>
- /// Switches a visibility of Excel 2007 export in toolbar.
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowExcel2007Export
- {
- get { return Prop.ShowExcel2007Export; }
- set { Prop.ShowExcel2007Export = value; }
- }
- /// <summary>
- /// Gets or sets a value indicating that page breaks are enabled.
- /// </summary>
- [DefaultValue(false)]
- [Category("Excel 2007 Format")]
- [Browsable(true)]
- public bool XlsxPageBreaks
- {
- get { return Prop.XlsxPageBreaks; }
- set { Prop.XlsxPageBreaks = value; }
- }
- /// <summary>
- /// Gets or sets a value indicating that table without breaks are enabled.
- /// </summary>
- [DefaultValue(false)]
- [Category("Excel 2007 Format")]
- [Browsable(true)]
- public bool XlsxSeamless
- {
- get { return Prop.XlsxSeamless; }
- set { Prop.XlsxSeamless = value; }
- }
- /// <summary>
- /// Enable or disable the print optimized images in Excel 2007 document.
- /// </summary>
- [DefaultValue(false)]
- [Category("Excel 2007 Format")]
- [Browsable(true)]
- public bool XlsxPrintOptimized
- {
- get { return Prop.XlsxPrintOptimized; }
- set { Prop.XlsxPrintOptimized = value; }
- }
- /// <summary>
- /// Enable or disable the Print Fit in Excel 2007 document.
- /// </summary>
- [DefaultValue(false)]
- [Category("Excel 2007 Format")]
- [Browsable(true)]
- public bool XlsxPrintFitPage
- {
- get { return Prop.XlsxPrintFitPage; }
- set { Prop.XlsxPrintFitPage = value; }
- }
- /// <summary>
- /// Gets or sets a value that determines whether the wysiwyg mode should be used
- /// for better results.
- /// </summary>
- [DefaultValue(true)]
- [Category("Excel 2007 Format")]
- [Browsable(true)]
- public bool XlsxWysiwyg
- {
- get { return Prop.XlsxWysiwyg; }
- set { Prop.XlsxWysiwyg = value; }
- }
- /// <summary>
- /// Enable or disable an exporting data without any header/group bands.
- /// </summary>
- [DefaultValue(true)]
- [Category("Excel 2007 Format")]
- [Browsable(true)]
- public bool XlsxDataOnly
- {
- get { return Prop.XlsxDataOnly; }
- set { Prop.XlsxDataOnly = value; }
- }
- /// <summary>
- /// Enable or disable the Print Fit in Excel 2007 document.
- /// </summary>
- [DefaultValue(false)]
- [Category("Excel 2007 Format")]
- [Browsable(true)]
- public bool XlsxGroupOnSeparateSheet
- {
- get { return Prop.XlsxGroupOnSeparateSheet; }
- set { Prop.XlsxGroupOnSeparateSheet = value; }
- }
- #endregion Excel2007 format
- #region PowerPoint2007 format
- /// <summary>
- /// Switches a visibility of PowerPoint 2007 export in toolbar.
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowPowerPoint2007Export
- {
- get { return Prop.ShowPowerPoint2007Export; }
- set { Prop.ShowPowerPoint2007Export = value; }
- }
- /// <summary>
- /// Gets or sets an image format that will be used to save pictures in PowerPoint file.
- /// </summary>
- [DefaultValue(PptImageFormat.Png)]
- [Category("PowerPoint 2007 Format")]
- [Browsable(true)]
- public PptImageFormat PptxImageFormat
- {
- get { return Prop.PptxImageFormat; }
- set { Prop.PptxImageFormat = value; }
- }
- #endregion PowerPoint2007 format
- #region XML format
- /// <summary>
- /// Switches a visibility of XML (Excel) export in toolbar.
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowXmlExcelExport
- {
- get { return Prop.ShowXmlExcelExport; }
- set { Prop.ShowXmlExcelExport = value; }
- }
- /// <summary>
- /// Gets or sets a value indicating that page breaks are enabled.
- /// </summary>
- [DefaultValue(true)]
- [Category("Xml Excel Format")]
- [Browsable(true)]
- public bool XmlExcelPageBreaks
- {
- get { return Prop.XmlExcelPageBreaks; }
- set { Prop.XmlExcelPageBreaks = value; }
- }
- /// <summary>
- /// Gets or sets a value that determines whether the wysiwyg mode should be used
- /// for better results.
- /// </summary>
- [DefaultValue(true)]
- [Category("Xml Excel Format")]
- [Browsable(true)]
- public bool XmlExcelWysiwyg
- {
- get { return Prop.XmlExcelWysiwyg; }
- set { Prop.XmlExcelWysiwyg = value; }
- }
- /// <summary>
- /// Enable or disable an exporting data without any header/group bands.
- /// </summary>
- [DefaultValue(false)]
- [Category("Xml Excel Format")]
- [Browsable(true)]
- public bool XmlExcelDataOnly
- {
- get { return Prop.XmlExcelDataOnly; }
- set { Prop.XmlExcelDataOnly = value; }
- }
- #endregion XML format
- #region PDF format
- /// <summary>
- /// Switches a visibility of PDF (Adobe Acrobat) export in toolbar.
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowPdfExport
- {
- get { return Prop.ShowPdfExport; }
- set { Prop.ShowPdfExport = value; }
- }
- /// <summary>
- /// Enable or disable an embedding the TrueType fonts.
- /// </summary>
- [DefaultValue(true)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfEmbeddingFonts
- {
- get { return Prop.PdfEmbeddingFonts; }
- set { Prop.PdfEmbeddingFonts = value; }
- }
- /// <summary>
- /// Enable or disable an export text in curves.
- /// </summary>
- [DefaultValue(false)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfTextInCurves
- {
- get { return Prop.PdfTextInCurves; }
- set { Prop.PdfTextInCurves = value; }
- }
- /// <summary>
- /// Enable or disable an exporting of the background in PDF.
- /// </summary>
- [DefaultValue(true)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfBackground
- {
- get { return Prop.PdfBackground; }
- set { Prop.PdfBackground = value; }
- }
- /// <summary>
- /// Enable or disable the Intercative Forms inside PDF.
- /// </summary>
- [DefaultValue(false)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfInteractiveForms
- {
- get { return Prop.PdfInteractiveForms; }
- set { Prop.PdfInteractiveForms = value; }
- }
- /// <summary>
- /// Enable or disable an optimization the images for printing.
- /// </summary>
- [DefaultValue(true)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfPrintOptimized
- {
- get { return Prop.PdfPrintOptimized; }
- set { Prop.PdfPrintOptimized = value; }
- }
- /// <summary>
- /// Enable or disable a document's Outline.
- /// </summary>
- [DefaultValue(true)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfOutline
- {
- get { return Prop.PdfOutline; }
- set { Prop.PdfOutline = value; }
- }
- /// <summary>
- /// Enable or disable a displaying document's title.
- /// </summary>
- [DefaultValue(true)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfDisplayDocTitle
- {
- get { return Prop.PdfDisplayDocTitle; }
- set { Prop.PdfDisplayDocTitle = value; }
- }
- /// <summary>
- /// Enable or disable a hiding the toolbar.
- /// </summary>
- [DefaultValue(false)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfHideToolbar
- {
- get { return Prop.PdfHideToolbar; }
- set { Prop.PdfHideToolbar = value; }
- }
- /// <summary>
- /// Enable or disable a hiding the menu's bar.
- /// </summary>
- [DefaultValue(false)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfHideMenubar
- {
- get { return Prop.PdfHideMenubar; }
- set { Prop.PdfHideMenubar = value; }
- }
- /// <summary>
- /// Enable or disable a hiding the Windows UI.
- /// </summary>
- [DefaultValue(false)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfHideWindowUI
- {
- get { return Prop.PdfHideWindowUI; }
- set { Prop.PdfHideWindowUI = value; }
- }
- /// <summary>
- /// Enable or disable a fitting the window.
- /// </summary>
- [DefaultValue(false)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfFitWindow
- {
- get { return Prop.PdfFitWindow; }
- set { Prop.PdfFitWindow = value; }
- }
- /// <summary>
- /// Enable or disable a centering the window.
- /// </summary>
- [DefaultValue(false)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfCenterWindow
- {
- get { return Prop.PdfCenterWindow; }
- set { Prop.PdfCenterWindow = value; }
- }
- /// <summary>
- /// Enable or disable a scaling the page for shrink to printable area.
- /// </summary>
- [DefaultValue(true)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfPrintScaling
- {
- get { return Prop.PdfPrintScaling; }
- set { Prop.PdfPrintScaling = value; }
- }
- /// <summary>
- /// Sets the Title of the document.
- /// </summary>
- [DefaultValue("")]
- [Category("Pdf Format")]
- [Browsable(true)]
- public string PdfTitle
- {
- get { return Prop.PdfTitle; }
- set { Prop.PdfTitle = value; }
- }
- /// <summary>
- /// Sets the Author of the document.
- /// </summary>
- [DefaultValue("")]
- [Category("Pdf Format")]
- [Browsable(true)]
- public string PdfAuthor
- {
- get { return Prop.PdfAuthor; }
- set { Prop.PdfAuthor = value; }
- }
- /// <summary>
- /// Sets the Subject of the document.
- /// </summary>
- [DefaultValue("")]
- [Category("Pdf Format")]
- [Browsable(true)]
- public string PdfSubject
- {
- get { return Prop.PdfSubject; }
- set { Prop.PdfSubject = value; }
- }
- /// <summary>
- /// Sets the Keywords of the document.
- /// </summary>
- [DefaultValue("")]
- [Category("Pdf Format")]
- [Browsable(true)]
- public string PdfKeywords
- {
- get { return Prop.PdfKeywords; }
- set { Prop.PdfKeywords = value; }
- }
- /// <summary>
- /// Sets the Creator of the document.
- /// </summary>
- [DefaultValue("FastReport")]
- [Category("Pdf Format")]
- [Browsable(true)]
- public string PdfCreator
- {
- get { return Prop.PdfCreator; }
- set { Prop.PdfCreator = value; }
- }
- /// <summary>
- /// Sets the Producer of the document.
- /// </summary>
- [DefaultValue("FastReport.NET")]
- [Category("Pdf Format")]
- [Browsable(true)]
- public string PdfProducer
- {
- get { return Prop.PdfProducer; }
- set { Prop.PdfProducer = value; }
- }
- /// <summary>
- /// Sets the users password.
- /// </summary>
- [DefaultValue("")]
- [Category("Pdf Format")]
- [Browsable(true)]
- public string PdfUserPassword
- {
- get { return Prop.PdfUserPassword; }
- set { Prop.PdfUserPassword = value; }
- }
- /// <summary>
- /// Sets the owners password.
- /// </summary>
- [DefaultValue("")]
- [Category("Pdf Format")]
- [Browsable(true)]
- public string PdfOwnerPassword
- {
- get { return Prop.PdfOwnerPassword; }
- set { Prop.PdfOwnerPassword = value; }
- }
- /// <summary>
- /// Enable or disable a printing in protected document.
- /// </summary>
- [DefaultValue(true)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfAllowPrint
- {
- get { return Prop.PdfAllowPrint; }
- set { Prop.PdfAllowPrint = value; }
- }
- /// <summary>
- /// Enable or disable a modifying in protected document.
- /// </summary>
- [DefaultValue(true)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfAllowModify
- {
- get { return Prop.PdfAllowModify; }
- set { Prop.PdfAllowModify = value; }
- }
- /// <summary>
- /// Enable or disable a copying in protected document.
- /// </summary>
- [DefaultValue(true)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfAllowCopy
- {
- get { return Prop.PdfAllowCopy; }
- set { Prop.PdfAllowCopy = value; }
- }
- /// <summary>
- /// Enable or disable an annotating in protected document.
- /// </summary>
- [DefaultValue(true)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfAllowAnnotate
- {
- get { return Prop.PdfAllowAnnotate; }
- set { Prop.PdfAllowAnnotate = value; }
- }
- /// <summary>
- /// Enable or disable the PDF/A document.
- /// </summary>
- [DefaultValue(false)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfA
- {
- get { return Prop.PdfA; }
- set { Prop.PdfA = value; }
- }
- /// <summary>
- /// Enable or disable a showing of Print Dialog.
- /// </summary>
- [DefaultValue(false)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfShowPrintDialog
- {
- get { return Prop.PdfShowPrintDialog; }
- set { Prop.PdfShowPrintDialog = value; }
- }
- /// <summary>
- /// Enable or disable the Images Original Resolution.
- /// </summary>
- [DefaultValue(false)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfImagesOriginalResolution
- {
- get { return Prop.PdfImagesOriginalResolution; }
- set { Prop.PdfImagesOriginalResolution = value; }
- }
- /// <summary>
- /// Enable or disable the Jpeg Compression.
- /// </summary>
- [DefaultValue(false)]
- [Category("Pdf Format")]
- [Browsable(true)]
- public bool PdfJpegCompression
- {
- get { return Prop.PdfJpegCompression; }
- set { Prop.PdfJpegCompression = value; }
- }
- /// <summary>
- /// Select a color space (RGB or CMYK)
- /// </summary>
- [DefaultValue(typeof(PDFExport.PdfColorSpace), "RGB")]
- [Category("Pdf Format")]
- [Browsable(true)]
- public PDFExport.PdfColorSpace PdfColorSpace
- {
- get { return Prop.PdfColorSpace; }
- set { Prop.PdfColorSpace = value; }
- }
- #endregion PDF format
- #region CSV format
- /// <summary>
- /// Switch visibility the CSV (comma separated values) export in toolbar.
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowCsvExport
- {
- get { return Prop.ShowCsvExport; }
- set { Prop.ShowCsvExport = value; }
- }
- /// <summary>
- /// Gets or sets the cells separator.
- /// </summary>
- [DefaultValue(";")]
- [Category("Csv Format")]
- [Browsable(true)]
- public string CsvSeparator
- {
- get { return Prop.CsvSeparator; }
- set { Prop.CsvSeparator = value; }
- }
- /// <summary>
- /// Enable or disable an exporting data without any header/group bands.
- /// </summary>
- [DefaultValue(false)]
- [Category("Csv Format")]
- [Browsable(true)]
- public bool CsvDataOnly
- {
- get { return Prop.CsvDataOnly; }
- set { Prop.CsvDataOnly = value; }
- }
- #endregion CSV format
- #region Prepared report
- /// <summary>
- /// Switch a visibility of prepared report export in toolbar
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowPreparedReport
- {
- get { return Prop.ShowPreparedReport; }
- set { Prop.ShowPreparedReport = value; }
- }
- #endregion Prepared report
- #region Text format
- /// <summary>
- /// Switch a visibility of text (plain text) export in toolbar
- /// </summary>
- [DefaultValue(true)]
- [Category("Toolbar")]
- [Browsable(true)]
- public bool ShowTextExport
- {
- get { return Prop.ShowTextExport; }
- set { Prop.ShowTextExport = value; }
- }
- /// <summary>
- /// Enable or disable an exporting data without any header/group bands.
- /// </summary>
- [DefaultValue(false)]
- [Category("Text Format")]
- [Browsable(true)]
- public bool TextDataOnly
- {
- get { return Prop.TextDataOnly; }
- set { Prop.TextDataOnly = value; }
- }
- /// <summary>
- /// Gets or sets a value indicating that page breaks are enabled.
- /// </summary>
- [DefaultValue(true)]
- [Category("Text Format")]
- [Browsable(true)]
- public bool TextPageBreaks
- {
- get { return Prop.TextPageBreaks; }
- set { Prop.TextPageBreaks = value; }
- }
- /// <summary>
- /// Enable or disable the frames in text file.
- /// </summary>
- [DefaultValue(true)]
- [Category("Text Format")]
- [Browsable(true)]
- public bool TextAllowFrames
- {
- get { return Prop.TextAllowFrames; }
- set { Prop.TextAllowFrames = value; }
- }
- /// <summary>
- /// Enable or disable the simple (non graphic) frames in text file.
- /// </summary>
- [DefaultValue(true)]
- [Category("Text Format")]
- [Browsable(true)]
- public bool TextSimpleFrames
- {
- get { return Prop.TextSimpleFrames; }
- set { Prop.TextSimpleFrames = value; }
- }
- /// <summary>
- /// Enable or disable an empty lines in text file.
- /// </summary>
- [DefaultValue(false)]
- [Category("Text Format")]
- [Browsable(true)]
- public bool TextEmptyLines
- {
- get { return Prop.TextEmptyLines; }
- set { Prop.TextEmptyLines = value; }
- }
- #endregion Text format
- #region All exports
- private void DoProcessReport()
- {
- StringBuilder sb = new StringBuilder();
- ReportProcess(sb, this.Context);
- }
- private string GetExportFileName(string format)
- {
- string s = String.Concat(
- Path.GetFileNameWithoutExtension(
- Report.FileName.Length == 0 ? WebUtils.ReportPrefix : Report.FileName),
- ".",
- format);
- return s;
- }
- private void ResponseExport(WebExportItem exportItem, bool displayInline, HttpContext context)
- {
- WebReport webReport = new WebReport();
- WebReportCache exportcache = new WebReportCache(context);
- object webReportObject = exportcache.GetObject(exportItem.ReportID, webReport);
- if (webReportObject != null)
- {
- webReport = webReportObject as WebReport;
- if (WebUtils.SetupResponse(webReport, context))
- {
- exportItem.FileName = GetExportFileName(exportItem.Format);
- string guid = WebUtils.GetGUID();
- exportcache.PutObject(guid, exportItem);
- string url = string.Format("~/{0}?{1}={2}&displayinline={3}", WebUtils.HandlerFileName, WebUtils.ConstID, guid, displayInline);
- context.Response.Redirect(url, false);
- }
- }
- else
- {
- // 500
- }
- }
- private void ResponseExport(WebExportItem ExportItem, HttpContext context)
- {
- ResponseExport(ExportItem, false, context);
- }
- /// <summary>
- /// Exports in CSV format.
- /// </summary>
- public void ExportCsv()
- {
- ExportCsv(this.Context);
- }
- /// <summary>
- /// Exports in CSV format.
- /// </summary>
- public void ExportCsv(HttpContext context)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done && TotalPages > 0)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- CSVExport csvExport = new CSVExport();
- csvExport.OpenAfterExport = false;
- // set csv export properties
- csvExport.Separator = CsvSeparator;
- csvExport.DataOnly = CsvDataOnly;
- using (MemoryStream ms = new MemoryStream())
- {
- csvExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "csv";
- exportItem.ContentType = "text/x-csv";
- ResponseExport(exportItem, context);
- }
- }
- /// <summary>
- /// Exports in Text format.
- /// </summary>
- public void ExportText()
- {
- ExportText(this.Context);
- }
- /// <summary>
- /// Exports in Text format.
- /// </summary>
- public void ExportText(HttpContext context)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done && TotalPages > 0)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- TextExport textExport = new TextExport();
- textExport.OpenAfterExport = false;
- // set text export properties
- textExport.AvoidDataLoss = true;
- textExport.DataOnly = TextDataOnly;
- textExport.PageBreaks = TextPageBreaks;
- textExport.Frames = TextAllowFrames;
- textExport.TextFrames = TextSimpleFrames;
- textExport.EmptyLines = TextEmptyLines;
- using (MemoryStream ms = new MemoryStream())
- {
- textExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "txt";
- exportItem.ContentType = "text/plain";
- ResponseExport(exportItem, context);
- }
- }
- /// <summary>
- /// Exports in DBF format.
- /// </summary>
- public void ExportDbf()
- {
- ExportDbf(this.Context);
- }
- /// <summary>
- /// Exports in DBF format.
- /// </summary>
- public void ExportDbf(HttpContext context)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done && TotalPages > 0)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- DBFExport dbfExport = new DBFExport();
- dbfExport.OpenAfterExport = false;
- // set text export properties
- dbfExport.DataOnly = true;
- using (MemoryStream ms = new MemoryStream())
- {
- dbfExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "dbf";
- exportItem.ContentType = "application/dbf";
- ResponseExport(exportItem, context);
- }
- }
- /// <summary>
- /// Exports in PDF format.
- /// </summary>
- public void ExportPdf()
- {
- ExportPdf(this.Context, false, PdfShowPrintDialog, false);
- }
- /// <summary>
- /// Exports in PDF format.
- /// </summary>
- public void ExportPdf(bool displayInline)
- {
- ExportPdf(this.Context, displayInline, PdfShowPrintDialog, false);
- }
- /// <summary>
- /// Exports in PDF format.
- /// </summary>
- public void ExportPdf(HttpContext context)
- {
- ExportPdf(context, false, PdfShowPrintDialog, false);
- }
- /// <summary>
- /// Exports in PDF format inline.
- /// </summary>
- public void ExportPdf(HttpContext context, bool displayInline, bool showPrintDialog, bool print)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = this.ReportGuid;
- PDFExport pdfExport = new PDFExport();
- pdfExport.OpenAfterExport = false;
- // set pdf export properties
- pdfExport.EmbeddingFonts = PdfEmbeddingFonts;
- pdfExport.TextInCurves = PdfTextInCurves;
- pdfExport.Background = PdfBackground;
- pdfExport.PrintOptimized = PdfPrintOptimized;
- pdfExport.Title = PdfTitle;
- pdfExport.Author = PdfAuthor;
- pdfExport.Subject = PdfSubject;
- pdfExport.Keywords = PdfKeywords;
- pdfExport.Creator = PdfCreator;
- pdfExport.Producer = PdfProducer;
- pdfExport.Outline = PdfOutline;
- pdfExport.DisplayDocTitle = PdfDisplayDocTitle;
- pdfExport.HideToolbar = PdfHideToolbar;
- pdfExport.HideMenubar = PdfHideMenubar;
- pdfExport.HideWindowUI = PdfHideWindowUI;
- pdfExport.FitWindow = PdfFitWindow;
- pdfExport.CenterWindow = PdfCenterWindow;
- pdfExport.PrintScaling = PdfPrintScaling;
- pdfExport.UserPassword = PdfUserPassword;
- pdfExport.OwnerPassword = PdfOwnerPassword;
- pdfExport.AllowPrint = PdfAllowPrint;
- pdfExport.AllowCopy = PdfAllowCopy;
- pdfExport.AllowModify = PdfAllowModify;
- pdfExport.AllowAnnotate = PdfAllowAnnotate;
- pdfExport.PdfCompliance = PdfA ? PDFExport.PdfStandard.PdfA_2a : PDFExport.PdfStandard.None;
- pdfExport.ShowPrintDialog = showPrintDialog;
- pdfExport.InteractiveForms = PdfInteractiveForms;
- pdfExport.ExportMode = print ? PDFExport.ExportType.WebPrint : PDFExport.ExportType.Export;
- pdfExport.ImagesOriginalResolution = PdfImagesOriginalResolution;
- pdfExport.JpegCompression = PdfJpegCompression;
- pdfExport.ColorSpace = PdfColorSpace;
- using (MemoryStream ms = new MemoryStream())
- {
- pdfExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "pdf";
- exportItem.ContentType = "application/pdf";
- ResponseExport(exportItem, displayInline, context);
- }
- }
- /// <summary>
- /// Exports in HTML format inline.
- /// </summary>
- public void ExportHtml(HttpContext context, bool displayInline, bool print)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- HTMLExport htmlExport = new HTMLExport();
- htmlExport.CustomDraw += CustomDraw;
- htmlExport.OpenAfterExport = false;
- // set html export properties
- htmlExport.Navigator = false;
- htmlExport.Layers = Layers;
- htmlExport.SinglePage = true;
- htmlExport.Pictures = Pictures;
- htmlExport.Print = print;
- htmlExport.Preview = true;
- htmlExport.SubFolder = false;
- htmlExport.EmbedPictures = EmbedPictures;
- htmlExport.EnableVectorObjects = !WebUtils.IsIE8(context); // don't draw svg barcodes for IE8
- htmlExport.WebImagePrefix = String.Concat(WebUtils.GetAppRoot(context, WebUtils.HandlerFileName), "?", WebUtils.PicsPrefix);
- htmlExport.ExportMode = htmlExport.Print ? HTMLExport.ExportType.WebPrint : HTMLExport.ExportType.Export;
- using (MemoryStream ms = new MemoryStream())
- {
- htmlExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- if (htmlExport.PrintPageData != null)
- {
- WebReportCache cache = new WebReportCache(this.Context);
- // add all pictures in cache
- for (int i = 0; i < htmlExport.PrintPageData.Pictures.Count; i++)
- {
- Stream stream = htmlExport.PrintPageData.Pictures[i];
- byte[] image = new byte[stream.Length];
- stream.Position = 0;
- int n = stream.Read(image, 0, (int)stream.Length);
- string picGuid = htmlExport.PrintPageData.Guids[i];
- cache.PutObject(picGuid, image);
- }
- // cleanup
- for (int i = 0; i < htmlExport.PrintPageData.Pictures.Count; i++)
- {
- Stream stream = htmlExport.PrintPageData.Pictures[i];
- stream.Dispose();
- stream = null;
- }
- htmlExport.PrintPageData.Pictures.Clear();
- htmlExport.PrintPageData.Guids.Clear();
- }
- exportItem.Format = "html";
- exportItem.ContentType = "text/html";
- ResponseExport(exportItem, displayInline, context);
- }
- }
- /// <summary>
- /// Exports in RTF format.
- /// </summary>
- public void ExportRtf()
- {
- ExportRtf(this.Context);
- }
- /// <summary>
- /// Exports in RTF format.
- /// </summary>
- public void ExportRtf(HttpContext context)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done && TotalPages > 0)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- RTFExport rtfExport = new RTFExport();
- rtfExport.OpenAfterExport = false;
- // set Rtf export properties
- rtfExport.JpegQuality = RtfJpegQuality;
- rtfExport.ImageFormat = RtfImageFormat;
- rtfExport.Pictures = RtfPictures;
- rtfExport.PageBreaks = RtfPageBreaks;
- rtfExport.Wysiwyg = RtfWysiwyg;
- rtfExport.Creator = RtfCreator;
- rtfExport.AutoSize = RtfAutoSize;
- using (MemoryStream ms = new MemoryStream())
- {
- rtfExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "rtf";
- exportItem.ContentType = "application/rtf";
- ResponseExport(exportItem, context);
- }
- }
- /// <summary>
- /// Exports in MHT format.
- /// </summary>
- public void ExportMht()
- {
- ExportMht(this.Context);
- }
- /// <summary>
- /// Exports in MHT format.
- /// </summary>
- public void ExportMht(HttpContext context)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done && TotalPages > 0)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- MHTExport mhtExport = new MHTExport();
- mhtExport.OpenAfterExport = false;
- // set MHT export properties
- mhtExport.Pictures = MhtPictures;
- mhtExport.Wysiwyg = MhtWysiwyg;
- using (MemoryStream ms = new MemoryStream())
- {
- mhtExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "mht";
- exportItem.ContentType = "message/rfc822";
- ResponseExport(exportItem, context);
- }
- }
- /// <summary>
- /// Exports in XML (Excel 2003) format.
- /// </summary>
- public void ExportXmlExcel()
- {
- ExportXmlExcel(this.Context);
- }
- /// <summary>
- /// Exports in XML (Excel 2003) format.
- /// </summary>
- public void ExportXmlExcel(HttpContext context)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done && TotalPages > 0)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- XMLExport xmlExport = new XMLExport();
- xmlExport.OpenAfterExport = false;
- // set xml export properties
- xmlExport.PageBreaks = XmlExcelPageBreaks;
- xmlExport.Wysiwyg = XmlExcelWysiwyg;
- xmlExport.DataOnly = XmlExcelDataOnly;
- using (MemoryStream ms = new MemoryStream())
- {
- xmlExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "xls";
- exportItem.ContentType = "application/vnd.ms-excel";
- ResponseExport(exportItem, context);
- }
- }
- /// <summary>
- /// Exports in Open Office Spreadsheet format.
- /// </summary>
- public void ExportOds()
- {
- ExportOds(this.Context);
- }
- /// <summary>
- /// Exports in Open Office Spreadsheet format.
- /// </summary>
- public void ExportOds(HttpContext context)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done && TotalPages > 0)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- ODSExport odsExport = new ODSExport();
- odsExport.OpenAfterExport = false;
- // set ODS export properties
- odsExport.Creator = OdsCreator;
- odsExport.Wysiwyg = OdsWysiwyg;
- odsExport.PageBreaks = OdsPageBreaks;
- using (MemoryStream ms = new MemoryStream())
- {
- odsExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "ods";
- exportItem.ContentType = "application/x-oleobject";
- ResponseExport(exportItem, context);
- }
- }
- /// <summary>
- /// Exports in Open Office Text format.
- /// </summary>
- public void ExportOdt()
- {
- ExportOdt(this.Context);
- }
- /// <summary>
- /// Exports in Open Office Text format.
- /// </summary>
- public void ExportOdt(HttpContext context)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done && TotalPages > 0)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- ODTExport odtExport = new ODTExport();
- odtExport.OpenAfterExport = false;
- // set ODT export properties
- odtExport.Creator = OdtCreator;
- odtExport.Wysiwyg = OdtWysiwyg;
- odtExport.PageBreaks = OdtPageBreaks;
- using (MemoryStream ms = new MemoryStream())
- {
- odtExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "odt";
- exportItem.ContentType = "application/x-oleobject";
- ResponseExport(exportItem, context);
- }
- }
- /// <summary>
- /// Exports in XPS format.
- /// </summary>
- public void ExportXps()
- {
- ExportXps(this.Context);
- }
- /// <summary>
- /// Exports in XPS format.
- /// </summary>
- public void ExportXps(HttpContext context)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done && TotalPages > 0)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- XPSExport xpsExport = new XPSExport();
- xpsExport.OpenAfterExport = false;
- using (MemoryStream ms = new MemoryStream())
- {
- xpsExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "xps";
- exportItem.ContentType = "application/vnd.ms-xpsdocument";
- ResponseExport(exportItem, context);
- }
- }
- /// <summary>
- /// Exports in Excel 2007 format.
- /// </summary>
- public void ExportExcel2007()
- {
- ExportExcel2007(this.Context);
- }
- /// <summary>
- /// Exports in Excel 2007 format.
- /// </summary>
- public void ExportExcel2007(HttpContext context)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done && TotalPages > 0)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- Excel2007Export xlsxExport = new Excel2007Export();
- xlsxExport.OpenAfterExport = false;
- // set Excel 2007 export properties
- xlsxExport.PageBreaks = XlsxPageBreaks;
- xlsxExport.Seamless = XlsxSeamless;
- xlsxExport.DataOnly = XlsxDataOnly;
- xlsxExport.GroupOnSeparateSheet = XlsxGroupOnSeparateSheet;
- xlsxExport.PrintOptimized = XlsxPrintOptimized;
- xlsxExport.PrintFit = XlsxPrintFitPage ?
- Excel2007Export.PrintFitMode.FitSheetOnOnePage : Excel2007Export.PrintFitMode.NoScaling;
- xlsxExport.Wysiwyg = XlsxWysiwyg;
- using (MemoryStream ms = new MemoryStream())
- {
- xlsxExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "xlsx";
- exportItem.ContentType = "application/vnd.ms-excel";
- ResponseExport(exportItem, context);
- }
- }
- /// <summary>
- /// Exports in Word 2007 format.
- /// </summary>
- public void ExportWord2007()
- {
- ExportWord2007(this.Context);
- }
- /// <summary>
- /// Exports in Word 2007 format.
- /// </summary>
- public void ExportWord2007(HttpContext context)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done && TotalPages > 0)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- Word2007Export docxExport = new Word2007Export();
- docxExport.OpenAfterExport = false;
- docxExport.Wysiwyg = DocxWysiwyg;
- // set Word 2007 export properties
- docxExport.MatrixBased = DocxMatrixBased;
- docxExport.ParagraphBased = DocxParagraphBased;
- docxExport.PrintOptimized = DocxPrintOptimized;
- if (!String.IsNullOrEmpty(DocxRowHeightIs) && DocxRowHeightIs.ToLower() == "min")
- docxExport.RowHeight = Word2007Export.RowHeightType.Minimum;
- else
- docxExport.RowHeight = Word2007Export.RowHeightType.Exactly;
- using (MemoryStream ms = new MemoryStream())
- {
- docxExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "docx";
- exportItem.ContentType = "application/vnd.ms-word";
- ResponseExport(exportItem, context);
- }
- }
- /// <summary>
- /// Exports in PowerPoint 2007 format.
- /// </summary>
- public void ExportPowerPoint2007()
- {
- ExportPowerPoint2007(this.Context);
- }
- /// <summary>
- /// Exports in PowerPoint 2007 format.
- /// </summary>
- public void ExportPowerPoint2007(HttpContext context)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done && TotalPages > 0)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- PowerPoint2007Export pptxExport = new PowerPoint2007Export();
- pptxExport.OpenAfterExport = false;
- // set Power Point 2007 properties
- pptxExport.ImageFormat = PptxImageFormat;
- using (MemoryStream ms = new MemoryStream())
- {
- pptxExport.Export(Report, ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "pptx";
- exportItem.ContentType = "application/vnd.ms-powerpoint ";
- ResponseExport(exportItem, context);
- }
- }
- /// <summary>
- /// Exports in prepared report.
- /// </summary>
- public void ExportPrepared()
- {
- ExportPrepared(this.Context);
- }
- /// <summary>
- /// Exports in prepared report.
- /// </summary>
- public void ExportPrepared(HttpContext context)
- {
- if (State != ReportState.Done)
- DoProcessReport();
- if (State == ReportState.Done && TotalPages > 0)
- {
- WebExportItem exportItem = new WebExportItem();
- exportItem.ReportID = ReportGuid;
- using (MemoryStream ms = new MemoryStream())
- {
- Report.SavePrepared(ms);
- exportItem.File = ms.ToArray();
- }
- exportItem.Format = "fpx";
- exportItem.ContentType = "application/octet-stream";
- ResponseExport(exportItem, context);
- }
- }
- /// <summary>
- /// Prints in Adobe Acrobat.
- /// </summary>
- public void PrintPdf()
- {
- ExportPdf(this.Context, true, true, true);
- }
- /// <summary>
- /// Prints in Adobe Acrobat.
- /// </summary>
- public void PrintPdf(HttpContext context)
- {
- ExportPdf(context, true, true, true);
- }
- /// <summary>
- /// Prints in Adobe Acrobat.
- /// </summary>
- public void PrintPdf(bool showPrintDialog)
- {
- ExportPdf(this.Context, true, showPrintDialog, true);
- }
- /// <summary>
- /// Prints in Adobe Acrobat.
- /// </summary>
- public void PrintPdf(HttpContext context, bool showPrintDialog)
- {
- ExportPdf(context, true, showPrintDialog, true);
- }
- /// <summary>
- /// Prints in browser.
- /// </summary>
- public void PrintHtml()
- {
- ExportHtml(this.Context, true, true);
- }
- /// <summary>
- /// Prints in browser.
- /// </summary>
- public void PrintHtml(HttpContext context)
- {
- ExportHtml(context, true, true);
- }
- #endregion All exports
- }
- }
|