Telerik Forums
Reporting Forum
2 answers
634 views
We have a Silverlight application that uses an embedded Telerik report viewer to display a Crystal Report. The application consumes a Silverlight WCF.  Connecting the WCF to listboxes, comboboxes and the datagrid work fine.  However, the error below is thrown when attempting to bind the WCF to the report viewer. Any suggestions as to why this is happening and how to resolve it?  We've reviewed other questions on this forum that are similar to this issue but none of the answers worked for us.

"Content Type text/xml; charset=utf-8 was sent to a service expecting application/soap+xml; charset=utf-8.  The client and service bindings may be mismatched."

Thank you.
Stef
Telerik team
 answered on 29 Apr 2013
3 answers
299 views
dear team,
i have a textbox located in a group section in a sub report.
basically i just want to access this textbox from my main report and get its value.
Hadib Ahmabi
Top achievements
Rank 1
 answered on 29 Apr 2013
3 answers
817 views
Hi,

We are using telerik report version 'Telerik_Reporting_Q2_2010_v4_1_10_714_dev.msi'.

Previously, we have problem of having first page blank in the report viewer. So, to correct this problem, we added following code in the vb file and its working properly.

Public Sub New()
        InitializeComponent()
        detail.Height = Unit.Pixel(10)
    End Sub


But while exporting same report to PDF we are seeing first page blank in PDF. Here is the code how we are exporting report to PDF,

  Protected Sub ExportToPDF(ByVal reportToExport As Telerik.Reporting.Report)

        Dim deviceInfo As Hashtable = New Hashtable()
        deviceInfo("FontEmbedding") = "Subset"
        Dim reportProcessor As New ReportProcessor()
        Dim result As RenderingResult = reportProcessor.RenderReport("pdf", reportToExport, deviceInfo)

        Dim fileName As String = result.DocumentName + ".pdf"
        Response.Clear()
        Response.ContentType = result.MimeType
        Response.Cache.SetCacheability(HttpCacheability.Private)
        Response.Expires = -1
        Response.Buffer = True

        Response.AddHeader("Content-Disposition", String.Format("{0};FileName=""{1}""", "attachment", fileName))
        Response.BinaryWrite(result.DocumentBytes)
        Response.End()

    End Sub


Do you have any idea how to resolve this?

Also, please see the attachment file which is the format of PDF we are getting.

Thanks
Peter
Telerik team
 answered on 29 Apr 2013
3 answers
302 views
hi all,

My report contains lot of tables and few of them are very wide.I have a horizontal scroll bar at bottom of the report.If a user want to view the table that is wide and it is at top of the report he has to go down the report scroll the horizontal scroll bar to right and come up to see the report.I want a horizontal scroll bar at top of the report too so he need not go down.can any one help on this.

thanks,
Bhanu
Hadib Ahmabi
Top achievements
Rank 1
 answered on 29 Apr 2013
1 answer
120 views
I'm getting errors when opening an exported report from the report book.

Telerik.Reporting.OpenXmlRendering.Spreadsheet.Workbook.TrimName

This appears to only trim one instance of an invalid character.
"Report Name 04/24/3013" <= This consists of multiple forward slashes, but only one is removed.

if (!string.IsNullOrEmpty(name))
    {
        string str = ":\\/?*[]";
        for (int i = 0; i < str.Length; i++)
        {
            char chr = str[i];
            int num = name.IndexOf(chr);
            if (num >= 0)
            {
                name = name.Remove(num, 1);
            }
        }
        if (name.Length > 31)
        {
            name = name.Remove(31);
        }
    }
Elian
Telerik team
 answered on 29 Apr 2013
3 answers
186 views
Hello,

I'm building a report using Report Designer Q2 2012 but I have a problem with labels that are too close to each other. I want to hide them in the chart but I can't find a way to do that. So let me explain my scenario:

I have a table with 3 columns: ActivityName, DayNr and NrOfMessages. ActivityName can be many things, so the chart series must be dynamic. I use the property "DataGroupColumn" and assign it value to "ActivityName" and that way I have the dynamic series generated. But now I can't change the series appearance and change "ShowLabels" property to false. I can't make this report using code, it must be done in the designer and I can't use either the "IntelligentLabelsEnabled" as true because I lose a lot of performance. I have put an attachment with a print screen of my resulting graph so you can understand better.

Can you help me?

Best regards,
Paulo Mendonça
Elian
Telerik team
 answered on 29 Apr 2013
4 answers
132 views
Hi All,

I am new to telerik view, I have been trying to learn it and followed the telerik video to design a Sales Dashboard Report.

After I complete the Cross tab report and want to see the report designed so far and click Preview, I am encountering the below error:
Do not know what is the problem. The Error is as below:
"An error has occurred while processing Table 'crosstab1': Value of Top/Bootom  filters evaluate to integer"

Please find the code generated by the designer below:
namespace ReportsLibrary
{
    partial class DashboardReport
    {
        #region Component Designer generated code
        /// <summary>
        /// Required method for telerik Reporting designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DashboardReport));
            Telerik.Reporting.TableGroup tableGroup1 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.TableGroup tableGroup2 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.TableGroup tableGroup3 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.ReportParameter reportParameter1 = new Telerik.Reporting.ReportParameter();
            Telerik.Reporting.Drawing.StyleRule styleRule1 = new Telerik.Reporting.Drawing.StyleRule();
            this.textBox7 = new Telerik.Reporting.TextBox();
            this.textBox9 = new Telerik.Reporting.TextBox();
            this.textBox8 = new Telerik.Reporting.TextBox();
            this.yeardatasource = new Telerik.Reporting.SqlDataSource();
            this.pageHeaderSection1 = new Telerik.Reporting.PageHeaderSection();
            this.textBox1 = new Telerik.Reporting.TextBox();
            this.pictureBox1 = new Telerik.Reporting.PictureBox();
            this.textBox4 = new Telerik.Reporting.TextBox();
            this.detail = new Telerik.Reporting.DetailSection();
            this.textBox2 = new Telerik.Reporting.TextBox();
            this.crosstab1 = new Telerik.Reporting.Crosstab();
            this.textBox6 = new Telerik.Reporting.TextBox();
            this.textBox10 = new Telerik.Reporting.TextBox();
            this.textBox5 = new Telerik.Reporting.TextBox();
            this.SalesPersonDatasource = new Telerik.Reporting.SqlDataSource();
            this.pageFooterSection1 = new Telerik.Reporting.PageFooterSection();
            this.textBox3 = new Telerik.Reporting.TextBox();
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
            // 
            // textBox7
            // 
            this.textBox7.Name = "textBox7";
            this.textBox7.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0.5D));
            this.textBox7.Value = "= \'Q\' + ReportsLibrary.DashboardReport.Qtr(Fields.OrderDate)";
            // 
            // textBox9
            // 
            this.textBox9.Name = "textBox9";
            this.textBox9.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(2D), Telerik.Reporting.Drawing.Unit.Inch(0.5D));
            this.textBox9.StyleName = "";
            this.textBox9.Value = "Total";
            // 
            // textBox8
            // 
            this.textBox8.Name = "textBox8";
            this.textBox8.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0.5D));
            this.textBox8.Value = "= Fields.SalesPersonFullName";
            // 
            // yeardatasource
            // 
            this.yeardatasource.ConnectionString = "ReportsLibrary.Properties.Settings.AdventureWorks";
            this.yeardatasource.Name = "yeardatasource";
            this.yeardatasource.SelectCommand = "SELECT \r\n  Distinct YEAR(OrderDate) as YEAR\r\n  FROM Sales.SalesOrderHeader so\r\nOR" +
    "DER BY YEAR asc\r\n  ";
            // 
            // pageHeaderSection1
            // 
            this.pageHeaderSection1.Height = Telerik.Reporting.Drawing.Unit.Inch(0.90000009536743164D);
            this.pageHeaderSection1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.textBox1,
            this.pictureBox1,
            this.textBox4});
            this.pageHeaderSection1.Name = "pageHeaderSection1";
            // 
            // textBox1
            // 
            this.textBox1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(3.9418537198798731E-05D), Telerik.Reporting.Drawing.Unit.Inch(3.9378803194267675E-05D));
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(5.9999213218688965D), Telerik.Reporting.Drawing.Unit.Inch(0.60000008344650269D));
            this.textBox1.Style.BackgroundColor = System.Drawing.Color.White;
            this.textBox1.Style.Color = System.Drawing.Color.FromArgb(((int)(((byte)(135)))), ((int)(((byte)(145)))), ((int)(((byte)(164)))));
            this.textBox1.Style.Font.Name = "Arial Black";
            this.textBox1.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(30D);
            this.textBox1.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
            this.textBox1.Value = "Quarterly Sales";
            // 
            // pictureBox1
            // 
            this.pictureBox1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(3.9418537198798731E-05D), Telerik.Reporting.Drawing.Unit.Inch(3.9378803194267675E-05D));
            this.pictureBox1.MimeType = "image/bmp";
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1.0999606847763062D), Telerik.Reporting.Drawing.Unit.Inch(0.60000008344650269D));
            this.pictureBox1.Value = ((object)(resources.GetObject("pictureBox1.Value")));
            // 
            // textBox4
            // 
            this.textBox4.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(0D), Telerik.Reporting.Drawing.Unit.Inch(0.60011816024780273D));
            this.textBox4.Name = "textBox4";
            this.textBox4.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(5.9999213218688965D), Telerik.Reporting.Drawing.Unit.Inch(0.19988186657428742D));
            this.textBox4.Style.BackgroundColor = System.Drawing.Color.Silver;
            this.textBox4.Style.Color = System.Drawing.Color.FromArgb(((int)(((byte)(135)))), ((int)(((byte)(145)))), ((int)(((byte)(164)))));
            this.textBox4.Style.Font.Name = "Arial Black";
            this.textBox4.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(10D);
            this.textBox4.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
            this.textBox4.Value = "(Internal Use Only)";
            // 
            // detail
            // 
            this.detail.Height = Telerik.Reporting.Drawing.Unit.Inch(2D);
            this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.textBox2,
            this.crosstab1});
            this.detail.Name = "detail";
            // 
            // textBox2
            // 
            this.textBox2.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(3.9418537198798731E-05D), Telerik.Reporting.Drawing.Unit.Inch(3.9418537198798731E-05D));
            this.textBox2.Name = "textBox2";
            this.textBox2.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(5.7999610900878906D), Telerik.Reporting.Drawing.Unit.Inch(0.3999999463558197D));
            this.textBox2.Style.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(135)))), ((int)(((byte)(145)))), ((int)(((byte)(164)))));
            this.textBox2.Style.Color = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
            this.textBox2.Style.Font.Name = "Arial Black";
            this.textBox2.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(16D);
            this.textBox2.Value = "Top 5 Performing Agents";
            // 
            // crosstab1
            // 
            this.crosstab1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Inch(1D)));
            this.crosstab1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Inch(2D)));
            this.crosstab1.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(Telerik.Reporting.Drawing.Unit.Inch(0.5D)));
            this.crosstab1.Body.SetCellContent(0, 0, this.textBox6);
            this.crosstab1.Body.SetCellContent(0, 1, this.textBox10);
            tableGroup1.Groupings.Add(new Telerik.Reporting.Grouping("= ReportsLibrary.DashboardReport.Qtr(Fields.OrderDate)"));
            tableGroup1.Name = "Quarter";
            tableGroup1.ReportItem = this.textBox7;
            tableGroup1.Sortings.Add(new Telerik.Reporting.Sorting("= ReportsLibrary.DashboardReport.Qtr(Fields.OrderDate)", Telerik.Reporting.SortDirection.Asc));
            //tableGroup2.Name = "Group1";
            tableGroup2.ReportItem = this.textBox9;
            this.crosstab1.ColumnGroups.Add(tableGroup1);
            this.crosstab1.ColumnGroups.Add(tableGroup2);
            this.crosstab1.Corner.SetCellContent(0, 0, this.textBox5);
            this.crosstab1.DataSource = this.SalesPersonDatasource;
            this.crosstab1.Filters.Add(new Telerik.Reporting.Filter("=Fields.OrderDate.Year", Telerik.Reporting.FilterOperator.Equal, "=Parameters.ReportYear.Value"));
            this.crosstab1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.textBox6,
            this.textBox10,
            this.textBox7,
            this.textBox9,
            this.textBox5,
            this.textBox8});
            this.crosstab1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(3.9418537198798731E-05D), Telerik.Reporting.Drawing.Unit.Inch(0.40011820197105408D));
            this.crosstab1.Name = "crosstab1";
            tableGroup3.Filters.Add(new Telerik.Reporting.Filter("= Sum(Fields.SubTotal)", Telerik.Reporting.FilterOperator.TopN, "5"));
            tableGroup3.Groupings.Add(new Telerik.Reporting.Grouping("=Fields.SalesPersonFullName"));
            tableGroup3.Name = "SalesPersonFullName";
            tableGroup3.ReportItem = this.textBox8;
            tableGroup3.Sortings.Add(new Telerik.Reporting.Sorting("= Sum(Fields.SubTotal)", Telerik.Reporting.SortDirection.Desc));
            this.crosstab1.RowGroups.Add(tableGroup3);
            this.crosstab1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(4D), Telerik.Reporting.Drawing.Unit.Inch(1D));
            // 
            // textBox6
            // 
            this.textBox6.Format = "{0:#.}";
            this.textBox6.Name = "textBox6";
            this.textBox6.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0.5D));
            this.textBox6.Value = "= Sum(Fields.SubTotal) / 1000.0";
            // 
            // textBox10
            // 
            this.textBox10.Name = "textBox10";
            this.textBox10.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(2D), Telerik.Reporting.Drawing.Unit.Inch(0.5D));
            this.textBox10.StyleName = "";
            this.textBox10.Value = "= Sum(Fields.SubTotal) / 1000.0";
            // 
            // textBox5
            // 
            this.textBox5.Name = "textBox5";
            this.textBox5.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0.5D));
            this.textBox5.Value = "Sales Person ";
            // 
            // SalesPersonDatasource
            // 
            this.SalesPersonDatasource.ConnectionString = "ReportsLibrary.Properties.Settings.AdventureWorks";
            this.SalesPersonDatasource.Name = "SalesPersonDatasource";
            this.SalesPersonDatasource.Parameters.AddRange(new Telerik.Reporting.SqlDataSourceParameter[] {
            new Telerik.Reporting.SqlDataSourceParameter("@ReportYear", System.Data.DbType.Int32, "=Parameters.ReportYear.Value")});
            this.SalesPersonDatasource.SelectCommand = resources.GetString("SalesPersonDatasource.SelectCommand");
            // 
            // pageFooterSection1
            // 
            this.pageFooterSection1.Height = Telerik.Reporting.Drawing.Unit.Inch(2D);
            this.pageFooterSection1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.textBox3});
            this.pageFooterSection1.Name = "pageFooterSection1";
            // 
            // textBox3
            // 
            this.textBox3.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(3.9418537198798731E-05D), Telerik.Reporting.Drawing.Unit.Inch(3.9418537198798731E-05D));
            this.textBox3.Name = "textBox3";
            this.textBox3.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(5.7999610900878906D), Telerik.Reporting.Drawing.Unit.Inch(0.3999999463558197D));
            this.textBox3.Style.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(135)))), ((int)(((byte)(145)))), ((int)(((byte)(164)))));
            this.textBox3.Style.Color = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
            this.textBox3.Style.Font.Name = "Arial Black";
            this.textBox3.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(16D);
            this.textBox3.Value = "Top 5 Performing Stores";
            // 
            // DashboardReport
            // 
            this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.pageHeaderSection1,
            this.detail,
            this.pageFooterSection1});
            this.Name = "DashboardReport";
            this.PageSettings.Landscape = true;
            this.PageSettings.Margins = new Telerik.Reporting.Drawing.MarginsU(Telerik.Reporting.Drawing.Unit.Inch(0.30000001192092896D), Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0.40000000596046448D), Telerik.Reporting.Drawing.Unit.Inch(1D));
            this.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Letter;
            reportParameter1.AutoRefresh = true;
            reportParameter1.AvailableValues.DataSource = this.yeardatasource;
            reportParameter1.AvailableValues.DisplayMember = "= Fields.YEAR";
            reportParameter1.AvailableValues.ValueMember = "= Fields.YEAR";
            reportParameter1.Name = "ReportYear";
            reportParameter1.Text = "Sales for Year";
            reportParameter1.Type = Telerik.Reporting.ReportParameterType.Integer;
            reportParameter1.Value = "2001";
            reportParameter1.Visible = true;
            this.ReportParameters.Add(reportParameter1);
            this.Style.BackgroundColor = System.Drawing.Color.White;
            styleRule1.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] {
            new Telerik.Reporting.Drawing.TypeSelector(typeof(Telerik.Reporting.TextItemBase)),
            new Telerik.Reporting.Drawing.TypeSelector(typeof(Telerik.Reporting.HtmlTextBox))});
            styleRule1.Style.Padding.Left = Telerik.Reporting.Drawing.Unit.Point(2D);
            styleRule1.Style.Padding.Right = Telerik.Reporting.Drawing.Unit.Point(2D);
            this.StyleSheet.AddRange(new Telerik.Reporting.Drawing.StyleRule[] {
            styleRule1});
            this.Width = Telerik.Reporting.Drawing.Unit.Inch(6D);
            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();

        }
        #endregion

        private Telerik.Reporting.PageHeaderSection pageHeaderSection1;
        private Telerik.Reporting.DetailSection detail;
        private Telerik.Reporting.PageFooterSection pageFooterSection1;
        private Telerik.Reporting.TextBox textBox1;
        private Telerik.Reporting.PictureBox pictureBox1;
        private Telerik.Reporting.TextBox textBox4;
        private Telerik.Reporting.TextBox textBox2;
        private Telerik.Reporting.TextBox textBox3;
        private Telerik.Reporting.SqlDataSource yeardatasource;
        private Telerik.Reporting.Crosstab crosstab1;
        private Telerik.Reporting.TextBox textBox6;
        private Telerik.Reporting.TextBox textBox7;
        private Telerik.Reporting.TextBox textBox5;
        private Telerik.Reporting.SqlDataSource SalesPersonDatasource;
        private Telerik.Reporting.TextBox textBox8;
        private Telerik.Reporting.TextBox textBox10;
        private Telerik.Reporting.TextBox textBox9;
    }
}

Please the attached code for the userdefined function Qtr(Quarter).
namespace ReportsLibrary
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using Telerik.Reporting;
    using Telerik.Reporting.Drawing;

    /// <summary>
    /// Summary description for DashboardReport.
    /// </summary>
    public partial class DashboardReport : Telerik.Reporting.Report
    {
        public DashboardReport()
        {
            //
            // Required for telerik Reporting designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
        public static int Qtr(DateTime date)
        {
            return (1 + ((date.Month - 1) / 3));
        }
    } 
}

Thanks in advance.

Rgds,
Nirmal
Peter
Telerik team
 answered on 29 Apr 2013
4 answers
1.0K+ views
Hi there,

I've created  a set of reports, most of which have a chart and a grid.
The reports pull data from a SQL data source, and pass in a StartDate and EndDate parameter.
I've set these up as Report Parameters, and these are visible when viewing the report as users will need to change date ranges.

The report parameters have a default value, i.e. I set the value in design time using a function. This sets StartDate to first day of the current month, and EndDate to last day of the current month.

However, when changing the values of these parameters on the report viewer, it seems to always use the design time set values, the value the user enters is never used.

Why is this? Should I be setting the default value in another manner?
I've tried setting 'Value' in the ReportParameter Collection Editor from design mode in VS2012, and I've tried setting it in the constructor of the report after InitializeComponent.
Stephen
Top achievements
Rank 1
 answered on 29 Apr 2013
12 answers
334 views
Hello,
the enclosed code was working with the 2011 Q3 version of Telerik Reporting but not with the 2012 Q1 version.
The idea is to define a class that inherits from Telerik.Reporting.Report and to base the reports on this class instead of the Telerik one. The goal is to put in this class code that is common to more than one report to avoid duplicating code.
So I define a class like this:
using System;
using Telerik.Reporting;
 
namespace TestInheritedReport
{
  public class MyReport : Telerik.Reporting.Report
  {
  }
}
And now my report inherits from MyReport instead of Telerik.Reporting.Report.
The problem is now that every time I change something in the designer and click on the preview tab, I have an error message that says:
The service Telerik.Reporting.Design.Interfaces.IRootDesignerPresenter already
exists in the service container. Parameter name: serviceType


And the call stack is:
at System.ComponentModel.Design.ServiceContainer.AddService(Type serviceType,
ServiceCreatorCallback callback, Boolean promote)
at
System.ComponentModel.Design.ServiceContainer.AddService(Type serviceType,
ServiceCreatorCallback callback)
at
Telerik.Reporting.Design.VisualStudio.DependencyLoader.Initialize(IDesignerHost
host)
at Telerik.Reporting.Design.ReportRootDesigner.LoadDependencies()
at
Telerik.Reporting.Design.ReportRootDesigner.Initialize(IComponent
component)
at
System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent
component, String name, IContainer containerToAddTo)
at
System.ComponentModel.Design.DesignerHost.PerformAdd(IComponent component,
String name)
at
System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type
componentType, String name)
at
System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type
type, ICollection arguments, String name, Boolean addToContainer)
at
System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type
type, ICollection arguments, String name, Boolean addToContainer)
at
System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager
manager, CodeTypeDeclaration declaration)
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
manager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
serializationManager)
at
System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost
host)


In C#, I had to close the designer and open it again to make it work. In Oxygene (Delphi Prism), I had to close Visual Studio and open it again to make the designer work again; otherwise, it displays a black page with just a rectangle!
It's really a waste of time to work this way

Patrick
IvanY
Telerik team
 answered on 26 Apr 2013
2 answers
1.0K+ views
I have a report designed while using the Demo version of the reporting software.  Upon purchasing/upgrading to the latest Telerik reporting, the report is no longer viewable in the VB.NET design mode.
The screen is filled with over 200 errors like: 'Object of type 'Telerik.Reporting.Drawing.Unit' cannot be converted to type 'Telerik.Reporting.Drawing.Unit'. '  All errors are linked to the designer code.  The program functions correctly, when running, and the 'errors' all show as only warnings when building the solution. The reference in the project is Telerik.Reporting v3.2.9.1211.

The errors all point to a line like the following:
Me.pnlShortTerm.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(7.9998421669006348, Telerik.Reporting.Drawing.UnitType.Inch), New Telerik.Reporting.Drawing.Unit(1.3999999761581421, Telerik.Reporting.Drawing.UnitType.Inch)) 


Is there any way to salvage the report, so that I can modify it using the designer?
Ramazan
Top achievements
Rank 1
 answered on 26 Apr 2013
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?