Telerik Forums
Reporting Forum
1 answer
131 views
I'm trying to build a report programmatically due to the complexity and dynamic nature of the requirement I am faced with.
The best way I can think is to have one 'shell' report that composes many different child reports.

However when I just try to do a light version of the above with a simple (not data-bound) child report that just prints 'hello world!' I get nothing rendered out. When I run the Child report on it's own I receive the expected results.

Below is my code for the shell report

private Telerik.Reporting.Report Build()
{
    Telerik.Reporting.Report mainReport = new Telerik.Reporting.Report();
    Telerik.Reporting.DetailSection detail = new Telerik.Reporting.DetailSection();
 
    mainReport.Items.Add(detail);
 
    Unit unitX = Unit.Inch(0.1);
    Unit unitY = Unit.Inch(0.1);
    SizeU size = new SizeU(Unit.Inch(1), Unit.Inch(0.5));
 
    List<Telerik.Reporting.Report> childrenReports = new List<Telerik.Reporting.Report>();
 
    ExecutiveSummarySection executiveSummary = new ExecutiveSummarySection();
    childrenReports.Add(executiveSummary);
     
    foreach (Telerik.Reporting.Report child in childrenReports)
    {
        Telerik.Reporting.SubReport sub = new Telerik.Reporting.SubReport
        {
            Location = new PointU(unitX, unitY),
            Size = size
        };
        unitY = unitY.Add(Unit.Inch(1));
        Telerik.Reporting.InstanceReportSource childInstanceReportSource = new InstanceReportSource();
        childInstanceReportSource.ReportDocument = child;
        sub.ReportSource = childInstanceReportSource;
        detail.Items.Add(sub);
    }
    detail.Height = Unit.Inch(childrenReports.Count + 2D);
    return mainReport;
    //return executiveSummary;
}


and the 'ExecutiveSumarySection' report:

using AGP.Data.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Telerik.Reporting;
using Telerik.Reporting.Drawing;
 
namespace AGP.Reports
{
    public class ExecutiveSummarySection : Report
    {
 
        public ExecutiveSummarySection()
        {
            InitializeComponent();
            //DataBindControls();
        }
 
        private void DataBindControls()
        {
             //going to data bind later to EF5 backed repository
            //ModelContextUnitOfWork uow = new ModelContextUnitOfWork();
            //DocumentEFRepository docRepo = new DocumentEFRepository(uow);
 
            //this.DataSource = docRepo.All.ToList();
        }
 
        #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()
        {
            Telerik.Reporting.Drawing.StyleRule styleRule1 = new Telerik.Reporting.Drawing.StyleRule();
            this.pageHeaderSection1 = new Telerik.Reporting.PageHeaderSection();
            this.detail = new Telerik.Reporting.DetailSection();
            this.pageFooterSection1 = new Telerik.Reporting.PageFooterSection();
            this.panel1 = new Telerik.Reporting.Panel();
            this.textBox1 = new Telerik.Reporting.TextBox();
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
            //
            // pageHeaderSection1
            //
            this.pageHeaderSection1.Height = Telerik.Reporting.Drawing.Unit.Inch(2D);
            this.pageHeaderSection1.Name = "pageHeaderSection1";
            //
            // detail
            //
            this.detail.Height = Telerik.Reporting.Drawing.Unit.Inch(2.1000001430511475D);
            this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.textBox1});
            this.detail.Name = "detail";
            //
            // pageFooterSection1
            //
            this.pageFooterSection1.Height = Telerik.Reporting.Drawing.Unit.Inch(2D);
            this.pageFooterSection1.Name = "pageFooterSection1";
            //
            // panel1
            //
            this.panel1.Name = "panel1";
            this.panel1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(2D), Telerik.Reporting.Drawing.Unit.Inch(1D));
            //
            // textBox1
            //
            this.textBox1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(0D), Telerik.Reporting.Drawing.Unit.Inch(0D));
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1.2000001668930054D), Telerik.Reporting.Drawing.Unit.Inch(0.40000024437904358D));
            this.textBox1.Value = "Hello World!";
            //
            // ExecutiveSummarySection
            //
            this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.pageHeaderSection1,
            this.detail,
            this.pageFooterSection1});
            this.Name = "Report1";
            this.PageSettings.Margins = new Telerik.Reporting.Drawing.MarginsU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(1D));
            this.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Letter;
            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 Panel panel1;
        private TextBox textBox1;
        private Telerik.Reporting.PageFooterSection pageFooterSection1;
    }
}


Not totally sure what I'm doing wrong here but I was following many similar examples provided in the forums by Telerik Reporting team on doing this type of report.
Peter
Telerik team
 answered on 02 Sep 2013
1 answer
203 views
Hi,

I'm trying to create a report, with an ObjectDataSource that has a couple Nullable<Datetime> fields. I'm attempting to use these in a textbox.
Here's an example of the sort of expression I'm using:

This report covers the period from {IIf(Fields.ReportConfiguration.StartDate is null, "the beginning of time", Fields.ReportConfiguration.StartDate.Date.ToString("D"))} to {IIf(Fields.ReportConfiguration.EndDate is null, "the end of time", Fields.ReportConfiguration.EndDate.Date.ToString("D"))}.

Both StartDate and EndDate are of type Nullable<DateTime>. If they have both have a value then it works correctly, but if either of them are null then I get an "Object reference not set to an instance of an object" error. Should this work, and if not, how do I do it?

I'm using 2013 Q2 SP1.

Thanks,

Richard
Squall
Top achievements
Rank 1
 answered on 02 Sep 2013
1 answer
108 views
Hello,
I am using Reporting Q2 2011 and working with the Invoice example. The PageExec values work correctly and are visible when viewed in Preview but are not visible when viewed in HTML Preview. I am using IE 9.

Thanks,
Peter
Telerik team
 answered on 02 Sep 2013
1 answer
342 views
I'm attempting to set up my report like the following:

Parent Group
Child Group 1
Items
Child Group 2 Items Child Group 3 So basically I want parent group to have multiple children without nesting them, so how can I setup a group with multiple parallel children without using "Subreport"? Are there any easy ways to achieve that in the designer?
Squall
Top achievements
Rank 1
 answered on 30 Aug 2013
5 answers
297 views

"Microsoft JScript runtime error: Object expected":  Here's the first line that is causing the error:

ToolbarImageButton(

'ReportViewer1_ReportToolbar_NavGr_FirstPage_Button','FirstPage',false,'NormalButton','DisabledButton','PushButton',false);

 

 I'm using 2009 Q1.  This is a .net 3.5 web application.  I tried reinstalling Telerik Reporting and I still get the error.  Any ideas?

Stef
Telerik team
 answered on 30 Aug 2013
3 answers
65 views
Hi,

I implemented a simple sample in which I'd like to meet better the report's features. So, in theh sample I noticed the report is very slow when it goes to render on the MVC page.

I was able to see that It the problem is my query brings a lot of records, then I was imagining that report would do the paging correctly. However It is not working.

Furthermore, when I click the next page button, I have a impression the report is doing the same query: returning all the records  and then it applies the paging.

I think it would be better if the paging occured during the query not after the query results.

There is a manner to intervene the paging, such as some property, method or event that I implement the paging or change the query?

Thank you very much for all the attention.

Carlos
IvanY
Telerik team
 answered on 30 Aug 2013
1 answer
665 views
Hello everyone,
I'm sure this is an issue with my IIS 8.0 configuration but I haven't been able to work around it.  I can run my web app and generate reports from Visual Studio with no problems but I'm having problems with the reporting component (version 7.1.13.802) 
under IIS 8.0.   I started with a clean install of IIS and I am using the Default App Pool (.Net V4.0 Integrated) using the ApplicationPoolIdentity.   I have added permissions to my apps bin folder where the Telerik.ReportViewer.WebForms.dll are located and my web app functions except for displaying reports.   I get the following error:

The http handler needed by the Report Viewer has not been registered in the application's web.config file.  Add <add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*" type ="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=7.1.13.802, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" preCondition="integratedMode"/> to the system.webServer/handlers section of the configuration file.


Of course, this handler is already set up in my web.config file.   I believe this is a permission issue since I can change the Default App Pool to run under my user id and it does function correctly.    I am running IIS on my machine so I can make any adjustments that I need; however, I'd like to run this using the ApplicationPoolIdentity user because that is what I will likely have to use when it goes into production.  I know that this should work under Medium Trust (allthough Full Trust would be better).  I've tried to configure that but I'm not sure if I have been successful or not.  My root web.config file contains the following:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.web>
      <securityPolicy>
        <trustLevel name="Full" policyFile="internal"/>
        <trustLevel name="High" policyFile="web_hightrust.config"/>
        <trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
        <trustLevel name="Low" policyFile="web_lowtrust.config"/>
        <trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
      </securityPolicy>
      <trust level="Full" originUrl=""/>
    </system.web>
</configuration>

Any suggestions as to what I'm missing in my configuration ?   

Thanks in advance -- Jeff Gaiche
Stef
Telerik team
 answered on 30 Aug 2013
3 answers
292 views
Hi,

We are working on a project which provide user defined reports using data in database. Currently we are using other vendor controller that support upload user defined template to our system and it applies styles, headers, static images and footer section to dynamically generate sections. We want to move our project to telerik reports. But I couldn't find this feature on your products. I found some forums that saying this feature will be provided in future versions but unable to find it. We are not expecting report designers. We can achieve what ever we want using code behind. What we want is apply user template to reports.

Appreciate if telerik team has solution for this.

Regards
Chap
 
Peter
Telerik team
 answered on 29 Aug 2013
1 answer
260 views
I was having trouble with the telerik Report Viewer not displaying the report that it was set to, no code behind and everything declared in the control. So I removed the control and all the settings and placed another telerik Report Viewer on a new page in the same project and had the same problem. While researching the problem, I found my computer worked with the telerik demos and I created a new project and tested the telerik Report Viewer on a new page in a bare project and it displayed as expected showing the message: The source of the report definition has not been specified.

So the problem was definitely with my project. After some more research in the telerik forums I found that another control had a problem because of the custom headers. In that thread they had mentioned if you set X-Frame-Options in your web.config to "DENY" it will cause problems with the control due to the control using an IFRAME and that using "SAMEORIGIN" should work. For me the entry in web.config looked like this:
<system.webServer>
  <httpProtocol>
    <customHeaders>
      <add name="X-Frame-Options" value="SAMEORIGIN"/>
    </customHeaders>
  </httpProtocol>
</system.webServer>

Hopefully this information helps anybody else maybe having similar problems.

Other thread that helped me resolve the issue.
http://www.telerik.com/community/forums/aspnet-mvc/upload/uploader-does-not-under-ie-when-x-frame-options-deny-header-is-set.aspx


kenneyy kenn
Top achievements
Rank 1
 answered on 28 Aug 2013
3 answers
155 views
I have this section of my report both in design mode (design_mode.jpg) and in running mode (running_mode.jpg)
as you can see in running mode, there are things that make this report NOT look professional:

- While line under "Max Presence Clr"
- The gray horizontal lines dividing the data fields on the right hand side, sometimes is thin and sometimes is wide

is there any systematic way to avoid this rendering "errors" ?

regards,
Peter
Telerik team
 answered on 28 Aug 2013
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?