Telerik Forums
Reporting Forum
1 answer
77 views
Hello All. I have a problem I am not sure how to fix. I developed a bunch of reports using Q3 2011 and my boss took it upon himself to move my development projects to a new pc and reformatted the old one. The problem I face now is that none of my reports will open and I can not find the original install for Q3 2011 to reinstall in hopes of fixing the issue.

I get several errors telling me that a slew of parameters with name 'xxx' already exist, where 'xxx' is the name of one of my parameters. How can I fix this issue??
Stef
Telerik team
 answered on 07 Nov 2013
3 answers
157 views
Hello,

We have a problem with a report when exporting to PDF. For some reason a chart is split over 2 pages when exporting. The problem only occurs at the production server. If we export the report locally there aren't any problems. 

I attached some screenshots with the problem. 

Specifications
Iss (v7.5.6) is on both systems the same.
We used a copy of the productiondatabase so that can't be the problem.
Windows 7 (local) vs Windows Server 2008 (production)

Sodi We



Stef
Telerik team
 answered on 07 Nov 2013
2 answers
314 views
I am going mad with this:
I have made a report in a class library and then referenced the DLL in my website project.
Added the viewer and the code in the page behind:
protected void Page_Load(object sender, EventArgs e)
   {
       ReportViewer1.Report = new MyClassRep1.IndustryRep();
   }
Locally on my machine is working fine. No problems of any type. Beautiful.
Then I change the string in the web.config from the local database :

<add name="stad_conn" connectionString="Data Source=WIN-72PL3253COR\SQLEXPRESS;Initial Catalog=DataIntelli1;Integrated Security=True;"/>
to the production database:
<add name="stad_conn" connectionString="Data Source=foooo.db.1and1.com;
Initial Catalog=fooo;
uid=fooo;
pwd=myPassword" providerName="System.Data.SqlClient"  />

And when I finally try to run the report on the production server I get the following message (also in the attached pic):

"""An error has occurred while processing Report 'IndustryRep': Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."""

What is very strange is that I have other additional 4 reports on the same website out of the same class library that works without problems.
What could be wrong on this particular report?
Some help will be appreciated.
Thanks,
Felice
Felice
Top achievements
Rank 1
 answered on 07 Nov 2013
4 answers
191 views
Hi,
I know this question has been asked in the past but may be that with time and new added features there is something new on this subject.
I have a simple report with Customers by countries and I would like to give the user the possibility to choose a specific country to be rendered as report.

Is there a way to add a filter with preselected values on the report that can be used at runtime by the user?
Something like a drop down list.

Thanks,
Felice


Felice
Top achievements
Rank 1
 answered on 06 Nov 2013
1 answer
290 views
HI

I have a class

public class LeaveDaysData
    {
        public KozpontiFelhasznaloProfilItem User {get; set;}
        public List<DateTime> Datum {get; set;}

        public LeaveDaysData()
        {
            Datum = new List<DateTime>();
        }
    }

List<LeaveDaysData> is the the datasource of my List in report. In report I need to display the first and the last element of the nested Datum List, but if I put one more List and bound datasource to the Datum list it displays first elements date as the first and last element, and it repeats as much elements are int he list.

thnx
Attila
Top achievements
Rank 1
 answered on 06 Nov 2013
3 answers
706 views
Hello,
Currently I'm using Telerik Reporting as internal rendering process of file request. During initialization in MVC application I have following code:
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);
So as you can see I render file and return it normaly as MVC File
return File(result.DocumentBytes, "application/pdf", "File.pdf");
I'm also changing internal connection string because the same report can run against different databases:
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;
                }
            }
        }

My question now is how to use report generated by line:
var reportSource = new InstanceReportSource { ReportDocument = reportDocument };
 in HTML5 MVC application?

I cannot find any example how to use such automatic report in new functionality.
Could you help me?
Stef
Telerik team
 answered on 06 Nov 2013
3 answers
86 views
I'm getting the following error when exporting to pdf, any idea?

Server Error in '/' Application.

Cannot set new clip region in an inner graphic state level.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotImplementedException: Cannot set new clip region in an inner graphic state level.

Source Error:

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.

Stack Trace:

[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


Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3053
Stef
Telerik team
 answered on 06 Nov 2013
3 answers
298 views
Hi,

I have been using telerik version with aspx like this:

<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>

This worked fine. Now I would like to use MVC Report Viewer. So I went through the tutorial How-to: Using HTML5 Report Viewer extension in an ASP.NET MVC4 application But got stuck at the end. Problem is the part bellow:

@(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)
)

I'm using Visual Studio integrated report designer and I don't have any html template or trdx file. So I at least figured out this code:

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)

But problem is that the template looks like whole report design for some tutorial and when I ommit the TemplateUrl method. I get exception that it is required, but I don't know how to get my own html template from VS designer.

Second problem is where should I set my DataSource? I thinks it should be somehow resolved in ReportsController from tutorial. Or should it be passed directly in the html extension?
Stef
Telerik team
 answered on 06 Nov 2013
2 answers
448 views
Hi! In one table I've got one column with client address, and for parsing purpose it has this char(:) like(st.:Some street,:apt.:30).

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!

Stef
Telerik team
 answered on 06 Nov 2013
5 answers
98 views
Hi,

After the update some reports suddenly have a border. I found that the report got a border with of 1pt, that i can change to 0pt.
So if i do that on al my reports then i'm ok.

But when we set a backgound image it does not stretch the report so you can only see a part of the backgoundimage.
The image is set from code behind like:

Bitmap imagedata =new Bitmap(Image.FromFile(HostingEnvironment.MapPath(string.Format("~/images/global/duplicaat-{0}.gif",languageId == 2 ? "FR" : "NL"))));

report.Style.BackgroundImage.ImageData = imagedata;


In de attached files you can see "licaat" while the image says "Duplicaat".

How can i make the report stretch to see the complete background image?
Koen L
Top achievements
Rank 1
 answered on 06 Nov 2013
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?