public ManagedXpsDocument(Uri packageUri, Package package, ReportContentDefinition xpsHeaderAndFooterDefinition, ReportProperties reportProperties) : base(package, CompressionOption.SuperFast, packageUri.ToString()) { this.PackageUri = packageUri; RegisterAtPackageStoreWith(package, packageUri); this._xpsHeaderAndFooterDefinition = xpsHeaderAndFooterDefinition; this._reportProperties = reportProperties; }
public static Task GetPdfReportFromObjectListAsync <T>(ReportProperties reportProperties, IEnumerable <T> dataSourceObjectList, CancellationToken token = default, IProgress <double> progress = null) { var taskCompletionSource = new TaskCompletionSource <object>(); var thread = new Thread(() => GetPdfReportFromObjectList(reportProperties, dataSourceObjectList, token, progress)); thread.SetApartmentState(ApartmentState.STA); thread.Start(); return(taskCompletionSource.Task); }
public static void CreatePdfReportFromObjectList <T>(ReportProperties reportProperties, IEnumerable <T> dataSourceObjectList, CancellationToken cancellationToken = default, IProgress <double> progressReporter = null) { if (dataSourceObjectList == null) { throw new ArgumentNullException(nameof(dataSourceObjectList)); } _cancellationToken = cancellationToken; _progressReporter = progressReporter; var xpsDocumentSplicer = new XpsDocumentSplicer(reportProperties); Fill(ref xpsDocumentSplicer, dataSourceObjectList); if (IsCancellationRequested()) { return; } SaveAsPdf(xpsDocumentSplicer, reportProperties.OutputDirectory); FinishProgress(); }
public static FileStream GetPdfReportFromObjectList <T>(ReportProperties reportProperties, IEnumerable <T> dataSourceObjectList, CancellationToken cancellationToken = default, IProgress <double> progressReporter = null) { if (dataSourceObjectList == null) { throw new ArgumentNullException(nameof(dataSourceObjectList)); } _cancellationToken = cancellationToken; _progressReporter = progressReporter; var xpsDocumentSplicer = new XpsDocumentSplicer(reportProperties); Fill(ref xpsDocumentSplicer, dataSourceObjectList); if (IsCancellationRequested()) { return(null); } FileStream pdfFileStream = GetAsPdfFileStream(xpsDocumentSplicer); FinishProgress(); return(pdfFileStream); }
public static async Task GetPdfReportFromObjectAsync <T>(ReportProperties reportProperties, T dataSourceObject, CancellationToken token = default, IProgress <double> progress = null) { await GetPdfReportFromObjectListAsync(reportProperties, new List <T> { dataSourceObject }, token, progress).ConfigureAwait(false); }
public XpsDocumentSplicer(ReportProperties reportProperties) { this._reportProperties = reportProperties; }