Telerik Forums
Reporting Forum
1 answer
254 views
Hello,

I am trying to build a Telerik Report (Template) to dynamically build reports based on the DataSource that it binds to. How can I dynamically add controls into each (header, details & footer section)? Please help.

I am trying something similar. But it is not letting me to do that. Please help. Thanks

public partial class _Default : System.Web.UI.Page {  
 
        protected void Page_Load(object sender, EventArgs e) {  
 
            // ReportTemplate is an Empty Report without any controls.  
            ReportTemplate Rep = new ReportTemplate();  
            for (int i = 0; i < 8; i++) {  
                Telerik.Reporting.TextBox h = new Telerik.Reporting.TextBox();  
                h.Value = "Column" + i.ToString();  
                PageHeaderSection header = new PageHeaderSection();  
                Header.Controls.Add(h);  
 
            }  
        }  
    } 


Steve
Telerik team
 answered on 22 Jun 2009
4 answers
509 views
I'm trying to display a report in a WPF window and I'm stuck.

I know I had something similar working a while back but with the changes I've made and upgrade to the Telerik ReportViewer I can't seem to accomplish the task now.

Here's the code for my ReportViewer window:

    public partial class MyReportViewer : Window  
    {  
        private IReportDocument myReport;  
 
        public MyReportViewer(IReportDocument document)  
        {  
            myReport = document;  
            InitializeComponent();  
        }  
 
        private void WindowLoaded(object sender, RoutedEventArgs e)  
        {  
            System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();  
 
            ReportViewer rptViewer = new ReportViewer();  
            rptViewer.Report = this.myReport;  
            rptViewer.RefreshReport();  
            host.Child = rptViewer;  
              
              
        }  
   }  

 

 

 



Here's the calling window:
...

 

            KeyFront keyfront = new KeyFront(zone.ZoneID);  
            MyReportViewer rptViewer = new MyReportViewer(keyfront);  
            rptViewer.Show(); 

Here's the report code:
 

        public KeyFront(int zonepk)  
        {  
            /// <summary>  
            /// Required for telerik Reporting designer support  
            /// </summary>  
            InitializeComponent();  
 
            this.sqlDataAdapter1.SelectCommand.Parameters["@ZonePK"].Value = zonepk;  
            this.DataSource = this.sqlDataAdapter1;  
 
 
            //  
            // TODO: Add any constructor code after InitializeComponent call  
            //  
        } 

 

 

 

The report viewer window does appear but is blank.  What am I missing?

Thanks,
-Sid Meyers.

 

 

 

 

 

 

 

Sid
Top achievements
Rank 1
 answered on 18 Jun 2009
1 answer
103 views
Hi,

I have a web app developed using Visual Web studio 2008 express.  I have installed your Telerik Reports Trial version but i do not see the templates needed to get me started with your reports.


Brian

Steve
Telerik team
 answered on 18 Jun 2009
4 answers
173 views
Was wondering if there is an easy way to bind a dataset to a chart programmatically. Would like to use one of my prebuilt stored procedures without using a strongly typed dataset. Would like to do something like the following. The  last line fails however as the chart1 object does not appear to have a datasource property.

 

SqlConnection connSomsys = new SqlConnection(@"Server=cmdivst004\Jason08;Integrated Security=true;Database=QuoteDB");

 

 

SqlCommand selectChartinfo;

 

selectChartinfo =

new SqlCommand("sprocgetinternationalsales", connSomsys);

 

selectChartinfo.CommandType =

CommandType.StoredProcedure;

 

selectChartinfo.Parameters.AddWithValue(

"@year", 2008);

 

 

SqlDataAdapter adapter6 = new SqlDataAdapter(selectChartinfo);

 

 

DataSet dataSet6 = new DataSet();

 

adapter6.Fill(dataSet6);

 

this.chart1.datasource = dataSet6;

 

Jason
Top achievements
Rank 1
 answered on 17 Jun 2009
3 answers
182 views
Hi

I am new in telerik reporting.how to create and use report in web application
can i use dropdown in telerik report. i need to create dynamic report like when i
passed parameter the report the content of the report will be changed based on data from database

how to i create it ? its Urgnet

Regards

Abdul
Steve
Telerik team
 answered on 17 Jun 2009
1 answer
99 views
Hi,

I'm trying to control what get exported to a csv file an the only way i found is to put it in page header and foter. This is not sutable for me. Does someone know another way?
Steve
Telerik team
 answered on 17 Jun 2009
5 answers
274 views
I am trying to pass a parameter to my data source, but it isn't passing the correct value.  How does my code look below?  Is there a way to debug and use breakpoints when building report classes?

namespace AWS_Reports 
    using System; 
    using System.ComponentModel; 
    using System.Drawing; 
    using System.Windows.Forms; 
    using System.Configuration; 
    using Telerik.Reporting; 
    using Telerik.Reporting.Drawing; 
 
    /// <summary> 
    /// Summary description for MyAccountEstimator. 
    /// </summary> 
    public partial class MyAccountEstimatorStats : Telerik.Reporting.Report 
    { 
        public MyAccountEstimatorStats() 
        { 
            /// <summary> 
            /// Required for telerik Reporting designer support 
            /// </summary> 
            InitializeComponent(); 
 
            // Remove the design time data source to force use of NeedDataSource event 
            this.DataSource = null
            lstSummary.DataSource = null
        } 
 
        private void MyAccountEstimatorStats_NeedDataSource(object sender, EventArgs e) 
        { 
            // Try to get connection string from config file 
            ConnectionStringSettings cnStr = cnStrSettings(); 
            if ((cnStr != null) && (cnStr.ConnectionString != null)) 
            { 
                this.dsEstimatorUsageDetailsTableAdapter1.Connection.ConnectionString = cnStrSettings().ConnectionString; 
            } 
            try 
            { 
                this.dsEstimatorUsageDetailsTableAdapter1.Fill(this.dsEstimatorUsage.dsEstimatorUsageDetailsTable, StartDate, EndDate); 
                this.DataSource = this.dsEstimatorUsage; 
                this.DataMember = "dsEstimatorUsageDetailsTable"
            } 
            catch (System.Exception ex) 
            { 
                // An error has occurred while filling the data set. Please check the exception for more information. 
                System.Diagnostics.Debug.WriteLine(ex.Message); 
            } 
        } 
 
        private void lstSummary_NeedDataSource(object sender, EventArgs e) 
        { 
            // Try to get connection string from config file 
            ConnectionStringSettings cnStr = cnStrSettings(); 
            if ((cnStr != null) && (cnStr.ConnectionString != null)) 
            { 
                this.prWEP_MyAccountUsageTotalsTableAdapter1.Connection.ConnectionString = cnStrSettings().ConnectionString; 
            } 
            try 
            { 
                 
                this.prWEP_MyAccountUsageTotalsTableAdapter1.Fill(this.dsEstimatorUsage.prWEP_MyAccountUsageTotals, StartDate, EndDate); 
                this.lstSummary.DataSource = this.dsEstimatorUsage; 
                this.lstSummary.DataMember = "prWEP_MyAccountUsageTotals"
            } 
            catch (System.Exception ex) 
            { 
                // An error has occurred while filling the data set. Please check the exception for more information. 
                System.Diagnostics.Debug.WriteLine(ex.Message); 
            } 
        } 
 
        private ConnectionStringSettings cnStrSettings() 
        { 
            // Get connection string from web.config 
            ConnectionStringSettings connStrSettings = ConfigurationManager.ConnectionStrings["AnchorWallConnectionString"]; 
            return connStrSettings; 
        } 
        public DateTime StartDate 
        { 
            get { return DateTime.Parse(this.ReportParameters["StartDate"].Value.ToString()); } 
 
            set { this.ReportParameters["StartDate"].Value = value; } 
        } 
 
        public DateTime EndDate 
        { 
            get { return DateTime.Parse(this.ReportParameters["EndDate"].Value.ToString()); } 
 
            set { this.ReportParameters["EndDate"].Value = value; } 
        } 
 
    } 

Steve
Telerik team
 answered on 17 Jun 2009
5 answers
218 views
Hi,
Lets suppose that Region consists of multiple Areas
I have two reports: RegionReport and AreaReport that I would like to combine into one report book.
RegionReport takes one non-mergable parameter, integer - regionId, that I use in NeedDataSoruce in my db query.

In my report book I am trying to achieve the following:
RegionReport - ie California
AreaReport - Sacramento
AreaReport - LA
RegionReport - ie Texas
AreaReport - Dallas
AreaReport - Huston

To achieve this I construct the report book in the following way:
reportBook = new ReportBook(); 
for (int i = 0; i < regionList.Count; i++) 
    RegionReport regionReport = new RegionReport(); 
    regionReport.ReportParameters["RegionId"].Value = regionList[j]; 
    reportBook.Reports.Add(regionReport); 
    for (int j = 0; j < areaList.Count; j++) 
    { 
        AreaReport areaReport = new AreaReport(); 
        areaReport.ReportParameters["AreaId"].Value = areaList[j]; 
        reportBook.Reports.Add(areaReport); 
    } 

When processing the reports, in NeedDataSource event, the value for the RegionId paramenter in the following code is always of the last value added. In other words it is not preserved from one RegionReport to another.
private void RegionReport_NeedDataSource(object sender, EventArgs e) 
    Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender; 
    //If I had two RegionReport reports added to the book, RegionId parameter's value would be always of the last one added. 
    int paramConvert.ToInt16(this.ReportParameters["RegionId"].Value); 
    ... 
 

What is the proper way of preserving individual reports paramenters' values in a report book ?
Thank you
Pawel Mozdzen
Steve
Telerik team
 answered on 17 Jun 2009
1 answer
173 views
Hi all,

in the project that I making there's a part with reports, I found all that I need in telerik reports except the Radar Chart (I mean a chart like the radar type of Excel)

Do you think to implement it in future ?

If I create a new kind of chart, have you any advice for me ?

Thanks in advance

Alessandro
Steve
Telerik team
 answered on 16 Jun 2009
2 answers
96 views
Hello there,

my problem is the following:

I have a report with some grouped data. This can (and will be) filtered with the report parameters, now, at the end of the report, I want to show a chart based on the information displayed above... I'm using Telerik Reporting Q2 2008. But I can't achieve to get only the data displayed, and grouped, so I can use it to set the chart datasource on the "need datasource" event handler.

Any thoughts?

Thanks in advance,

Sandro Martins
Sandro
Top achievements
Rank 1
 answered on 16 Jun 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?