Telerik Forums
Reporting Forum
0 answers
111 views
Cancel
Philip
Top achievements
Rank 1
 asked on 12 Mar 2009
3 answers
185 views
I am trying to create a report which will basically show data in groups. But the thing is that for each group the data to display might vary, both in columns and rows. This is why I can not design a Details Section at the Design-Time. While starting to process each group I am converting the necessary data while the groupHeader is being bound with:

private void groupHeaderSection4_ItemDataBound(object sender, EventArgs e) 
{ 
    Telerik.Reporting.Processing.GroupSection dtl = (Telerik.Reporting.Processing.GroupSection)sender; 
    sectionsData = ConvertToDataTable(dtl); 
} 
which is OK. But after getting this re-constructed DataTable I want to design the Details Section of the Group according to the DataTable returned; which basically means to create columns and rows manually.

To create a custom grid on the fly I am trying to create TextBoxes and manually design them. This is where it gets stuck. I am doing this while binding data to the Details Section as:
private void detail_ItemDataBinding(object sender, EventArgs e) 
{ 
    Telerik.Reporting.Processing.DetailSection dtl = (Telerik.Reporting.Processing.DetailSection)sender; 
    dtl.Items.Clear(); 
    ProcessingBindColumnNames(dtl); 
} 
 
protected void ProcessingBindColumnNames(Telerik.Reporting.Processing.DetailSection dtl) 
{ 
    double columnWidth = (double)(Convert.ToDouble(dtl.Width) - Convert.ToDouble(tbDurumWidth)) / (sectionsData.Columns.Count - 1); 
    tbColumnWidth = new Telerik.Reporting.Drawing.Unit(columnWidth, UnitType.Cm); 
    for (int c = 0; c < sectionsData.Columns.Count - 1; c++) 
    { 
        Telerik.Reporting.Processing.TextBox tb = new Telerik.Reporting.Processing.TextBox(); 
    } 
} 
But at the line 14 I am getting "The Type 'Telerik.Reporting.Processing.TextBox' has no constructors defined".

How can I create a TextBox while binding the Group Details Section and why this item has no constructor but Intellisense brings me one when I type new?

Regards.
Steve
Telerik team
 answered on 12 Mar 2009
1 answer
141 views
Hi, I have a development pc with Vista Business x64 with Sp1, Visual Studio 2008 Team System Test Edition  with SP1.  Both are spanish editions.  I have downloaded and installed the latest version of Telerik Reporting (2008_3_1105).

Everytime I open the designer I cannot longer use the accent keys from my keyboard, like á,é,í,ó,ú.   Instead, when I press the accent key it writes ´´ (double accent).  This particular issue happens in any program  like notepad, word, or visual studio 2008.  When I close the visual studio tab that contains the report designer, or even if I swith to another tab, the problem dissapears. 

So, right know I have to write  the value of  textblocks  in notepad and paste them into  the textbox value from the designer.

Regards,

Ramón.
Steve
Telerik team
 answered on 12 Mar 2009
5 answers
174 views
Hi Support,

I've a table-like text boxes which the text inside displays in 90 degree angle. It works fine when it's in Q2 2008. But, after I've upgraded it to Q3 2008, the text angle is just not working any more.

Is it something wrong with a new release or do I miss something?

Thanks very much,
Sandy
Thomas Salt
Top achievements
Rank 1
 answered on 12 Mar 2009
1 answer
169 views
Hi, we are evaluating Telerik Reporting, and have come across a few problems using the Chart.

First what I'm trying to accomplish:
A simple barchart, where the data is DateTime on the x-axis and integer og the y-axis.
The chart must also display Time in a realistic matter. 
The code is in the chart1_NeedDataSource(..,..) eventhandler.

When I am binding an ArrayList with approx 40 items the report takes about 2 seconds to render.
However if the ArrayList is 250 items the report takes about 45 seconds!! to render.
If I set the x-axis labels manually to empty strings it seems to go about a few seconds faster.

The ArrayList contains a custom class with 2 properties with datatypes DateTime and Integer.
For instance if I originally have an ArrayList with only 2 items, and the datetimes are yy-mm-dd 09:45:00 and yy-mm-dd 09:57:00
then i create an ArrayList with all the minutes between 45 and 57 (Integer=0), and thus have an ArrayList with 13 items.

Retrieving data and manipulating ArrayList takes basically no time at all.

How I bind:
al = db.getChartData();
//al = fillEmptyMinutes(al);   //
((Telerik.Reporting.Processing.Chart)sender).DataSource = al;

Telerik.Reporting.Processing.Chart chartItem = sender as Telerik.Reporting.Processing.Chart;
Telerik.Reporting.Chart chart = (Telerik.Reporting.Chart)chartItem.ItemDefinition;


chart1.Series[0].PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 270;
            
//chart.PlotArea.XAxis.AutoScale = false;
//chart.PlotArea.XAxis.AutoShrink = false;
//chart.PlotArea.XAxis.Clear();
//for (int i = 0; i < al.Count; i++)
//{
    //  chart.PlotArea.XAxis.AddItem(" ");
//}


Is the another more effecient way to display time-data like this?
In a perfect world I just want to send in the original ArrayList and set for instance
chart.Series[0].XAxis.DataType = DateTime; // or even DateTime.Minutes
Are there some other properties on the chart that can improve renderingtime?

I am using Q3 2008-version

Regards, John Pedersen



Steve
Telerik team
 answered on 12 Mar 2009
2 answers
337 views
I have a report generated by Telerik reporting that I'd like to concatenate to PDF data that I have created in another tool.  I've tried to merge the two PDF's by just concatenating the byte array data from each, but that does not appear to work.  I can write both files to separate browser windows, but need to combine them.  Any solution with Telerik reporting?

Scott
Top achievements
Rank 1
 answered on 11 Mar 2009
1 answer
328 views
Hi

I have created a report and created parameters. Date From, Date To, Reference
One of the parameters is a reference code which I have in a class collection and set the parameter datasource to be this.
this work fine but only allows me to select one reference at a time and the user may want to display all references.
E.g. All references between 2 dates. is this Possible?

The code below is what I use.

                //Now add the references to the reference class...  
                while (referenceReader.Read())  
                {  
                    references.Add(new References( referenceReader["Reference"].ToString()));  
                }  
 
                this.ReportParameters["Reference"].UI.AvailableValues.DataSource = references;  
                this.ReportParameters["Reference"].UI.AvailableValues.DataMember = "Reference";  
                this.ReportParameters["Reference"].UI.AvailableValues.ValueMember = "Reference";  
 


I have a function that opens the database and fills the report data into a class list as per documentation. I do the same with the reference for the parameter. This way I can get all the relevant data and close he connection to SQL down. The report then uses the data in the classes
            List<Receipts> receipts = new List<Receipts>();  
            List<References> references = new List<References>();  
 

I have also tried this using the ArrayList method. This works better in that it allows me to usse all references. The problem is you can delete them and then there appears to be now way or returning the list unless you reopen the report.

Thanks

Gary
Steve
Telerik team
 answered on 11 Mar 2009
2 answers
151 views
Hi.. 
Again Suriya..,

           Thanks about the clarification about the retrivng the parameter value in the report....

Now i have doubt in displaying "No Records Found" in the web form
 when the reportviewer is empty in the run time..


              By
S.Suriya
Suriya
Top achievements
Rank 1
 answered on 11 Mar 2009
1 answer
139 views
Dear Sir,

I have a problem to acces values on my main report in order to send it to my sub-report.
I have a main report where i display list of colors.
And i have a generic sub-report to display for comments for each color.

So the only problem that i'm facing is to acces the value of "Color Id" and send it to the sub-report.
I tried to access the textbox called "txtColorId" in order to get the value of the actual printed "Color Id" but i didn't succeed.

Is there any way to solve this issue ?
Thank you,

Regards
Pierre


The output of my report should looks like the following:

REPORT TITLE

Color Id        Color Code                Description        
1                    BLUE                           Blue description

        Comments    
        1.    This is a first line of comments for color Blue
        2.    This is a second line of comments for color Blue
        3.    This is a third line of comments for color Blue


2                    GREEN                        Green description

        Comments    
        1.    These are my only comments for color Green


3                    YELLOW                      Yellow description

        Comments    
        not available



Here's my code for the Main report (Color):

namespace

 

Production_Specs_Report.Public

 

{

 

using System;

 

 

using System.ComponentModel;

 

 

using System.Drawing;

 

 

using System.Windows.Forms;

 

 

using Telerik.Reporting;

 

 

using Telerik.Reporting.Drawing;

 

 

using System.Data;

 

 

/// <summary>

 

 

/// Summary description for Report1.

 

 

/// </summary>

 

 

public partial class rptSpecsColor : Telerik.Reporting.Report

 

{

 

private int _SpecsHeaderId;

 

 

private int _RevisionNumber;

 

 

private bool _PrintComment;

 

 

private bool _PrintUdfValue;

 

 

public int SpecsHeaderId

 

{

 

get

 

{

 

return _SpecsHeaderId;

 

}

 

set

 

{

_SpecsHeaderId =

value;

 

}

}

 

public int RevisionNumber

 

{

 

get

 

{

 

return _RevisionNumber;

 

}

 

set

 

{

_RevisionNumber =

value;

 

}

}

 

public bool PrintComment

 

{

 

get

 

{

 

return _PrintComment;

 

}

 

set

 

{

_PrintComment =

value;

 

}

}

 

public bool PrintUdfValue

 

{

 

get

 

{

 

return _PrintUdfValue;

 

}

 

set

 

{

_PrintUdfValue =

value;

 

}

}

 

public void ExecuteReport()

 

{

 

// -----------------------------------------------------------------------------------

 

 

// Get all Colors

 

 

// -----------------------------------------------------------------------------------

 

 

DataSet ds = new DataSet();

 

Production_Specs_WS.

Service v_service = new Production_Specs_WS.Service();

 

ds = v_service.GetSpecsColor(

this.SpecsHeaderId, this.RevisionNumber);

 

 

this.DataSource = ds;

 

 

 

// -----------------------------------------------------------------------------------

 

 

// Call to my subreport: Comments

 

 

// -----------------------------------------------------------------------------------

 

 

// If the user specify to print Comments for Specs Color

 

 

if (this.PrintComment == true)

 

{

Production_Specs_Report.Public.

rptSpecsComment v_rpt2 = new Production_Specs_Report.Public.rptSpecsComment();

 

v_rpt2.ReportTitle =

"Comments title";

 

v_rpt2.InformationType =

"101";

 

v_rpt2.RevisionNumber =

this.RevisionNumber;

 

v_rpt2.SpecsHeaderId = Convert.ToInt32(txtColorId.Value); 

-------------------------->  Here i'm getting a problem 
v_rpt2.ExecuteReport();

 

 

if (v_rpt2.DisplayReportIfNoData == true)

 

{

subReportSpecsComment.ReportSource = v_rpt2;

}

 

else

 

{

subReportSpecsComment.Visible =

false;

 

}

v_rpt2 =

null;

 

}

 

else

 

{

subReportSpecsComment.Visible =

false;

 

}

 

}

 

public rptSpecsColor()

 

{

 

/// <summary>

 

 

/// Required for telerik Reporting designer support

 

 

/// </summary>

 

InitializeComponent();

 

//

 

 

// TODO: Add any constructor code after InitializeComponent call

 

 

//

 

 

// Only for test

 

 

this.PrintComment = true;

 

 

this.RevisionNumber = -1;

 

 

this.SpecsHeaderId = 2;

 

 

this.ExecuteReport();

 

}

 

}

}


Here's my code for Subreport (Comments):

namespace

 

Production_Specs_Report.Public

 

{

 

using System;

 

 

using System.ComponentModel;

 

 

using System.Drawing;

 

 

using System.Windows.Forms;

 

 

using Telerik.Reporting;

 

 

using Telerik.Reporting.Drawing;

 

 

using System.Data;

 

 

/// <summary>

 

 

/// Summary description for Report1.

 

 

/// </summary>

 

 

public partial class rptSpecsComment : Telerik.Reporting.Report

 

{

 

private int _SpecsHeaderId;

 

 

private int _RevisionNumber;

 

 

private string _InformationType;

 

 

private string _ReportTitle;

 

 

private bool _DisplayReportIfNoData;

 

 

public int SpecsHeaderId

 

{

 

get

 

{

 

return _SpecsHeaderId;

 

}

 

set

 

{

_SpecsHeaderId =

value;

 

}

}

 

public int RevisionNumber

 

{

 

get

 

{

 

return _RevisionNumber;

 

}

 

set

 

{

_RevisionNumber =

value;

 

}

}

 

public string InformationType

 

{

 

get

 

{

 

return _InformationType;

 

}

 

set

 

{

_InformationType =

value;

 

}

}

 

public string ReportTitle

 

{

 

get

 

{

 

return _ReportTitle;

 

}

 

set

 

{

_ReportTitle =

value;

 

}

}

 

public bool DisplayReportIfNoData

 

{

 

get

 

{

 

return _DisplayReportIfNoData;

 

}

 

set

 

{

_DisplayReportIfNoData =

value;

 

}

}

 

public void ExecuteReport()

 

{

 

// -----------------------------------------------------------------------------------

 

 

// Specs Comment

 

 

// -----------------------------------------------------------------------------------

 

 

DataSet ds = new DataSet();

 

Production_Specs_WS.

Service v_service = new Production_Specs_WS.Service();

 

ds = v_service.GetSpecsComment(

this.SpecsHeaderId, this.RevisionNumber, this.InformationType);

 

 

if (ds.Tables[0].Rows.Count > 0)

 

{

 

this.DataSource = ds;

 

 

if (!string.IsNullOrEmpty(this.ReportTitle))

 

{

 

this.txtReportTitle.Value = this.ReportTitle.ToString();

 

}

 

this.DisplayReportIfNoData = true;

 

}

 

else

 

{

 

this.DisplayReportIfNoData = false;

 

}

}

 

public rptSpecsComment()

 

{

 

/// <summary>

 

 

/// Required for telerik Reporting designer support

 

 

/// </summary>

 

InitializeComponent();

}

 

}

}




Steve
Telerik team
 answered on 11 Mar 2009
1 answer
116 views
I've created a user function in the report class in an attempt to calculate a page number that breaks by group (according to details found in a MSDN post referred to by an earlier thread here).  In short, I pass into my function the field upon whihc my group is based (clientID) and the global value for page number, and sue these values to calculate a new page number.

I then use this function as the expression on a text box in the page footer.

When I view the report I get an error stating that the clientID is not available in that context.

Any ideas on how I can approach this issue?  I'm thinkin that pehaps I can attach to an event on the group and capture the current clientID in a variable that the function would ahve access to?

Any ideas or direction would be helpful.

Thanks
David C
Steve
Telerik team
 answered on 10 Mar 2009
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?