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