Telerik Forums
Reporting Forum
3 answers
133 views
I have a report generated through the report wizard. I have set up three parameters, Service, Mod. Number and Status.

I have the filters working properly, but I would like for the user to have the selection to see Open, Closed or All in the status field.

The user can now select Open or Closed. If I set the MuliValue to true on the third parameter (status) and allow the user to "Select All", I get the following error on all selections:

An error has occured while processing Report: Cannot perform '=' operation on System.String and System.Collections.ArrayList.

Any help on this would be greatly appreciated.
Massimiliano Bassili
Top achievements
Rank 1
 answered on 16 Feb 2010
0 answers
223 views
Hi,
    I am generating cross-tab report for whole month. so based on status, i want to show colors. e.g. for 0-Green, 1-Red, 2-LightGreen, 3-Orange, 4-LightYellow, 5-LightPink. when i have given condition formating to first column, it wrote this many lines of code in to the designer. but i want to do it for 31 columns. what is the alternative for this? Also there is limitation of code is, my field will be changed at runtime. it is not fixed that, for txtD1, always field is Fields.D01.

please let me know. following is the code sample.

formattingRule1.Filters.AddRange(new Telerik.Reporting.Data.Filter[] {
            new Telerik.Reporting.Data.Filter("=Fields.D01", Telerik.Reporting.Data.FilterOperator.Equal, "3")});
            formattingRule1.Style.BackgroundColor = System.Drawing.Color.Orange;
            formattingRule1.Style.Color = System.Drawing.Color.Transparent;
            formattingRule2.Filters.AddRange(new Telerik.Reporting.Data.Filter[] {
            new Telerik.Reporting.Data.Filter("=Fields.D01", Telerik.Reporting.Data.FilterOperator.Equal, "1")});
            formattingRule2.Style.BackgroundColor = System.Drawing.Color.Red;
            formattingRule2.Style.Color = System.Drawing.Color.Transparent;
            formattingRule3.Filters.AddRange(new Telerik.Reporting.Data.Filter[] {
            new Telerik.Reporting.Data.Filter("=Fields.D01", Telerik.Reporting.Data.FilterOperator.Equal, "0")});
            formattingRule3.Style.BackgroundColor = System.Drawing.Color.Green;
            formattingRule3.Style.Color = System.Drawing.Color.Transparent;
            formattingRule4.Filters.AddRange(new Telerik.Reporting.Data.Filter[] {
            new Telerik.Reporting.Data.Filter("=Fields.D01", Telerik.Reporting.Data.FilterOperator.Equal, "2")});
            formattingRule4.Style.BackgroundColor = System.Drawing.Color.LightGreen;
            formattingRule4.Style.Color = System.Drawing.Color.Transparent;
            formattingRule5.Filters.AddRange(new Telerik.Reporting.Data.Filter[] {
            new Telerik.Reporting.Data.Filter("=Fields.D01", Telerik.Reporting.Data.FilterOperator.Equal, "5")});
            formattingRule5.Style.BackgroundColor = System.Drawing.Color.LightPink;
            formattingRule5.Style.Color = System.Drawing.Color.Transparent;
            formattingRule6.Filters.AddRange(new Telerik.Reporting.Data.Filter[] {
            new Telerik.Reporting.Data.Filter("=Fields.D01", Telerik.Reporting.Data.FilterOperator.Equal, "4")});
            formattingRule6.Style.BackgroundColor = System.Drawing.Color.LightYellow;
            formattingRule6.Style.Color = System.Drawing.Color.Transparent;
            this.txtD1.ConditionalFormatting.AddRange(new Telerik.Reporting.Drawing.FormattingRule[] {
            formattingRule1,
            formattingRule2,
            formattingRule3,
            formattingRule4,
            formattingRule5,
            formattingRule6});

-Thanks
Rajendra S(rajendra.soni@e-zest.in)
Allan Hill
Top achievements
Rank 1
 asked on 16 Feb 2010
3 answers
167 views
I'm dynamically building a report from a set of parameters in an xml file.  I have categories defined in one drop down list and the list of reports in a second drop down list.  Changes to ListBox1 should only update the values in ListBox2 and changes to ListBox2 should only add textbox controls to Panel1.  However, when I change the values in either box the ReportViewer refreshes the current report.  Even if I change the value in ListBox2 I have to wait for the old report to refresh before I can hit the run button for the second report.

Any ideas?

Thanks,

Paul

<

 

telerik:RadScriptManager ID="RadScriptManager1" Runat="server" LoadScriptsBeforeUI="true"></telerik:RadScriptManager>

 

 

 

<

 

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

 

<AjaxSettings>

 

 

 

<telerik:AjaxSetting AjaxControlID="DropDownList1">
<UpdatedControls>

 

<telerik:AjaxUpdatedControl ControlID="DropDownList2" />

 

</UpdatedControls>

 

</telerik:AjaxSetting>

 

<telerik:AjaxSetting AjaxControlID="DropDownList2">

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="Panel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

</AjaxSettings>

 </

 

telerik:RadAjaxManager>

 

 <

 

asp:XmlDataSource ID="dsCategory" runat="server" DataFile="~/TelerikReportsConfig.xml" XPath="ReportCategories/ReportCategory"></asp:XmlDataSource>

 

 

<

 

asp:Label ID="lblCategory" runat="server" Text="Category" Width="96px"></asp:Label>

 

 

<

 

asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="dsCategory" DataTextField="Name" DataValueField="ID" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"></asp:DropDownList>

 

 

<br />

 

 

<

 

asp:XmlDataSource ID="dsReports" runat="server" DataFile="~/TelerikReportsConfig.xml" XPath="ReportCategories/ReportCategory/Report"></asp:XmlDataSource>

 

 

<

 

asp:Label ID="lblReports" runat="server" Text="Report" Width="96px"></asp:Label>

 

 

<

 

asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="dsReports" DataTextField="Name" DataValueField="Report" AutoPostBack="True" OnSelectedIndexChanged="DropDownList2_SelectedIndexChanged"></asp:DropDownList>

 

 

 <br />

 

<br />

 

<

 

asp:Panel ID="Panel1" runat="server"></asp:Panel>

 

<br />

 

<br />

 

 

<

 

asp:Button ID="btnRun" runat="server" onclick="btnRun_Click" Text="Run Report" />

 

 

<

 

telerik:ReportViewer ID="ReportViewer1" runat="server" Visible="True" Width="100%" ></telerik:ReportViewer>

 

 

 

 

Iana Tsolova
Telerik team
 answered on 16 Feb 2010
1 answer
126 views
Hello,

Im using the reporting tool for making some industial graphs.

The graph that im looking for is something like Speed vs Time graph. Im not able to do the same with the reports. Can anyone help me in detail about wht needs to be done or point me to a detailed tutorial.

Thx a lot.
Steve
Telerik team
 answered on 15 Feb 2010
1 answer
70 views
Al salamo 3lycom

I want to use reports in silverlight so I need  Telerik.Reporting.Service.dll 
and I didint fint it .

any help please ?

Steve
Telerik team
 answered on 15 Feb 2010
7 answers
469 views
Hi

What is the best way to view Telerik reports inside a silverlight application, also i wish to pass parameters for the report from the silverlight gui ( dates etc. )

Regards,

Vassil Petev
Telerik team
 answered on 15 Feb 2010
1 answer
69 views
Hello, this going to be a very specific scenario that I can't find any documentation on.

Scenario:
Basically, I have all of the reports that we usually run in the ReportViewer saved in the database with the conditional formatting rules and columns saved there as well.  Currently, there has been a pull to begin emailing certain reports to users in excel format, with the same conditional formatting rules as the ReportViewer.

Question:
Is there a way to run a report using the telerik reporting and set up the same conditional formatting without actually visualizing it in a ReportViewer?  Once this is done saving the file to excel on the server.

Thank you for your time and help in advance.

If I need to specify anymore information on this topic please ask.

Chris McMahan
Steve
Telerik team
 answered on 15 Feb 2010
2 answers
322 views
I created a Subreport that builds a chart that accepts a parameter  ( TerritoryId ),
when I run that report by itself it works fine. (see subreport.png )

When I create a Master report and pass in the parameter, the parameter seems to pass in ok. But the chart,
says Specified cast is not valid. (see master.png)
You can see from the msater.png that the parameter is being passed to the text box on the subreport, but not the chart.



The code for the  chart NeedDataSource on the subreport:
        private void chart1_NeedDataSource(object sender, EventArgs e) 
        { 
            Int64 territoryId = (Int64)this.ReportParameters["TerritoryId"].Value; 
 
            AdventureWorksDataSetTableAdapters.SalesByTerritoryTableAdapter adapter = new AdventureWorksDataSetTableAdapters.SalesByTerritoryTableAdapter(); 
            AdventureWorksDataSet.SalesByTerritoryDataTable data = adapter.GetData((Int32)territoryId); 
            Telerik.Reporting.Processing.Chart myChart = (Telerik.Reporting.Processing.Chart)sender; 
            myChart.DataSource = data.DefaultView; 
            chart1.PlotArea.XAxis.DataLabelsColumn = "OrderDate";             
            chart1.Series[0].DataYColumn = "AvgSales"
            chart1.Series[0].Type = Telerik.Reporting.Charting.ChartSeriesType.Bar; 
            chart1.Series[0].Name = "AvgSales for " + territoryId.ToString(); 
            chart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 90; 
 
        } 

The attached images are the subreport by itself, and the subreport inside a master report, passing in the parameter.

This just uses the AdventuresWork DB
The following  is the StoredProc used for the dataset.
create proc dbo.SalesByTerritory  
    @TerritoryId int = null 
as 
 
select top 10 T.TerritoryID, T.Nameconvert(varchar(5),S.OrderDate,101) as OrderDate, avg(S.SubTotal) as AvgSales 
from Sales.SalesTerritory T 
INNER JOIN Sales.SalesOrderHeader  S ON T.TerritoryID = S.TerritoryID 
WHERE (T.TerritoryID = @TerritoryID or @TerritoryId is null
group by T.TerritoryID, T.Name, S.OrderDate 
order by S.OrderDate, T.Name 


Here's how the designer code for the Master:
namespace sample 
    using System.ComponentModel; 
    using System.Drawing; 
    using System.Windows.Forms; 
    using Telerik.Reporting; 
    using Telerik.Reporting.Drawing; 
 
    partial class Master 
    { 
        #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(); 
            Telerik.Reporting.Drawing.StyleRule styleRule2 = new Telerik.Reporting.Drawing.StyleRule(); 
            Telerik.Reporting.Drawing.StyleRule styleRule3 = new Telerik.Reporting.Drawing.StyleRule(); 
            Telerik.Reporting.Drawing.StyleRule styleRule4 = new Telerik.Reporting.Drawing.StyleRule(); 
            this.labelsGroupHeader = new Telerik.Reporting.GroupHeaderSection(); 
            this.territoryIDCaptionTextBox = new Telerik.Reporting.TextBox(); 
            this.nameCaptionTextBox = new Telerik.Reporting.TextBox(); 
            this.labelsGroupFooter = new Telerik.Reporting.GroupFooterSection(); 
            this.labelsGroup = new Telerik.Reporting.Group(); 
            this.pageHeader = new Telerik.Reporting.PageHeaderSection(); 
            this.reportNameTextBox = new Telerik.Reporting.TextBox(); 
            this.pageFooter = new Telerik.Reporting.PageFooterSection(); 
            this.currentTimeTextBox = new Telerik.Reporting.TextBox(); 
            this.pageInfoTextBox = new Telerik.Reporting.TextBox(); 
            this.reportHeader = new Telerik.Reporting.ReportHeaderSection(); 
            this.titleTextBox = new Telerik.Reporting.TextBox(); 
            this.detail = new Telerik.Reporting.DetailSection(); 
            this.territoryIDDataTextBox = new Telerik.Reporting.TextBox(); 
            this.nameDataTextBox = new Telerik.Reporting.TextBox(); 
            this.territoryDataSet = new sample.TerritoryDataSet(); 
            this.territoryDataSetTableAdapter1 = new sample.TerritoryDataSetTableAdapters.TerritoryDataSetTableAdapter(); 
            this.subReport1 = new Telerik.Reporting.SubReport(); 
            this.subReport2 = new sample.SubReport(); 
            ((System.ComponentModel.ISupportInitialize)(this.territoryDataSet)).BeginInit(); 
            ((System.ComponentModel.ISupportInitialize)(this.subReport2)).BeginInit(); 
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); 
            //  
            // labelsGroupHeader 
            //  
            this.labelsGroupHeader.Height = new Telerik.Reporting.Drawing.Unit(0.28125, Telerik.Reporting.Drawing.UnitType.Inch); 
            this.labelsGroupHeader.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { 
            this.territoryIDCaptionTextBox, 
            this.nameCaptionTextBox}); 
            this.labelsGroupHeader.Name = "labelsGroupHeader"
            this.labelsGroupHeader.PrintOnEveryPage = true
            //  
            // territoryIDCaptionTextBox 
            //  
            this.territoryIDCaptionTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.territoryIDCaptionTextBox.Name = "territoryIDCaptionTextBox"
            this.territoryIDCaptionTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(3.1979167461395264, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.territoryIDCaptionTextBox.StyleName = "Caption"
            this.territoryIDCaptionTextBox.Value = "TerritoryID"
            //  
            // nameCaptionTextBox 
            //  
            this.nameCaptionTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(3.2395832538604736, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.nameCaptionTextBox.Name = "nameCaptionTextBox"
            this.nameCaptionTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(3.1979167461395264, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.nameCaptionTextBox.StyleName = "Caption"
            this.nameCaptionTextBox.Value = "Name"
            //  
            // labelsGroupFooter 
            //  
            this.labelsGroupFooter.Height = new Telerik.Reporting.Drawing.Unit(0.28125, Telerik.Reporting.Drawing.UnitType.Inch); 
            this.labelsGroupFooter.Name = "labelsGroupFooter"
            this.labelsGroupFooter.Style.Visible = false
            //  
            // labelsGroup 
            //  
            this.labelsGroup.Bookmark = null
            this.labelsGroup.GroupFooter = this.labelsGroupFooter; 
            this.labelsGroup.GroupHeader = this.labelsGroupHeader; 
            //  
            // pageHeader 
            //  
            this.pageHeader.Height = new Telerik.Reporting.Drawing.Unit(0.28125, Telerik.Reporting.Drawing.UnitType.Inch); 
            this.pageHeader.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { 
            this.reportNameTextBox}); 
            this.pageHeader.Name = "pageHeader"
            //  
            // reportNameTextBox 
            //  
            this.reportNameTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.reportNameTextBox.Name = "reportNameTextBox"
            this.reportNameTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(6.4166665077209473, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.reportNameTextBox.StyleName = "PageInfo"
            this.reportNameTextBox.Value = "Master"
            //  
            // pageFooter 
            //  
            this.pageFooter.Height = new Telerik.Reporting.Drawing.Unit(0.28125, Telerik.Reporting.Drawing.UnitType.Inch); 
            this.pageFooter.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { 
            this.currentTimeTextBox, 
            this.pageInfoTextBox}); 
            this.pageFooter.Name = "pageFooter"
            //  
            // currentTimeTextBox 
            //  
            this.currentTimeTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.currentTimeTextBox.Name = "currentTimeTextBox"
            this.currentTimeTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(3.1979167461395264, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.currentTimeTextBox.StyleName = "PageInfo"
            this.currentTimeTextBox.Value = "=NOW()"
            //  
            // pageInfoTextBox 
            //  
            this.pageInfoTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(3.2395832538604736, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.pageInfoTextBox.Name = "pageInfoTextBox"
            this.pageInfoTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(3.1979167461395264, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.pageInfoTextBox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right; 
            this.pageInfoTextBox.StyleName = "PageInfo"
            this.pageInfoTextBox.Value = "=PageNumber"
            //  
            // reportHeader 
            //  
            this.reportHeader.Height = new Telerik.Reporting.Drawing.Unit(0.80823493003845215, Telerik.Reporting.Drawing.UnitType.Inch); 
            this.reportHeader.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { 
            this.titleTextBox}); 
            this.reportHeader.Name = "reportHeader"
            //  
            // titleTextBox 
            //  
            this.titleTextBox.Name = "titleTextBox"
            this.titleTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(6.4583334922790527, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.78740161657333374, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.titleTextBox.StyleName = "Title"
            this.titleTextBox.Value = "Master"
            //  
            // detail 
            //  
            this.detail.Height = new Telerik.Reporting.Drawing.Unit(2.2292652130126953, Telerik.Reporting.Drawing.UnitType.Inch); 
            this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { 
            this.territoryIDDataTextBox, 
            this.nameDataTextBox, 
            this.subReport1}); 
            this.detail.Name = "detail"
            //  
            // territoryIDDataTextBox 
            //  
            this.territoryIDDataTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.territoryIDDataTextBox.Name = "territoryIDDataTextBox"
            this.territoryIDDataTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(3.1979167461395264, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.territoryIDDataTextBox.StyleName = "Data"
            this.territoryIDDataTextBox.Value = "=Fields.TerritoryID"
            //  
            // nameDataTextBox 
            //  
            this.nameDataTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(3.2395832538604736, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.nameDataTextBox.Name = "nameDataTextBox"
            this.nameDataTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(3.1979167461395264, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.nameDataTextBox.StyleName = "Data"
            this.nameDataTextBox.Value = "=Fields.Name"
            //  
            // territoryDataSet 
            //  
            this.territoryDataSet.DataSetName = "TerritoryDataSet"
            this.territoryDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; 
            //  
            // territoryDataSetTableAdapter1 
            //  
            this.territoryDataSetTableAdapter1.ClearBeforeFill = true
            //  
            // subReport1 
            //  
            this.subReport1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.099999986588954926, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.32926526665687561, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.subReport1.Name = "subReport1"
            this.subReport1.Parameters.Add(new Telerik.Reporting.Parameter("TerritoryId""=Fields.TerritoryID")); 
            this.subReport1.ReportSource = this.subReport2; 
            this.subReport1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(5.7000007629394531, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(1.7000001668930054, Telerik.Reporting.Drawing.UnitType.Inch)); 
            this.subReport1.NeedDataSource += new System.EventHandler(this.subReport1_NeedDataSource); 
            //  
            // Master 
            //  
            this.DataSource = this.territoryDataSet; 
            this.Groups.AddRange(new Telerik.Reporting.Group[] { 
            this.labelsGroup}); 
            this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { 
            this.labelsGroupHeader, 
            this.labelsGroupFooter, 
            this.pageHeader, 
            this.pageFooter, 
            this.reportHeader, 
            this.detail}); 
            this.PageSettings.Landscape = false
            this.PageSettings.Margins.Bottom = new Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch); 
            this.PageSettings.Margins.Left = new Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch); 
            this.PageSettings.Margins.Right = new Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch); 
            this.PageSettings.Margins.Top = new Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch); 
            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.StyleSelector("Title")}); 
            styleRule1.Style.Color = System.Drawing.Color.Black; 
            styleRule1.Style.Font.Bold = true
            styleRule1.Style.Font.Italic = false
            styleRule1.Style.Font.Name = "Tahoma"
            styleRule1.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(20, Telerik.Reporting.Drawing.UnitType.Point); 
            styleRule1.Style.Font.Strikeout = false
            styleRule1.Style.Font.Underline = false
            styleRule2.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] { 
            new Telerik.Reporting.Drawing.StyleSelector("Caption")}); 
            styleRule2.Style.Color = System.Drawing.Color.Black; 
            styleRule2.Style.Font.Name = "Tahoma"
            styleRule2.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(11, Telerik.Reporting.Drawing.UnitType.Point); 
            styleRule2.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; 
            styleRule3.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] { 
            new Telerik.Reporting.Drawing.StyleSelector("Data")}); 
            styleRule3.Style.Font.Name = "Tahoma"
            styleRule3.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(11, Telerik.Reporting.Drawing.UnitType.Point); 
            styleRule3.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; 
            styleRule4.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] { 
            new Telerik.Reporting.Drawing.StyleSelector("PageInfo")}); 
            styleRule4.Style.Font.Name = "Tahoma"
            styleRule4.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(11, Telerik.Reporting.Drawing.UnitType.Point); 
            styleRule4.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; 
            this.StyleSheet.AddRange(new Telerik.Reporting.Drawing.StyleRule[] { 
            styleRule1, 
            styleRule2, 
            styleRule3, 
            styleRule4}); 
            this.Width = new Telerik.Reporting.Drawing.Unit(6.4583334922790527, Telerik.Reporting.Drawing.UnitType.Inch); 
            ((System.ComponentModel.ISupportInitialize)(this.territoryDataSet)).EndInit(); 
            ((System.ComponentModel.ISupportInitialize)(this.subReport2)).EndInit(); 
            ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); 
 
        } 
        #endregion 
 
        private GroupHeaderSection labelsGroupHeader; 
        private Telerik.Reporting.TextBox territoryIDCaptionTextBox; 
        private Telerik.Reporting.TextBox nameCaptionTextBox; 
        private GroupFooterSection labelsGroupFooter; 
        private Group labelsGroup; 
        private PageHeaderSection pageHeader; 
        private Telerik.Reporting.TextBox reportNameTextBox; 
        private PageFooterSection pageFooter; 
        private Telerik.Reporting.TextBox currentTimeTextBox; 
        private Telerik.Reporting.TextBox pageInfoTextBox; 
        private ReportHeaderSection reportHeader; 
        private Telerik.Reporting.TextBox titleTextBox; 
        private DetailSection detail; 
        private Telerik.Reporting.TextBox territoryIDDataTextBox; 
        private Telerik.Reporting.TextBox nameDataTextBox; 
        private TerritoryDataSet territoryDataSet; 
        private sample.TerritoryDataSetTableAdapters.TerritoryDataSetTableAdapter territoryDataSetTableAdapter1; 
        private Telerik.Reporting.SubReport subReport1; 
        private SubReport subReport2; 
 
    } 

And the desinger code for the SubReport:
namespace sample 
    using System.ComponentModel; 
    using System.Drawing; 
    using System.Windows.Forms; 
    using Telerik.Reporting; 
    using Telerik.Reporting.Drawing; 
 
    partial class SubReport 
    { 
        #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.Charting.ChartSeries chartSeries1 = new Telerik.Reporting.Charting.ChartSeries(); 
          Telerik.Reporting.ReportParameter reportParameter1 = new Telerik.Reporting.ReportParameter(); 
          this.detail = new Telerik.Reporting.DetailSection(); 
          this.textBox1 = new Telerik.Reporting.TextBox(); 
          this.chart1 = new Telerik.Reporting.Chart(); 
          this.textBox2 = new Telerik.Reporting.TextBox(); 
          ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); 
          //  
          // detail 
          //  
          this.detail.Height = new Telerik.Reporting.Drawing.Unit(4.2000002861022949, Telerik.Reporting.Drawing.UnitType.Inch); 
          this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { 
            this.textBox1, 
            this.chart1, 
            this.textBox2}); 
          this.detail.Name = "detail"
          //  
          // textBox1 
          //  
          this.textBox1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(2.9000003337860107, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.099999986588954926, Telerik.Reporting.Drawing.UnitType.Inch)); 
          this.textBox1.Name = "textBox1"
          this.textBox1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.3000001907348633, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); 
          this.textBox1.Style.Color = System.Drawing.Color.Blue; 
          this.textBox1.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(14, Telerik.Reporting.Drawing.UnitType.Point); 
          this.textBox1.Value = "= Parameters.TerritoryId"
          //  
          // chart1 
          //  
          this.chart1.BitmapResolution = 96F; 
          this.chart1.ImageFormat = System.Drawing.Imaging.ImageFormat.Emf; 
          this.chart1.IntelligentLabelsEnabled = true
          this.chart1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.60000008344650269, Telerik.Reporting.Drawing.UnitType.Inch)); 
          this.chart1.Name = "chart1"
          this.chart1.PlotArea.XAxis.Appearance.CustomFormat = "MM/dd"
          this.chart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Reporting.Charting.Styles.ChartValueFormat.ShortDate; 
          this.chart1.PlotArea.XAxis.IsZeroBased = false
          this.chart1.PlotArea.XAxis.MinValue = 1; 
          this.chart1.PlotArea.YAxis.IsZeroBased = false
          this.chart1.PlotArea.YAxis.MaxValue = 90; 
          this.chart1.PlotArea.YAxis.MinValue = 10; 
          this.chart1.PlotArea.YAxis.Step = 10; 
          chartSeries1.Name = "Series 1"
          this.chart1.Series.AddRange(new Telerik.Reporting.Charting.ChartSeries[] { 
            chartSeries1}); 
          this.chart1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(5.1000003814697266, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(3.1000001430511475, Telerik.Reporting.Drawing.UnitType.Inch)); 
          this.chart1.NeedDataSource += new System.EventHandler(this.chart1_NeedDataSource); 
          //  
          // textBox2 
          //  
          this.textBox2.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.40000009536743164, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.099999986588954926, Telerik.Reporting.Drawing.UnitType.Inch)); 
          this.textBox2.Name = "textBox2"
          this.textBox2.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.4000000953674316, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); 
          this.textBox2.Style.Color = System.Drawing.Color.Blue; 
          this.textBox2.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(14, Telerik.Reporting.Drawing.UnitType.Point); 
          this.textBox2.Value = "Passed in Parameter"
          //  
          // SubReport 
          //  
          this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { 
            this.detail}); 
          this.PageSettings.Landscape = false
          this.PageSettings.Margins.Bottom = new Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch); 
          this.PageSettings.Margins.Left = new Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch); 
          this.PageSettings.Margins.Right = new Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch); 
          this.PageSettings.Margins.Top = new Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch); 
          this.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Letter; 
          reportParameter1.Name = "TerritoryId"
          reportParameter1.Type = Telerik.Reporting.ReportParameterType.Integer; 
          reportParameter1.UI.Visible = true
          reportParameter1.Value = "9"
          this.ReportParameters.Add(reportParameter1); 
          this.Style.BackgroundColor = System.Drawing.Color.White; 
          ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); 
 
        } 
        #endregion 
 
        private Telerik.Reporting.DetailSection detail; 
        private Telerik.Reporting.TextBox textBox1; 
        private Chart chart1; 
        private Telerik.Reporting.TextBox textBox2; 
    } 

Basically the subreport has a textbox that echos out the passed in parameter and the chart.
running it alone the textbox populates and the chart populates.

Running the MasterReport with the Subreport , the textbox populates but the chart causes the cast error.




Steve
Telerik team
 answered on 15 Feb 2010
3 answers
83 views
Dear Telerik,

Can you please help me, how do I do a group footer textbox which value based on group header textbox value.

For example. if the headerGroup textbox value is an "A" then the footerGroup textbox value should be the sum of "A".

Thank you for you Help
Molivia



Peter
Telerik team
 answered on 15 Feb 2010
1 answer
115 views

Hello,

My team is very excited to move into Telerik Reports, however we have first been trialling the software and came accross an issue that we are unable to solve.  Unfortunately we're on a tight deadline, and would sincerely appreciate any prompt responses.

[See Sample Project, Code & screenshot: http://www.addeight.net/telerik-issue.zip]


We are having trouble binding a sub report based on repeating datafrom a parent (master) report. What we need to be able to do is have a masterreport that repeats SolutionIDs (the primary key), and sub reports (which holdall the totals/information based off a single SolutionID). I cannot useFilters, as the data being returned in the sub reports is complicated.

We have seen these articles as references, and have tried (to our knowledge)everything in them:

http://www.telerik.com/community/forums/reporting/telerik-reporting/i-need-to-know-when-to-pass-parameters-to-a-subreport.aspx

http://www.telerik.com/documents/TelerikReporting-LearningGuide.pdf

http://www.telerik.com/community/forums/reporting/telerik-reporting/how-do-i-pass-parameters-to-subreport-sproc.aspx

http://www.telerik.com/support/kb/reporting/designing-reports/using-data-source-with-parameters-in-telerik-reporting.aspx

http://www.telerik.com/community/forums/reporting/telerik-reporting/how-to-set-datasource-of-a-sub-report.aspx

http://www.telerik.com/community/forums/reporting/telerik-reporting/set-subreport-datasource-programmatically.aspx#421286

http://www.telerik.com/ClientsFiles/product.videos/28/

Asyou can see by the screenshot attached (Screenshot.png in root of zip file), we are close. We have used the following code 


    Public Sub New() 

        InitializeComponent() 

 

        'bind the master's datasource 

        Dim cmdMaster As New SqlCommand("SELECT * FROM Solutions WHERE CompanyID=@CompanyID", cn) 

        cmdMaster.Parameters.AddWithValue("@CompanyID", 10) 

        Dim daMaster As New SqlDataAdapter(cmdMaster) 

        Dim dt As New DataTable("Solutions") 

        daMaster.Fill(dt) 

 

        Me.DataSource = dt 

        Me.DataMember = "Solutions" 

    End Sub 

 

    Private Sub SolutionDetails_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles SolutionDetails.NeedDataSource 

        Dim item As Telerik.Reporting.Processing.ReportItemBase = TryCast(sender, Telerik.Reporting.Processing.ReportItemBase) 

        Dim dataRow As DataRowView = DirectCast(item.DataItem, DataRowView) 

        Dim adapter As New SqlDataAdapter("SELECT * FROM Solutions WHERE ID=@SolutionID", cn) 

        adapter.SelectCommand.Parameters.AddWithValue("@SolutionID", dataRow("ID")) 

 

        SolutionDetails.ReportSource.DataSource = adapter 

 

        Test_SolutionDetail1.Debug = dataRow("ID") 

        'Me.DataSource = adapter 

    End Sub 


 

Again, we need to have the sub report on each SolutionID, and we need to be able toquery data based off that SolutionID in the sub report.

We sincerely appreciate any help in advance, and cannot stress the tight deadline we are working with enough.  If you can help, we are more than happy to compensate you for your time!


Cheers!

Justin Brouwer
Top achievements
Rank 1
 answered on 15 Feb 2010
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?