Telerik Forums
Reporting Forum
1 answer
118 views
I created in my master-report this eventheandler, but error tell me (Processing.SubReport subReport = (Processing.SubReport)"sender;) dont' cast Processing.SubReport with Processing.Report.

I want view textbox13 when subreport = 0

 

 

public masterReport(string x)

 

{

InitializeComponent();

 

try

 

{

sqlDataSource1.SelectCommand =

 

".......";

 

 

 


this
.sys2.ItemDataBound += new EventHandler(sys2_ItemDataBound);

 

}

 

 

catch (Exception)

 

{

 

 

throw;

 

}

}



 

 

void sys2_ItemDataBound(object sender, EventArgs e)

 

{

Telerik.Reporting.Processing.

 

SubReport subReport = (Telerik.Reporting.Processing.SubReport)sender;

 

Telerik.Reporting.Processing.

 

Report report = (Telerik.Reporting.Processing.Report)subReport.InnerReport;

 

 

 

if (report.ChildElements.Find("trasmissione", true).Length > 0)

 

{

subReport.Visible =

 

true;

 

}

 

 

else

 

{

textBox13.Visible =

 

true;

 

}

}

Please, help me. Thank you

Hadib Ahmabi
Top achievements
Rank 1
 answered on 12 Jun 2012
3 answers
308 views
We are building dynamic reports with various parameters. There is one parameter (X) where each value basically defines what type of parameter should be used next. I figured that the most obvious moment to add or modify parameters is on the NeedDataSource since there aren't that many other hooks. I tried to trick this by writing a class which is called by an ObjectDataSource and only modifies the Report by calling a function that add parameters. This ObjectDataSource is bound to a hidden ReporParameter and has a DataSourceParameter that uses the selection from the first parameter. So once I select a value the method is called that manipulates the ReportParameters (adding, removing, hiding). Unfortunately, any parameter I manipulate or add once the Report is constructed isn't displayed.

The Refresh button on the WebForms ReportViewer however makes later added parameters visible. Is there any way I can trigger the same functionality of the Refresh button programatically?

Right now I have to resort to moving parameters in a custom section on the webpage to get this done. Which I rather not do because it simply looks more inconsistent.
IvanY
Telerik team
 answered on 11 Jun 2012
1 answer
161 views
Hello,

I am currently working on a Silverlight Business Application working entirely over Https. The project is hosted on Azure. I am using Q1 2011 tools and Siverlight 5.

I followed carefully the documentation and copy/pasted the web.config part as in : http://www.telerik.com/help/reporting/silverlight-enable-ssl-for-telerik-reporting-wcf-service.html 
I also enabled the Session caching for Azure and it is working fine. Now the problem is that as soon as i put a chart on my report, i am getting an error code 500. The detail is as follow :

Server Error in '/' Application.

Unable to cast object of type 'System.Text.CodePageEncoding' to type 'System.Text.Encoding'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Text.CodePageEncoding' to type 'System.Text.Encoding'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidCastException: Unable to cast object of type 'System.Text.CodePageEncoding' to type 'System.Text.Encoding'.]
   ReadInternalEncoderBestFitFallbackFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) +648
   System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +106
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, String name, String ns) +109
   System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadSerializationInfo(XmlReaderDelegator xmlReader, Type type) +357
   ReadCodePageEncodingFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) +144
   System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +106
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   ReadRenderingStreamFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) +1631
   System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +106
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   ReadArrayOfRenderingStreamFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString , XmlDictionaryString , CollectionDataContract ) +623
   System.Runtime.Serialization.CollectionDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +161
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   ReadArrayOfRenderingStreamFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) +358
   System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +106
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   ReadReportServiceHistoryFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) +820
   System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +106
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   ReadArrayOfanyTypeFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString , XmlDictionaryString , CollectionDataContract ) +575
   System.Runtime.Serialization.CollectionDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +161
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   ReadSerializableSessionStateStoreDataFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) +764
   System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +106
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, String name, String ns) +109
   System.Runtime.Serialization.NetDataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName) +170
   System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) +647
   System.Runtime.Serialization.XmlObjectSerializer.ReadObject(XmlDictionaryReader reader) +128
   Microsoft.ApplicationServer.Caching.Utility.Deserialize(Byte[][] buffers, Boolean checkTypeToLoad, Object context, IEnumerable`1 knownTypes) +684
   Microsoft.ApplicationServer.Caching.SimpleSendReceiveModule.SendMsgAndWait(EndpointID endpt, RequestBody reqMsg, TimeSpan requestTimeout, IRequestTracker& tracker) +1615
   Microsoft.ApplicationServer.Caching.HybridClient.SendMsgAndWait(RequestBody reqMsg, IRequestTracker& tracker) +188
   Microsoft.ApplicationServer.Caching.DataCache.SendReceive(RequestBody reqMsg, IMonitoringListener listener) +254
   Microsoft.ApplicationServer.Caching.DataCache.ExecuteAPI(RequestBody reqMsg, IMonitoringListener listener) +10
   Microsoft.ApplicationServer.Caching.DataCache.InternalGetAndLock(String key, TimeSpan timeout, DataCacheLockHandle& lockHandle, String region, Boolean lockKey, IMonitoringListener listener) +227
   Microsoft.ApplicationServer.Caching.<>c__DisplayClass78.<GetAndLock>b__77() +103
   Microsoft.ApplicationServer.Caching.DataCache.GetAndLock(String key, TimeSpan timeout, DataCacheLockHandle& lockHandle) +258
   Microsoft.Web.DistributedCache.<>c__DisplayClass31`1.<PerformCacheOperation>b__30() +19
   Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(Action action) +66
   Microsoft.Web.DistributedCache.DataCacheForwarderBase.GetAndLock(String key, TimeSpan timeout, DataCacheLockHandle& lockHandle) +190
   Microsoft.Web.DistributedCache.BlobBasedSessionStoreProvider.GetItem(HttpContextBase context, String id, Boolean acquireWriteLock, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) +211
   Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) +125
   System.Web.SessionState.SessionStateModule.GetSessionStateItem() +178
   System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1076
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +115
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 


I checked the Output window in visual studio and nothing looked wrong. The report is built but nothing is appearing in the Silverlight page.
I also tried to host the report on an asp.net webpage, and put that webpage in a RadHtmlHolder within my silverlight application. The chart were working fine when i was calling the page over http, but not over https(tables were displayed but chart were not there).

Let me know if I need to give you more information, i am stuck for a week on this problem...


UPDATE : Looks like I cannot answer the thread, I am getting an error.

->
Thank you for your answer Steve,


The Out-proc session was already set up and the reports were appearing fine, it is only when i added a chart that it stopped working.
The endpoints were also present. What i ended up doing is hosting it on a local IIS and add http and https endpoint, i also removed Out-proc session and everything worked perfectly.


Our final solution  was to use an Amazon EC2 instance, we moved all our databases and website from Azure to there. Since then the system is 6 times quicker on average and most of the workarounds necessary for Azure are not needed anymore.


Anyway thank you for your support and keep up the good work :)






Steve
Telerik team
 answered on 11 Jun 2012
2 answers
75 views
Hi All,

I am using Telerik Reporting Q1 2012 for Web. I am new to Telerik  Reporting.

1) Using this below tutorial:

http://www.telerik.com/help/reporting/designing-reports-reportbook-web-viewer.html


I just created 2 Reports (ClinicMasterIntakes and ClinicMasterReferrals), added them to Report Library in .aspx page but when I view that page in browser, I only see 1st report(ClinicMasterIntakes). What mechanism I need to use to see both report names appear side by side like Radgrid Link Buttons. Please give me (new user) a simple solution.

Below is my code. 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ClinicReports.aspx.cs" Inherits="BHS_WebReports.ClinicReports" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<%@ Register assembly="Telerik.ReportViewer.WebForms, Version=6.0.12.215, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" namespace="Telerik.ReportViewer.WebForms" tagprefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title>BHS Clinical Reports</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="1000px"  Width = "900px"
            ReportBookID="ReportBookControl1">
        </telerik:ReportViewer>
        <telerik:ReportBookControl ID="ReportBookControl1" runat="server">
            <Reports>
                <telerik:ReportInfo Report="BHS_Clinic_Activity_Reports.ClinicMasterIntakes, BHS_Clinic_Activity_Reports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
                <telerik:ReportInfo Report="BHS_Clinic_Activity_Reports.ClinicMasterReferrals, BHS_Clinic_Activity_Reports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
                </telerik:ReportInfo>
            </Reports>
        </telerik:ReportBookControl>
    </div>
     
    </form>
</body>
</html>
 
2) How do I increase the width of Drop down list in report viewer? Please refer to below screen shot. In the subcategory dropdown list,

Blue circled is actual width. How do I increase the width to Red Circled?


Thanks for your help.

gc_0620

Elian
Telerik team
 answered on 11 Jun 2012
1 answer
62 views

I have a lot of reports developed using Q3 2009 version of telerik reporting. Before developing new reports, we want to ensure that the existing reports work as they used to after upgrading to latest version of telerik reporting. But all the reports which use subreport fail compilation with the error: 'DataItem' is not a member of 'Telerik.Reporting.Processing.SubReport'.

All the reports use objectdatasource.

 

 

 

 

 

Private Sub SubReport1_NeedDataSource(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SubReport1.NeedDataSource

 

 

 

Dim subReport As Telerik.Reporting.Processing.SubReport = DirectCast(sender, Telerik.Reporting.Processing.SubReport)

 

subReport.InnerReport.DataSource =

 

DirectCast(subReport.DataItem, System.Data.DataRowView)("subreportList")

 

 

 

End Sub

Please suggest what needs to be done here so that I can quickly fix these existing reports and then move to development of new reports

Thanks in advance

 

Steve
Telerik team
 answered on 11 Jun 2012
2 answers
100 views
Hi,
Any chance you could provide a VS example (WPF) of a Chart using OpenAccessDataSource?

My solution contains two separate projects (Model for OpenAccess, and Reports which includes a Model reference). I have created a Report and successfully used a SqlDataSource, however, changing it to OpenAccessDataSource I get an empty series in the Chart. I have just used the configure wizard so that the Object Context is selected from {}Model and the Object Context Member selected is the IQueryable View. The SQL View I created and added to Model contains the same SQL statement used in the SqlDataSource connection.
 
Thanks. Al.
Alan
Top achievements
Rank 1
Iron
 answered on 08 Jun 2012
1 answer
81 views
I have a report viewer in a silverlight control, and when it loads it comes up blank until I hit refresh on the viewer, and then the report is finally loaded. What could be happening? Here's the code I'm using:

public ReportWrapper()
{
    InitializeComponent();
 
    this.rptViewer.RenderBegin += new Telerik.ReportViewer.Silverlight.RenderBeginEventHandler(rptViewer_RenderBegin);
    this.Loaded += ReportWrapper_Loaded;
 
    this.rptViewer.ReportServiceUri = new Uri("http://webserver/reportserver/reportservice.svc");
    this.rptViewer.Report = "ReportLib.TestReport";
}
 
void rptViewer_RenderBegin(object sender, Telerik.ReportViewer.Silverlight.RenderBeginEventArgs args)
{
 
    args.ParameterValues["ID"] = ID;
}
Steve
Telerik team
 answered on 08 Jun 2012
1 answer
135 views
Hello,

I have 2 dates which i need to display on x axis labels.

For Eg : 04/01/12 to 04/30/12
is the text and I want to display it as-

04/01/12
   to
04/30/12

i can get the dates in separate column or in a single column , whatever is convenient.
please let me know a way I can display the labels in the above format.

thanks!
-priti
Elian
Telerik team
 answered on 08 Jun 2012
1 answer
113 views
Hi

I have a bar chart and want to display the Y axis label from codebehind.
I tried with code -

 Chart1.PlotArea.YAxis.AxisLabel.TextBlock.Text = "%"

but that does not show up on the chart.
please suggest how can i make a Y axis label displayed.

thanks!
-priti
Elian
Telerik team
 answered on 08 Jun 2012
1 answer
163 views
Hi there,

Im going through a similar situation:
I have a chart inside a report that wont bind at all, iv tried several options

REPORT.DESIGNER.CS===============================================================
 partial class ReportUserCompletion
    {
        #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(ReportUserCompletion));
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem1 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem2 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem3 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem4 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem5 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem6 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem7 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartSeries chartSeries1 = new Telerik.Reporting.Charting.ChartSeries();
            Telerik.Reporting.Charting.Styles.Corners corners1 = new Telerik.Reporting.Charting.Styles.Corners();
            Telerik.Reporting.Charting.ChartSeries chartSeries2 = new Telerik.Reporting.Charting.ChartSeries();
            Telerik.Reporting.Charting.Styles.Corners corners2 = new Telerik.Reporting.Charting.Styles.Corners();
            Telerik.Reporting.ReportParameter reportParameter1 = new Telerik.Reporting.ReportParameter();
            Telerik.Reporting.ReportParameter reportParameter2 = new Telerik.Reporting.ReportParameter();
            this.pageHeaderSection1 = new Telerik.Reporting.PageHeaderSection();
            this.pictureBox1 = new Telerik.Reporting.PictureBox();
            this.textBox7 = new Telerik.Reporting.TextBox();
            this.detail = new Telerik.Reporting.DetailSection();
            this.chart1 = new Telerik.Reporting.Chart();
            this.odsReportGraph = new Telerik.Reporting.ObjectDataSource();
            this.pageFooterSection1 = new Telerik.Reporting.PageFooterSection();
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
            //
            // pageHeaderSection1
            //
            this.pageHeaderSection1.Height = Telerik.Reporting.Drawing.Unit.Cm(4.5D);
            this.pageHeaderSection1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.pictureBox1,
            this.textBox7});
            this.pageHeaderSection1.Name = "pageHeaderSection1";
            //
            // pictureBox1
            //
            this.pictureBox1.Docking = Telerik.Reporting.DockingStyle.Top;
            this.pictureBox1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(0D), Telerik.Reporting.Drawing.Unit.Cm(0D));
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(19D), Telerik.Reporting.Drawing.Unit.Cm(3.2000997066497803D));
            this.pictureBox1.Sizing = Telerik.Reporting.Drawing.ImageSizeMode.AutoSize;
            this.pictureBox1.Style.BackgroundImage.ImageData = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Style.BackgroundImage.ImageData")));
            this.pictureBox1.Style.BackgroundImage.MimeType = "image/png";
            this.pictureBox1.Style.BackgroundImage.Repeat = Telerik.Reporting.Drawing.BackgroundRepeat.NoRepeat;
            //
            // textBox7
            //
            this.textBox7.Docking = Telerik.Reporting.DockingStyle.Top;
            this.textBox7.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(0D), Telerik.Reporting.Drawing.Unit.Cm(3.2000997066497803D));
            this.textBox7.Name = "textBox7";
            this.textBox7.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(19D), Telerik.Reporting.Drawing.Unit.Cm(0.800000011920929D));
            this.textBox7.Style.Font.Bold = true;
            this.textBox7.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(18D);
            this.textBox7.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
            this.textBox7.Value = "Completion per User";
            //
            // detail
            //
            this.detail.Height = Telerik.Reporting.Drawing.Unit.Cm(8.3999996185302734D);
            this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.chart1});
            this.detail.Name = "detail";
            //
            // chart1
            //
            this.chart1.BitmapResolution = 96F;
            this.chart1.ChartTitle.TextBlock.Text = "Progress By Industry Association or Regulatory Body";
            this.chart1.DataSource = this.odsReportGraph;
            this.chart1.ImageFormat = System.Drawing.Imaging.ImageFormat.Emf;
            this.chart1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(0.00010012308484874666D), Telerik.Reporting.Drawing.Unit.Cm(0.00010012308484874666D));
            this.chart1.Name = "chart1";
            this.chart1.PlotArea.XAxis.AutoScale = false;
            this.chart1.PlotArea.XAxis.AxisLabel.Appearance.RotationAngle = 270F;
            this.chart1.PlotArea.XAxis.DataLabelsColumn = "OrgTitle";
            chartAxisItem1.Value = new decimal(new int[] {
            1,
            0,
            0,
            0});
            chartAxisItem2.Value = new decimal(new int[] {
            2,
            0,
            0,
            0});
            chartAxisItem3.Value = new decimal(new int[] {
            3,
            0,
            0,
            0});
            chartAxisItem4.Value = new decimal(new int[] {
            4,
            0,
            0,
            0});
            chartAxisItem5.Value = new decimal(new int[] {
            5,
            0,
            0,
            0});
            chartAxisItem6.Value = new decimal(new int[] {
            6,
            0,
            0,
            0});
            chartAxisItem7.Value = new decimal(new int[] {
            7,
            0,
            0,
            0});
            this.chart1.PlotArea.XAxis.Items.AddRange(new Telerik.Reporting.Charting.ChartAxisItem[] {
            chartAxisItem1,
            chartAxisItem2,
            chartAxisItem3,
            chartAxisItem4,
            chartAxisItem5,
            chartAxisItem6,
            chartAxisItem7});
            this.chart1.PlotArea.XAxis.MinValue = 1D;
            this.chart1.PlotArea.YAxis.AxisLabel.Appearance.RotationAngle = 0F;
            this.chart1.PlotArea.YAxis.AxisMode = Telerik.Reporting.Charting.ChartYAxisMode.Extended;
            this.chart1.PlotArea.YAxis.MaxValue = 100D;
            this.chart1.PlotArea.YAxis.Step = 10D;
            this.chart1.PlotArea.YAxis2.AxisLabel.Appearance.RotationAngle = 0F;
            corners1.BottomRight = Telerik.Reporting.Charting.Styles.CornerType.Round;
            corners1.TopRight = Telerik.Reporting.Charting.Styles.CornerType.Round;
            chartSeries1.Appearance.Corners = corners1;
            chartSeries1.Appearance.FillStyle.MainColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(247)))), ((int)(((byte)(255)))));
            chartSeries1.DataXColumn = "OrgLimit";
            chartSeries1.DefaultLabelValue = "CPD Goal";
            chartSeries1.Name = "Series 1";
            corners2.BottomRight = Telerik.Reporting.Charting.Styles.CornerType.Round;
            corners2.TopRight = Telerik.Reporting.Charting.Styles.CornerType.Round;
            chartSeries2.Appearance.Corners = corners2;
            chartSeries2.Appearance.FillStyle.MainColor = System.Drawing.Color.FromArgb(((int)(((byte)(218)))), ((int)(((byte)(254)))), ((int)(((byte)(122)))));
            chartSeries2.DataXColumn = "MyScore";
            chartSeries2.DefaultLabelValue = "My Score";
            chartSeries2.Name = "Series 2";
            this.chart1.Series.AddRange(new Telerik.Reporting.Charting.ChartSeries[] {
            chartSeries1,
            chartSeries2});
            this.chart1.SeriesOrientation = Telerik.Reporting.Charting.ChartSeriesOrientation.Horizontal;
            this.chart1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(19D), Telerik.Reporting.Drawing.Unit.Cm(7.5D));
            this.chart1.NeedDataSource += new System.EventHandler(this.chart1_NeedDataSource);
            //
            // odsReportGraph
            //
            this.odsReportGraph.DataMember = "ReportSelectUserDataByOrganization";
            this.odsReportGraph.DataSource = typeof(CPDOne.Warehouse.ReportFactory);
            this.odsReportGraph.Name = "odsReportGraph";
            this.odsReportGraph.Parameters.AddRange(new Telerik.Reporting.ObjectDataSourceParameter[] {
            new Telerik.Reporting.ObjectDataSourceParameter("UserId", typeof(long), "=Parameters.UserId.Value"),
            new Telerik.Reporting.ObjectDataSourceParameter("needId", typeof(bool), "=Parameters.needId.Value")});
            //
            // pageFooterSection1
            //
            this.pageFooterSection1.Height = Telerik.Reporting.Drawing.Unit.Cm(3D);
            this.pageFooterSection1.Name = "pageFooterSection1";
            //
            // ReportUserCompletion
            //
            this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.pageHeaderSection1,
            this.detail,
            this.pageFooterSection1});
            this.Name = "ReportUserCompletion";
            this.PageSettings.Landscape = false;
            this.PageSettings.Margins.Bottom = Telerik.Reporting.Drawing.Unit.Cm(1D);
            this.PageSettings.Margins.Left = Telerik.Reporting.Drawing.Unit.Cm(1D);
            this.PageSettings.Margins.Right = Telerik.Reporting.Drawing.Unit.Cm(1D);
            this.PageSettings.Margins.Top = Telerik.Reporting.Drawing.Unit.Mm(1D);
            this.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A4;
            reportParameter1.Name = "UserId";
            reportParameter1.Text = "UserId";
            reportParameter1.Type = Telerik.Reporting.ReportParameterType.Integer;
            reportParameter2.Name = "needId";
            reportParameter2.Text = "needId";
            reportParameter2.Type = Telerik.Reporting.ReportParameterType.Boolean;
            this.ReportParameters.Add(reportParameter1);
            this.ReportParameters.Add(reportParameter2);
            this.Style.BackgroundColor = System.Drawing.Color.White;
            this.Width = Telerik.Reporting.Drawing.Unit.Cm(19D);
            this.NeedDataSource += new System.EventHandler(this.ReportUserCompletion_NeedDataSource);
            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();

        }
        #endregion

        private Telerik.Reporting.PageHeaderSection pageHeaderSection1;
        private Telerik.Reporting.DetailSection detail;
        private Telerik.Reporting.PageFooterSection pageFooterSection1;
        private Telerik.Reporting.PictureBox pictureBox1;
        private Telerik.Reporting.TextBox textBox7;
        private Telerik.Reporting.Chart chart1;
        private Telerik.Reporting.ObjectDataSource odsReportGraph;
    }


REPORT.CS===============================================================
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using Telerik.Reporting;
    using Telerik.Reporting.Drawing;

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

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        private void chart1_NeedDataSource(object sender, EventArgs e)
        {
            //odsReportGraph.Parameters["needId"].Value = this.ReportParameters["needId"].Value;
            //odsReportGraph.Parameters["UserId"].Value = this.ReportParameters["UserId"].Value;
            //chart1.DataSource = odsReportGraph;

            ReportFactory _ReportFactory = new ReportFactory();
            chart1.DataSource = _ReportFactory.ReportSelectUserDataByOrganization(Int64.Parse(this.ReportParameters["UserId"].Value.ToString()));

        }

        private void ReportUserCompletion_NeedDataSource(object sender, EventArgs e)
        {

            ReportFactory _ReportFactory = new ReportFactory();
            chart1.DataSource = _ReportFactory.ReportSelectUserDataByOrganization(Int64.Parse(this.ReportParameters["UserId"].Value.ToString()));
            //this.DataSource = _ReportFactory.ReportSelectUserDataByOrganization(Int64.Parse(this.ReportParameters["UserId"].Value.ToString()));
        }
    }

MY_WEB_APP.ASPX ===============================================================
here is where i load the variables and pass onto the report and subsequently to the datasource inside the report that loads the graph:
// this is my dataobject
       CPDOne.Warehouse.ReportUserCompletion _ReportUSerCompletion = new ReportUserCompletion();
        _ReportUSerCompletion.ReportParameters["UserId"].Value = UserId;
        _ReportUSerCompletion.ReportParameters["needId"].Value = true;
        ReportViewer1.Report = _ReportUSerCompletion;


Please help me, what am i doing wrong, i need to bind data to this chart inside the report. thanks in advance.
Elian
Telerik team
 answered on 08 Jun 2012
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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?