Telerik Forums
Reporting Forum
3 answers
147 views
Hi,

Since Telerik chart presently not supporting changing series item colors at run when datasource is set, I populated the series and series items with colors at run time with out data source.

Problem: Not able to set X axis labels. The following is the code I have written.

Please help me regarding this.



public static void FillAvgGraph(Telerik.Reporting.Processing.Chart chart, List<AvgPercentGraph> list)
        {
           
            Chart definition =(Chart) chart.ItemDefinition;
            //chart.DataSource = list;
            ChartSeries series = new ChartSeries();
            series.Name = "Percent";
            //series.Type = ChartSeriesType.StackedBar100;
            series.DataYColumn = "Percent";
            definition.Legend.Appearance.Position.AlignedPosition = Telerik.Reporting.Charting.Styles.AlignedPositions.Bottom;
            ChartAxisItemsCollection labels=new ChartAxisItemsCollection();
            int index = 0;
            foreach (AvgPercentGraph data in list)
            {
                ChartSeriesItem seriesItem = new ChartSeriesItem();
                seriesItem.Name = data.Name;
                seriesItem.YValue = (double)data.Percent;
                seriesItem.Label.TextBlock.Appearance.FillStyle.MainColor = Color.Black;
                seriesItem.Appearance.FillStyle.FillType = Telerik.Reporting.Charting.Styles.FillType.Solid;
                if(data.Percent < 58)seriesItem.Appearance.FillStyle.MainColor = Color.Red;
                else if (data.Percent > 58 && data.Percent < 76) seriesItem.Appearance.FillStyle.MainColor = Color.Yellow;
                else if (data.Percent > 76 && data.Percent <= 100) seriesItem.Appearance.FillStyle.MainColor = Color.Green;
                series.AddItem(seriesItem);
                ChartAxisItem item = new ChartAxisItem(data.Name);
                labels.Add(item);
                
                
            }
           
            series.DefaultLabelValue = "#Y" + "%";
            
            // series.Appearance.LabelAppearance.FillStyle.FillType = Telerik.Reporting.Charting.Styles.FillType.Solid;
            // series.Appearance.LabelAppearance.FillStyle.MainColor = Color.Red;
            definition.Series.Clear();
            definition.Series.Add(series);
           // definition.Series[0].PlotArea.XAxis.DataLabelsColumn = "Name";
           
              definition.Series[0].PlotArea.YAxis.AddRange(0,100,20);
              definition.PlotArea.XAxis.Items.AddRange(labels.ToArray());
            
           

        }

Sridhar Bolisetti
Top achievements
Rank 1
 answered on 30 Sep 2009
1 answer
325 views
Hi,

I have deployed  my application in IIS7.0 (windows 2008). I am using Telerik Reporting. I have registered the Telerik.ReportViewer.axd  in web.config as follows.

<system.webServer>  
    <validation validateIntegratedModeConfiguration="false"/>  
    ......  
    ......  
    ......  
    <handlers>  
      <remove name="WebServiceHandlerFactory-Integrated"/>  
      <remove name="ScriptHandlerFactory" />  
      <remove name="ScriptHandlerFactoryAppServices" />  
      <remove name="ScriptResource" />  
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"  
           type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"  
           type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd"  
           type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />  
      
      <add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*"  
           type = "Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=2.9.9.202, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"  
           preCondition="integratedMode,runtimeversionv2.0" />  


    </handlers>  
  </system.webServer> 

Eventhough it showing the following error.

The http handler needed by the Report Viewer has not beenregistered in the application's web.config file.  Add <add verb="*"path="Telerik.ReportViewer.axd" type ="Telerik.ReportViewer.WebForms.HttpHandler,Telerik.ReportViewer.WebForms, Version=2.9.9.202, Culture=neutral,PublicKeyToken=a9d7983dfcc261be" /> to the system.web/httpHandlerssection of the configuration file.

kindly tell me a solution.

Thanks & Regards,
Jones
Steve
Telerik team
 answered on 30 Sep 2009
1 answer
134 views
I have generated some subreports with some of my newbie code.  However, they overlap and i have read about making them none zero ni hieght but can not get this to work.

 

Public Sub New()

 

InitializeComponent()

 

Dim mobjCert As New objCertificate(mJobNumber)

 

 

Dim MySubReport As Telerik.Reporting.SubReport

 

 

Dim mobjTemplate As New objTemplate(mobjCert.TemplateCode)

 

 

For tempcounter As Int16 = 1 To mobjTemplate.Count

 

    AddTestSubReports(MySubReport, mobjTemplate.TestCode(tempcounter - 1),

"Test " + tempcounter.ToString + " " + mobjTemplate.TestTitle(tempcounter - 1))

 

 

Next

 

 

End Sub

 

 



Private
Sub AddTestSubReports(ByVal MySubReport As Telerik.Reporting.SubReport, ByVal mTestCode As String, ByVal mTestTitle As String)

 

MySubReport =

New Telerik.Reporting.SubReport

 

MySubReport.Size =

New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(15.082725524902344, Telerik.Reporting.Drawing.UnitType.Cm), New Telerik.Reporting.Drawing.Unit(1.7001994848251343, Telerik.Reporting.Drawing.UnitType.Cm))

 

MySubReport.Style.Padding.Bottom =

New Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Cm)

 

MySubReport.Dock = System.Windows.Forms.DockStyle.Top

MySubReport.Top =

New Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Cm)

 

MySubReport.Name =

"SubReport2"

 

MySubReport.Style.BorderColor.Default = System.Drawing.Color.MidnightBlue

MySubReport.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid

MySubReport.Style.Color = System.Drawing.Color.Transparent

 


Dim
mobjTestTest As New objTestTest(mTestCode)

 

 

Dim mobjHeaders As New objTestHeading(mTestCode)

 

 

Dim txtTemp As New Telerik.Reporting.TextBox

 

 

Dim SubRep As New CertificatTestSubRep1

 

MySubReport.ReportSource = SubRep

SubRep.txtTestName.Value = mTestTitle

DeleteUnwantedSubRepItems(mobjHeaders.Count, SubRep, mobjHeaders)

SubRep.DataSource = mobjTestTest.dtTestTest

 

Me.DetailSection1.Items.Add(MySubReport)

 

 

End Sub

many thanks

Alo

 

Steve
Telerik team
 answered on 29 Sep 2009
1 answer
83 views
I'm trying to figure out how to have my properties populate correctly.  This all works fine in my test project, but when I try to incorporate the reports into my regular project, which uses SQLServer as the SessionState mode, the properties are no longer populated.   In addition, the EmailPromotionReport() is fired twice.   How can I set this up properly?  Thanks.

Report Code:
 public int advertiserID { getset; }  
        public DateTime startDate { getset; }  
        public DateTime endDate { getset; }  
 
        public EmailPromotionReport()  
        {  
            /// <summary>  
            /// Required for telerik Reporting designer support  
            /// </summary>  
            InitializeComponent();  
            this.NeedDataSource += new System.EventHandler(this.EmailPromotionReport_NeedDataSource);  
 
            
        }  
 
 
        private void EmailPromotionReport_NeedDataSource(object sender, EventArgs e)  
        {  
            Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender;  
            report.DataSource = (FarranMedia.Classes.Promotions.GetMailingsByAdvertiser(advertiserID,startDate,endDate)).Tables[0];  
        } 
   
Calling report code:
Reporting.EmailPromotionReport reportBlast = new Reporting.EmailPromotionReport();  
                reportBlast.advertiserID = advertiserID;  
                reportBlast.startDate = Convert.ToDateTime("1/1/07");  
                reportBlast.endDate = DateTime.Today;  
                ReportViewer1.Report = reportBlast; 

Steve
Telerik team
 answered on 29 Sep 2009
0 answers
195 views
Hi,

I have deployed  my application in IIS7.0 + windows 2008. I am using Telerik Reporting. I have added the following in web.config.

<httpHandlers> 
      <remove verb="*" path="*.asmx"/> 
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
 
      <add path="Telerik.ReportViewer.axd" verb="*" type = "Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=2.9.9.202, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" /> 

    </httpHandlers>
    ....... 
    .......
    .......
    .......
<system.webServer> 
    <validation validateIntegratedModeConfiguration="false"/> 
    ...... 
    ...... 
    ...... 
    <handlers> 
      <remove name="WebServiceHandlerFactory-Integrated"/> 
      <remove name="ScriptHandlerFactory" /> 
      <remove name="ScriptHandlerFactoryAppServices" /> 
      <remove name="ScriptResource" /> 
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" 
           type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" 
           type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" 
           type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
      <add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*" 
           type = "Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=2.9.9.202, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" 
           preCondition="integratedMode,runtimeversionv2.0" /> 
    </handlers> 
  </system.webServer> 

I am getting the following error.

The http handler needed by the Report Viewer has not beenregistered in the application's web.config file.  Add <add verb="*"path="Telerik.ReportViewer.axd" type ="Telerik.ReportViewer.WebForms.HttpHandler,Telerik.ReportViewer.WebForms, Version=2.9.9.202, Culture=neutral,PublicKeyToken=a9d7983dfcc261be" /> to the system.web/httpHandlerssection of the configuration file.


Is the tag added in <handlers> was wrong?

Kindly tell me a solution.


Jones
Top achievements
Rank 1
 asked on 29 Sep 2009
3 answers
231 views
Hello,

I am having a problem with my Telerik Report using Datasource on Postback even when I explicitly create and bind a new Datasource to the report in the code behind.

I have a Dropdownlist on my page that contains date ranges I can select to populate the report with.  Next to that I have a "Get Report" button that when clicked fetches the necessary rows from the database, processes them, manually builds a Dataset, and then binds the Dataset to the report.

This works great the first time I generate the report after visiting the page.  However, when I select a new date range from the dropdown and click the Get Timesheet button, the same data from before is displayed.  The Report or ReportViewer appears to be using cached data and I do not know how to refresh it.  The documentation shows a public RefreshReport method in the ReportViewer class that does not actually show up in Visual Studio for me.  Even when I click the refresh button on the ReportViewer, the data remains the same.  I realize that I am not using the standard method to set report parameters, but due to the way I have to build the DataSet I am unable to set the parameters directly on the report.

Any help is greatly appreciated.




Steve
Telerik team
 answered on 29 Sep 2009
12 answers
737 views
How do I uninstall Q1 2008 release ?

When I try to uninstall I get an error saying that it can not connect to the master database on SQL ....  and then it rolls back the uninstall !!

I have not changed my SQL configuration.
Steve
Telerik team
 answered on 29 Sep 2009
3 answers
619 views
I keep seeing this red error box with a cryptic message and an instruction to "See innerException for details" (or something to that effect.

How does one check this innerException?

Thanks
Rick
Top achievements
Rank 1
 answered on 29 Sep 2009
2 answers
89 views
Hi

I am new to reporting and have looked at using either crystal and Telerik.  I have to say that as a newcomer TR is many times more intuitive than CR.  However i am a little stuck on how to approch a problem.

I want to produce a grid type layout based on a users request at runtime.  The layout is just header rows and detail rows.  However i do not know how many columns there will be.  Ther could be as few as three or as many as 8.  The data requested by the user contains the number of columns and the approprate widths of each coumn.  This was made to work by a progammer using vb6 and CR by creating a grid of 10 columns and hiding the unwanted ones at runtime.

However, i guess we could add the columns at runtime using code behind.  Unforrtunately there is very few examples for me to look at.  Can someone provide some examples of adding columns programmatically to simple header detail table.

Is it posible using the group structure to do this without code behind.  So that the table automatically adds the headers along the top creating as many columns as neccessary and then places the row data below?

My Table        
Header 1 Header 2 Header 3 … Header x
Row 1 detail 1 Row 1 detail 2 Row 1 detail 3 … Row 1 detail x
Row 2 detail 1 Row 2 detail 2 Row 2 detail 3 … Row 2 detail x
Row 3 detail 1 Row 3 detail 2 Row 3 detail 3 … Row 3 detail x
Row 4 detail 1 Row 4 detail 2 Row 4 detail 3 … Row 4 detail x




Many thanks

Al
Al
Top achievements
Rank 1
Iron
 answered on 28 Sep 2009
1 answer
82 views
I'm getting my data for the chart from a linq query

            var reportData = from a in data  
                             group a by a.OrderType  
                                 into b  
                                 select new   
                                 {  
                                     OrderType = b.Key,  
                                     Orders = b.Count(),  
                                     OrderTotal = b.Sum(p => p.OrderTotal),  
                                     Tax = b.Sum(p => p.Tax),  
                                     Costs = b.Sum(p => p.ActualCost),  
                                     Profit = b.Sum(p => p.Profit)  
                                 }; 

And setting the data in NeedDataSource

            var procChart = (Telerik.Reporting.Processing.Chart)sender;  
            var defChart = (Telerik.Reporting.Chart)procChart.ItemDefinition;  
            defChart.Series.Clear();  
            var series = new ChartSeries  
                             {  
                                 Type = ChartSeriesType.Pie,   
                                 DataYColumn = chartColumn,   
                                 DataLabelsColumn = "OrderType",   
                                 DefaultLabelValue = "#Y - #%" 
                             };  
            defChart.Series.Add(series);  
            procChart.DataSource = DataSource; 

where chartColumn is OrderTotal, Profit, Costs, or Orders depending on the chart.  The DefaultLabelValue I understand is getting ignored because of the DataLabelsColumn.  Is there a way to supply the "#Y - #%" to the chart along with the DataLabelsColumn as it would be needed for the label as well?
Steve
Telerik team
 answered on 28 Sep 2009
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?