or
var reportDefinitionFile = Path.Combine(dataFolder, company, "Notice.trdx"); if (!System.IO.File.Exists(reportDefinitionFile)) { throw new HttpException((int)HttpStatusCode.NotFound, "File not found."); } var xmlSerializer = new ReportXmlSerializer(); var reportDocument = (Report)xmlSerializer.Deserialize(reportDefinitionFile); reportDocument.ReportParameters["ContactId"].Value = n.ToString("D"); var sds = (SqlDataSource)reportDocument.DataSource; sds.ConnectionString = database.ConnectionString; this.SetConnectionString(reportDocument.Items, database.ConnectionString); // create a ReportSource object var reportSource = new InstanceReportSource { ReportDocument = reportDocument }; var reportProcessor = new ReportProcessor(); RenderingResult result = reportProcessor.RenderReport("PDF", reportSource, null);return File(result.DocumentBytes, "application/pdf", "File.pdf");private void SetConnectionString(IEnumerable<ReportItemBase> items, string connectionString) { foreach (ReportItemBase ib in items) { if (ib.Items != null) { this.SetConnectionString(ib.Items, connectionString); } Type type = ib.GetType(); PropertyInfo dataSourceProperty = type.GetProperty("DataSource"); if (dataSourceProperty == null) { continue; } var dataSource = dataSourceProperty.GetValue(ib, null) as System.Web.UI.WebControls.SqlDataSource; if (dataSource != null) { dataSource.ConnectionString = connectionString; } } }var reportSource = new InstanceReportSource { ReportDocument = reportDocument };
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
|
[NotImplementedException: Cannot set new clip region in an inner graphic state level.] Telerik.Reporting.Pdf.Rendering.PdfRenderer.SetClip(GraphicsPath path, CombineMode combineMode) +267 Telerik.Reporting.Pdf.Drawing.PdfGraphics.SetClip(GraphicsPath path, CombineMode combineMode) +72 Telerik.Reporting.Pdf.Drawing.PdfGraphics.SetClip(RectangleF rect, CombineMode mode) +51 Telerik.Reporting.ImageRendering.CanvasPdf.SetClip(RectangleF rect, CombineMode mode) +88 Telerik.Reporting.ImageRendering.CanvasBase.SetClipOnPage(RectangleF rect, CombineMode mode) +85 Telerik.Reporting.ImageRendering.RenderingElement.RenderToPage(RectangleRF clip, RoundedFloat parentLeft, RoundedFloat parentTop, RoundedFloat parentReservedTop, RoundedFloat parentReservedBottom, RoundedFloat parentReservedLeft, RoundedFloat parentReservedRight) +1102 Telerik.Reporting.ImageRendering.CompositionBase.RenderPageSection(PageArea pageArea, RenderingElement pageSection, Single height) +585 Telerik.Reporting.ImageRendering.CompositionBase.ApplyPageSections() +174 Telerik.Reporting.ImageRendering.CompositionBase.SendPhysicalPages(Boolean force) +52 Telerik.Reporting.ImageRendering.CompositionBase.End() +74 Telerik.Reporting.ImageRendering.CompositionPdf.End() +39 Telerik.Reporting.ImageRendering.CompositionBase.Dispose(Boolean disposing) +22 Telerik.Reporting.ImageRendering.CompositionPdf.Dispose(Boolean disposing) +11 Telerik.Reporting.ImageRendering.CompositionBase.System.IDisposable.Dispose() +17 Telerik.Reporting.ImageRendering.ImageRendererBase.RenderReport(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback) +224 Telerik.Reporting.ImageRendering.ImageRendererBase.Telerik.Reporting.Processing.IRenderingExtension.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback) +21 Telerik.Reporting.Processing.ReportProcessor.Render(IList`1 reports, ExtensionInfo extensionInfo, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback) +427 Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, IReportDocument reportDocument, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback) +419 Telerik.ReportViewer.WebForms.ServerReport.Render(HttpResponse response, String format, Int32 pageIndex) in ServerReport.cs:110 Telerik.ReportViewer.WebForms.ReportExportOperation.PerformOperation(NameValueCollection urlQuery, HttpContext context) in ReportExportOperation.cs:15 Telerik.ReportViewer.WebForms.HttpHandler.ProcessRequest(HttpContext context) in HttpHandler.cs:71 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 |
<script runat="server"> public override void VerifyRenderingInServerForm(Control control) { // to avoid the server form (<form runat="server"> requirement } protected override void OnLoad(EventArgs e) { base.OnLoad(e); var instanceReportSource = new Telerik.Reporting.InstanceReportSource(); instanceReportSource.ReportDocument = new UI.Web.Areas.Reporting.Test1(); ReportViewer1.ReportSource = instanceReportSource; }</script><form id="form1" runat="server"> <telerik:ReportViewer ID="ReportViewer1" runat="server"></telerik:ReportViewer></form>@(Html.TelerikReporting().ReportViewer() _ .Id("reportViewer1") _ .ServiceUrl("/api/reports/") _ .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.htmll") _ .ReportSource(New UriReportSource() With {.Uri = "Product Catalog.trdx"}) _ .ViewMode(ViewModes.INTERACTIVE) _ .ScaleMode(ScaleModes.SPECIFIC) _ .Scale(1.0) _ .PersistSession(True))Html.TelerikReporting().ReportViewer() .Id("reportViewer1") .TemplateUrl("/Reporting/telerikReportViewerTemplate.html") .ReportSource(new Telerik.Reporting.TypeReportSource("UI.Web, Areas.Reporting.Test1")) .ViewMode(ViewModes.INTERACTIVE) .ScaleMode(ScaleModes.SPECIFIC) .Scale(1.0) .PersistSession(true)Of Course! I don't want to show this char in report.
So, the question is, how can I remove or replace this char from address column?
Thank You in advance!
Bitmap imagedata =new Bitmap(Image.FromFile(HostingEnvironment.MapPath(string.Format("~/images/global/duplicaat-{0}.gif",languageId == 2 ? "FR" : "NL"))));
report.Style.BackgroundImage.ImageData = imagedata;