Telerik Forums
Reporting Forum
5 answers
277 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
231 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
185 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
100 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
2 answers
217 views
Hi,

I have created report which has 9 columns. When we export report to pdf, it span into two pages.
Also content of second page is not correct. How can I fix this problem?
Thanks
deniz dogan
Top achievements
Rank 1
 answered on 16 Jun 2009
2 answers
99 views
Hi,

when installing Telerik Reporting (2009 1.430), error occurred while creating AdventureWorks sample database in SQL 2008 Server. I have tested 2005 express edition of SQL Server and no problems here. It's not important to me, but i have to inform you ;)

Here's some screens:

http://img.exi.cz/2009-06-15_153528.png 
http://img.exi.cz/2009-06-15_153708.png 
http://img.exi.cz/2009-06-15_153720.png 
Exi
Top achievements
Rank 2
 answered on 16 Jun 2009
2 answers
95 views
2009
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
9594.87 103953.72 179878.33 203858.25 203858.25 203858.25 203858.25 203858.25 203858.25 203858.25 203858.25 203858.25
2008
48153.11 87841.04 121103.93 202901.28 296412.69 386817.25 417947.51 484336.18 558378.62 613637.20 687241.44 775677.05
2007
11231.50 86035.03 142648.52 153140.55 177044.63 241382.13 269270.28 293658.40 401262.78 430936.81 555276.89 655150.96
Trying to convert this series of gridviews to one report in telerik. Was wondering what would be the best way to display this data in a telerik report would be as I am a newbie. The listing of the years in the first column are fed by a stored proc. Each row of totals is essentially is a gridview which is also fed by their own individual stored proc. Like I said, I am new to this but was thinking that either a table or cross tab controls would be the way to do this. (Or a series of...) The databinding is an issue i am dealing with as well.Any suggestions would be greatly appreciated.

Jason   
Jason
Top achievements
Rank 1
 answered on 15 Jun 2009
2 answers
383 views
Dear All,
              I am developing a windows application. So here I need to generate a report which have dynamic columns. The problem in crystal reporti is based on design time. So how about telerik report is it design time or run time ? Thank you.
suk
Top achievements
Rank 1
 answered on 15 Jun 2009
1 answer
144 views
does telerik reports on a web page print direct to a printer on client machine progmatically? the user prints a batch of 6 reports at a time and the batch gets run about 200 times a day. So I want to print the report straight to a printer and NOT VIEW IT first?
Steve
Telerik team
 answered on 15 Jun 2009
2 answers
64 views
I'm sure this is an easy one.

I have a report with pictures added at design time.
Some pictures need to be hidden depending on field values.

e.g. iif(Fields.Freq=2, hide-Pic-1, hide-pic-2)

How's this done?

Cheers,
Gary

Gary Robson
Top achievements
Rank 1
 answered on 15 Jun 2009
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?