or
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;
}
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;
}
}
"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?