Telerik Forums
Reporting Forum
1 answer
217 views

I have a report with 4 visible parameters and only one has AutoRefresh on. We have recently upgraded this report to Q3 2012 version. I was able to refresh the report when the AutoRefresh parameter value is changed with the previous releases. But after I upgraded the report to Q3 2012, this feature is not working. I do need the Preview button for other parameters.

Please let me know how can I refresh the page when this parameter is changed without having to click the Preview button.

Thank you

 

Stef
Telerik team
 answered on 28 Feb 2013
1 answer
287 views
I looking for get query result from sqldatasource by C#  
because I want to custom something from query result and apply it to graph 

some thing like this

public class GraphItem
{
    public string name { get; set; }
    public double value { get; set; }
    public GraphItem(string name, double value)
    {
        this.name = name;
        this.value = value;
    }
}
 
private void chart1_NeedDataSource(object sender, EventArgs e)
{
    //Prepare graph value
    List<GraphItem> graphItemList = getQueryResult(sqlDataSource1);
     
    //Plot Graph
    Telerik.Reporting.Processing.Chart procChart = (Telerik.Reporting.Processing.Chart)sender;
    Telerik.Reporting.Chart defChart = (Telerik.Reporting.Chart)procChart.ItemDefinition;
    defChart.IntelligentLabelsEnabled = false;
    ChartSeries serie = new ChartSeries();
    serie.Type = ChartSeriesType.Pie;
    serie.Clear();
    serie.Appearance.LegendDisplayMode = Telerik.Reporting.Charting.ChartSeriesLegendDisplayMode.ItemLabels;
    foreach (GraphItem lst in graphItemList)
    {
        ChartSeriesItem item = new ChartSeriesItem();
        item.YValue = (double)lst.value;
        item.Name = (string)lst.name;
        item.Appearance.Exploded = true;
        item.Label.TextBlock.Text = (string)lst.name + " - #%";
        serie.Items.Add(item);
    }
    defChart.Series.Clear();
    defChart.Series.Add(serie);
}

How to built "getQueryResult(sqlDataSource1);" 
I don't know how to get query result from sqldatasoce

Thank for your response

Hadib Ahmabi
Top achievements
Rank 1
 answered on 28 Feb 2013
3 answers
247 views
I have a report  that is using Q1 2013 (6.2.13.110).  This is a WINFORMS application written in VB.NET 2010

I have 3 group sections on the report where group 2 ("CltName") has a few summary fields as well as a Last(xxx) field (lets call it "GroupEndBalance".  I would like to create a summary field for "GroupEndBalance" in the "CltMasterNameGroup" but reporting will not allow a Sum(Last(xxx)) or a Sum(GroupEndBalance).

How can I get a summary of the "GroupEndBalance" field into the "CltMasterNameGroup".

I think if I was able to create a global variable and store the sum of this value on group2 change that may work but I am unsure as to how to accomplish that.

I have attached a screen shot of what the design of the report is so you can get an idea of what it looks like.

Any detailed ideas would be helpful.

Doug

Stef
Telerik team
 answered on 28 Feb 2013
5 answers
231 views
Hello,

I am trying to add series and series items at runtime to an empty chart in a report.
However, albeit I can see the changes I'm making at runtime happening they do not reflect in the Chart.

Here's my NeedDataSource Event code:

        private void chart1_NeedDataSource(object sender, EventArgs e)  
        {  
            List<Product> produtos = new List<Product>();  
 
            produtos.Add(new Product() { qty = 10, name = "Produto 1" });  
            produtos.Add(new Product() { qty = 35, name = "Produto 2" });  
            produtos.Add(new Product() { qty = 17, name = "Produto 3" });  
            produtos.Add(new Product() { qty = 65, name = "Produto 4" });  
 
            ChartSeries serie = new ChartSeries();  
 
            foreach (Product prod  in produtos)  
            {  
                ChartSeriesItem item = new ChartSeriesItem();  
                item.YValue = prod.qty;  
                item.Name = prod.name;  
                item.Label.TextBlock.Text = prod.name;  
                serie.Items.Add(item);  
            }  
 
            chart1.Series.Add(serie);  
 
        } 

If I execute this code, the chart will be EMPTY...and showing the message: There is no or empty Series. And the Legend has 1 Item with a label text of Series xx.

IF I eventually change my NeedDataSource event to:
        private void chart1_NeedDataSource(object sender, EventArgs e)  
        {  
            List<Product> produtos = new List<Product>();  
 
            produtos.Add(new Product() { qty = 10, name = "Produto 1" });  
            produtos.Add(new Product() { qty = 35, name = "Produto 2" });  
            produtos.Add(new Product() { qty = 17, name = "Produto 3" });  
            produtos.Add(new Product() { qty = 65, name = "Produto 4" });  
 
 
            chart1.DataSource = produtos;  
 
        } 

The chart will show the values correctly. However I can't change each indivual item values or appearance at runtime! Firstly, I get an exception if I try to use the following line after chart1.Datasource = produtos:

ChartSeries

 

series = chart1.Series[0];

 

 

I get an out of bound exception.

If I put that line of code on the ItemDataBound Event it works fine:

private void chart1_ItemDataBound(object sender, EventArgs e)  
 
{  
 
ChartSeries series = chart1.Series[0];  
 
series.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels;  
 
series.Type = ChartSeriesType.Pie;  
 

As a side note, I'm loading the report on a reportviewer and I initialize it like so:

        private void Form1_Load(object sender, EventArgs e)  
        {  
            reportViewer1.Report = new ReportTest();  
            reportViewer1.RefreshReport();  
        } 

Even though I'm calling the RefreshReport Method, whenever I execute the application I'm forced to manually press the Refresh Button on the report viewer just to watch my ItemDataBound code be actually rendered...what the heck?!

Back to my ItemDataBound event...I can actually access the serie's Items, but any change I make to them (be it YValues or Appearance stuff) it WONT reflect on my reportviewer no matter how much I smash the refresh button!

Here's my complete code:

ReportTest.cs
(chart1 was just dropped onto the detail section in Design time. No other changes were made!)

    using System;  
    using System.ComponentModel;  
    using System.Drawing;  
    using System.Windows.Forms;  
    using Telerik.Reporting;  
    using Telerik.Reporting.Drawing;  
    using System.Collections.Generic;  
    using Telerik.Reporting.Charting;  
 
    public partial class ReportTest : Telerik.Reporting.Report  
    {  
        public ReportTest()  
        {  
 
            InitializeComponent();  
 
         }  
 
        private void chart1_NeedDataSource(object sender, EventArgs e)  
        {  
            List<Product> produtos = new List<Product>();  
 
            produtos.Add(new Product() { qty = 10, name = "Produto 1" });  
            produtos.Add(new Product() { qty = 35, name = "Produto 2" });  
            produtos.Add(new Product() { qty = 17, name = "Produto 3" });  
            produtos.Add(new Product() { qty = 65, name = "Produto 4" });  
 
 
            chart1.DataSource = produtos;  
            ChartSeries series = chart1.Series[0];  
        }  
 
        private void chart1_ItemDataBound(object sender, EventArgs e)  
        {  
            ChartSeries series = chart1.Series[0];  
            series.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels;  
            series.Type = ChartSeriesType.Pie;  
            foreach (ChartSeriesItem item in series.Items)  
            {  
                double x = item.YValue;  
                item.Label.TextBlock.Text = "BLAH";  
                item.Appearance.Exploded = true;  
            }  
            series.SetValues(new double[] {10,15,30,47 });  
            chart1.PlotArea.SetDirty();  
 
 
              
        }   
 
    } 

Form1.cs

    public partial class Form1 : Form  
    {  
        public Form1()  
        {  
            InitializeComponent();  
        }  
 
        private void Form1_Load(object sender, EventArgs e)  
        {  
            reportViewer1.Report = new ReportTest();  
            reportViewer1.RefreshReport();  
        }  
    } 


Please help... I already lost a whole day of work trying to figure this out.

P.S.: I followed EVERY single tutorial regarding adding series at runtime and NONE OF THEM WORK on my end.

Stef
Telerik team
 answered on 28 Feb 2013
2 answers
166 views
Hello!

Is there any way, coding or not coding, to achieve this ? I'll need to make a report that has 1 level of drilldown. I would like to be able to expand all presented items so I can print out the report expanded.

Is there a way of doing this or I may as well keep on dreaming? :D

Regards!
Stargazer
Top achievements
Rank 2
 answered on 28 Feb 2013
1 answer
125 views
Hello, I am trying to set up a chart in my trdx report file and I am not have much luck formatting it. When I added the chart to the report I then set my DataSource for the chart. When I right click on the chart and select Properties, the data tab displays a message "To dynamically populate the chart with data set the chart's DataSource property". I did this step so I'm not sure what else I can do.

Also, the data I am providing has a UserName, Phone Extension, Number of minutes on phone per hour and the datetime (in one hour increments). When I preview the chart it does show data from the DataSource, but it shows the telephone extension and hours per minute on phone as my values. I try to set the X-Axis to use the datetime value, but it is not taking it correctly.

I would appreciate your assistance in resolving this issue. I am currently using Version 6.2.12.1017 of the Telerik Report Designer.

I am able to create a stand alone trdx file that outlines the problem I am having. Since you are only accepting image extensions can you please let me know what I can do to send you my trdx file.

Thanks,

Don Tompkins
Databound Solutions.
Stef
Telerik team
 answered on 28 Feb 2013
3 answers
171 views
Hi,

We have upgraded to the latest version and compiler gives warning for obselete interface of ChildElements; and suggests using the below instead of it:
Telerik.Reporting.Processing.ElementTreeHelper.GetChildElements(section)

But, I am unable to convert the below line:

Dim procTextbox As Telerik.Reporting.Processing.TextBox = DirectCast(section.ChildElements.Find("txtFile_Name", True)(0), Telerik.Reporting.Processing.TextBox)

Can you please let me know who to achieve the functionality of the line above using the Telerik.Reporting.Processing.ElementTreeHelper.GetChildElements instead?

Thanks.
Alp
Top achievements
Rank 1
 answered on 28 Feb 2013
1 answer
60 views
Hi, we have HTML in the database formatted like this - 

J. Aaron Grantham, MD<br/>Consulting <li>Abbott Vascular</li>Grant Support <li>Abbott Vascular</li><li>Medtronic, Inc.</li><li>Asahi Intecc Co.</li>Honoraria  <li>Boston Scientific Corporation</li><li>Bridgepoint</li><br/><br/>Off Label: No FDA aproved stent for CTO-PCI.  Will not reccomend one in particular.<br/><br/>

and i am getting a reporting error when binding this to an HTMLTextBox - List item must be in list, which is puzzling. Any thoughts on what is going on here?
Hadib Ahmabi
Top achievements
Rank 1
 answered on 28 Feb 2013
1 answer
83 views
Hi there, I have a chart with barsand values 0 - 15

In case the value is 0.86 it is not showed in case steps is 1, if i set the steps to 0.1 or 0.01 (which would be necessary) it looks very unuseable, because there are tons uf lines.

Has anyone an idea?
Elian
Telerik team
 answered on 28 Feb 2013
3 answers
214 views
Hello,

I am generating report table dynamically feeding cell data in textbox. I am setting each cell textbox's CanGrow property to true, as i want height to be increased if longer text. But with that, I see too much white space between rows. It adds black space in cell after value. Hence I see less no. of rows per page.

Thank you,
Manish
Manish
Top achievements
Rank 1
 answered on 28 Feb 2013
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
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?