Telerik Forums
Reporting Forum
1 answer
193 views
Hi,

I have a table in wich the datasource is loaded in the NeedDataSource event.  It's using a Stored Procedure wich requires as parameter a value that is available in the main report.  How do I access this value ?

I want to either get the value of textbox txtIndividualId or the field IndividualId from the Reports datasource...

Thanks

private void MyTable_NeedDataSource(object sender, EventArgs e)  
{  
    SqlCommand sqlSelectCommand = new SqlCommand  
                                      {  
                                            CommandText = "SP_MyStoredProc",  
                                            Connection = new SqlConnection {ConnectionString = ConnectionString},  
                                            CommandType = CommandType.StoredProcedure  
                                      };  
    sqlSelectCommand.Parameters.Add("@individualId", SqlDbType.Int);  
    sqlSelectCommand.Parameters["@individualId"].Value = txtIndividualId.Value; //This is incorrect  
      
    Telerik.Reporting.Processing.Table tbl = (Telerik.Reporting.Processing.Table)sender;  
    tbl.DataSource = new SqlDataAdapter { SelectCommand = sqlSelectCommand };  
}  
 
Steve
Telerik team
 answered on 17 Nov 2009
1 answer
124 views
I'm having an issue when exporting a report to pdf. The Pie chart mirrors itself. Any ideas?
Steve
Telerik team
 answered on 17 Nov 2009
1 answer
125 views
Hi,

My question is does Telerik Report can use LINQ like integrated Datasource ?

Z. Rusev
Steve
Telerik team
 answered on 16 Nov 2009
0 answers
108 views

Hi,
 I want to print the telerik report from command line instead of using the
Print icon provided on Reportviewer toolbar. Please let me know if it is possible to
print telerik report from command line.

Thank you,
Anita.

anita T
Top achievements
Rank 1
 asked on 16 Nov 2009
4 answers
171 views
Hi,

I'm trying to make subreports visible programmatically with a parameter in the _NeedDataSource event.  This is the code I am using:

            foreach (string filterRow in showHide) 
            { 
                switch(filterRow) 
                { 
                    case "10": 
                        this.textBoxEventTotals.Visible = true
                        this.subReportCommunityEventTotals.Visible = true
                        this.subReportCommunityEventTotals.Report.Visible = true
                        break; 
                    case "20": 
                        this.textBoxEventTotalsByDate.Visible = true
                        this.subReportCommunityEventTotalsByDate.Visible = true
                        this.subReportCommunityEventTotalsByDate.Report.Visible = true
                        break; 
                    case "30": 
                        this.textBoxTotalsByCommunity.Visible = true
                        this.subReportCommunityEventTotalsByCommunity.Visible = true
                        this.subReportCommunityEventTotalsByCommunity.Report.Visible = true
                        break; 
                    case "40": 
                        this.textBoxCommunityAndDate.Visible = true
                        this.subReportCommunityEventsByCommunityAndDate.Visible = true
                        this.subReportCommunityEventsByCommunityAndDate.Report.Visible = true
                        break; 
                    case "50": 
                        this.textBoxDetails.Visible = true
                        this.subReportCommunityEventDetails.Visible = true
                        this.subReportCommunityEventDetails.Report.Visible = true
                        break; 
                } 
            } 
        } 
 

The visibility of everything is set to false.  I don't seem to be able to get to the inner report of my subreport controls. Changing the visiblity of the subreport controls and text boxes works fine.  What am I doing wrong?

I know it sounds a little strange but in the subreport I was going to bail out of getting the data if the subreport wasn't visible.  That's why I want to make the subreport invisible not just the subreport control....

Thanks,
Darren
Darren
Top achievements
Rank 1
 answered on 16 Nov 2009
0 answers
97 views
Hi,
I'm using version 2009 Q3 to create a report and render it as a PDF file.
The report has a table on it. Below that table is a sub report.
In the designer the sub report is straight below the table, but in run time the sub report starts on a new page.
I've set Keep together to false on both the sub report and on the table. I also set page breaks to None, but still this happens.
Is there a way to get the sub report on the same page the table is?
Naphtali
Naphtali
Top achievements
Rank 1
 asked on 16 Nov 2009
1 answer
994 views
Hello,

Please could somebody point me in the direction of sample code for this? I want my users to be able to select a command link or button from an asp.net page which will download a report straight to PDF.

Many thanks, Carl
Steve
Telerik team
 answered on 16 Nov 2009
1 answer
689 views
I have downloaded a trial version for using in my application.
datasource need to be bind on runtime and should change on change of a dropdownlist
this is what my classlibrarylooks alike:

namespace

ClassLibrary1

 

{

 

using System;

 

 

using System.Data;

 

 

using System.ComponentModel;

 

 

using System.Drawing;

 

 

using System.Windows.Forms;

 

 

using Telerik.Reporting;

 

 

using Telerik.Reporting.Drawing;

 

 

/// <summary>

 

 

/// Summary description for Report1.

 

 

/// </summary>

 

 

public partial class Report1 : Telerik.Reporting.Report

 

{

 

public string constr;

 

 

public Report1(string cnstr)

 

{

 

/// <summary>

 

 

/// Required for telerik Reporting designer support

 

 

/// </summary>

 

InitializeComponent();

System.Data.OleDb.

OleDbConnection cn = new System.Data.OleDb.OleDbConnection();

 

System.Data.OleDb.

OleDbCommand cmd = new System.Data.OleDb.OleDbCommand();

 

System.Data.OleDb.

OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter();

 

 

DataTable dt = new DataTable();

 

cn.ConnectionString = cnstr;

constr = cnstr;

cmd.CommandText =

"Select * from company";

 

cmd.Connection = cn;

da.SelectCommand = cmd;

da =

new System.Data.OleDb.OleDbDataAdapter("Select * from company", cnstr);

 

 

this.DataSource = da;

 

 

}

 

 

private void Report1_NeedDataSource(object sender, System.EventArgs e)

 

{

 

string sql =

 

 

@"Select * from company";

 

 

//da.SelectCommand = new System.Data.OleDb.OleDbCommand(sql);

 

System.Data.OleDb.

OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter(sql,constr);

 

 

 

DataSet dataSet = new DataSet();

 

da.Fill(dataSet);

(sender

as Telerik.Reporting.Processing.Report).DataSource = dataSet;

 

}

 

private void textBox2_ItemDataBound(object sender, EventArgs e)

 

{

Telerik.Reporting.Processing.

TextBox txtPosition = (Telerik.Reporting.Processing.TextBox)sender;

 

 

if (txtPosition.Text.Contains("Developer"))

 

{

txtPosition.Style.BackgroundColor =

Color.Blue;

 

}

}

 

}

}

this is how designer code looks :

 

namespace

ClassLibrary1

 

{

 

using System.ComponentModel;

 

 

using System.Drawing;

 

 

using System.Windows.Forms;

 

 

using Telerik.Reporting;

 

 

using Telerik.Reporting.Drawing;

 

 

partial class Report1

 

 

 

{

 

 

#region

Component Designer generated code

 

 

/// <summary>

 

 

 

 

/// Required method for telerik Reporting designer support - do not modify

 

 

 

 

/// the contents of this method with the code editor.

 

 

 

 

/// </summary>

 

 

 

 

private void InitializeComponent()

 

{

Telerik.Reporting.Drawing.

StyleRule styleRule1 = new Telerik.Reporting.Drawing.StyleRule();

 

Telerik.Reporting.Drawing.

StyleRule styleRule2 = new Telerik.Reporting.Drawing.StyleRule();

 

Telerik.Reporting.Drawing.

StyleRule styleRule3 = new Telerik.Reporting.Drawing.StyleRule();

 

Telerik.Reporting.Drawing.

StyleRule styleRule4 = new Telerik.Reporting.Drawing.StyleRule();

 

 

this.dataSet = new ClassLibrary1.DataSet();

 

 

this.labelsGroupHeader = new Telerik.Reporting.GroupHeaderSection();

 

 

this.labelsGroupFooter = new Telerik.Reporting.GroupFooterSection();

 

 

this.labelsGroup = new Telerik.Reporting.Group();

 

 

this.pageHeader = new Telerik.Reporting.PageHeaderSection();

 

 

this.reportNameTextBox = new Telerik.Reporting.TextBox();

 

 

this.pageFooter = new Telerik.Reporting.PageFooterSection();

 

 

this.currentTimeTextBox = new Telerik.Reporting.TextBox();

 

 

this.pageInfoTextBox = new Telerik.Reporting.TextBox();

 

 

this.reportHeader = new Telerik.Reporting.ReportHeaderSection();

 

 

this.titleTextBox = new Telerik.Reporting.TextBox();

 

 

this.detail = new Telerik.Reporting.DetailSection();

 

 

this.dataSetTableAdapter1 = new ClassLibrary1.DataSetTableAdapters.DataSetTableAdapter();

 

 

this.textBox1 = new Telerik.Reporting.TextBox();

 

((System.ComponentModel.

ISupportInitialize)(this.dataSet)).BeginInit();

 

((System.ComponentModel.

ISupportInitialize)(this)).BeginInit();

 

 

//

 

 

 

 

// dataSet

 

 

 

 

//

 

 

 

 

this.dataSet.DataSetName = "DataSet";

 

 

this.dataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;

 

 

//

 

 

 

 

// labelsGroupHeader

 

 

 

 

//

 

 

 

 

this.labelsGroupHeader.Height = new Telerik.Reporting.Drawing.Unit(0.28125, Telerik.Reporting.Drawing.UnitType.Inch);

 

 

this.labelsGroupHeader.Name = "labelsGroupHeader";

 

 

this.labelsGroupHeader.PrintOnEveryPage = true;

 

 

//

 

 

 

 

// labelsGroupFooter

 

 

 

 

//

 

 

 

 

this.labelsGroupFooter.Height = new Telerik.Reporting.Drawing.Unit(0.28125, Telerik.Reporting.Drawing.UnitType.Inch);

 

 

this.labelsGroupFooter.Name = "labelsGroupFooter";

 

 

this.labelsGroupFooter.Style.Visible = false;

 

 

//

 

 

 

 

// labelsGroup

 

 

 

 

//

 

 

 

 

this.labelsGroup.Bookmark = null;

 

 

this.labelsGroup.GroupFooter = this.labelsGroupFooter;

 

 

this.labelsGroup.GroupHeader = this.labelsGroupHeader;

 

 

//

 

 

 

 

// pageHeader

 

 

 

 

//

 

 

 

 

this.pageHeader.Height = new Telerik.Reporting.Drawing.Unit(0.28125, Telerik.Reporting.Drawing.UnitType.Inch);

 

 

this.pageHeader.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {

 

 

this.reportNameTextBox});

 

 

this.pageHeader.Name = "pageHeader";

 

 

//

 

 

 

 

// reportNameTextBox

 

 

 

 

//

 

 

 

 

this.reportNameTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch));

 

 

this.reportNameTextBox.Name = "reportNameTextBox";

 

 

this.reportNameTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(6.4166665077209473, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224, Telerik.Reporting.Drawing.UnitType.Inch));

 

 

this.reportNameTextBox.StyleName = "PageInfo";

 

 

this.reportNameTextBox.Value = "Report1";

 

 

//

 

 

 

 

// pageFooter

 

 

 

 

//

 

 

 

 

this.pageFooter.Height = new Telerik.Reporting.Drawing.Unit(0.28125, Telerik.Reporting.Drawing.UnitType.Inch);

 

 

this.pageFooter.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {

 

 

this.currentTimeTextBox,

 

 

this.pageInfoTextBox});

 

 

this.pageFooter.Name = "pageFooter";

 

 

//

 

 

 

 

// currentTimeTextBox

 

 

 

 

//

 

 

 

 

this.currentTimeTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch));

 

 

this.currentTimeTextBox.Name = "currentTimeTextBox";

 

 

this.currentTimeTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(3.1979167461395264, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224, Telerik.Reporting.Drawing.UnitType.Inch));

 

 

this.currentTimeTextBox.StyleName = "PageInfo";

 

 

this.currentTimeTextBox.Value = "=NOW()";

 

 

//

 

 

 

 

// pageInfoTextBox

 

 

 

 

//

 

 

 

 

this.pageInfoTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(3.2395832538604736, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505, Telerik.Reporting.Drawing.UnitType.Inch));

 

 

this.pageInfoTextBox.Name = "pageInfoTextBox";

 

 

this.pageInfoTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(3.1979167461395264, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224, Telerik.Reporting.Drawing.UnitType.Inch));

 

 

this.pageInfoTextBox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right;

 

 

this.pageInfoTextBox.StyleName = "PageInfo";

 

 

this.pageInfoTextBox.Value = "=PageNumber";

 

 

//

 

 

 

 

// reportHeader

 

 

 

 

//

 

 

 

 

this.reportHeader.Height = new Telerik.Reporting.Drawing.Unit(0.80823493003845215, Telerik.Reporting.Drawing.UnitType.Inch);

 

 

this.reportHeader.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {

 

 

this.titleTextBox});

 

 

this.reportHeader.Name = "reportHeader";

 

 

//

 

 

 

 

// titleTextBox

 

 

 

 

//

 

 

 

 

this.titleTextBox.Name = "titleTextBox";

 

 

this.titleTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(6.4583334922790527, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.78740161657333374, Telerik.Reporting.Drawing.UnitType.Inch));

 

 

this.titleTextBox.StyleName = "Title";

 

 

this.titleTextBox.Value = "Report1";

 

 

//

 

 

 

 

// detail

 

 

 

 

//

 

 

 

 

this.detail.Height = new Telerik.Reporting.Drawing.Unit(0.28125, Telerik.Reporting.Drawing.UnitType.Inch);

 

 

this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {

 

 

this.textBox1});

 

 

this.detail.Name = "detail";

 

 

//

 

 

 

 

// dataSetTableAdapter1

 

 

 

 

//

 

 

 

 

this.dataSetTableAdapter1.ClearBeforeFill = true;

 

 

//

 

 

 

 

// textBox1

 

 

 

 

//

 

 

 

 

this.textBox1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.19999997317790985, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.081210456788539886, Telerik.Reporting.Drawing.UnitType.Inch));

 

 

this.textBox1.Name = "textBox1";

 

 

this.textBox1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.9000000953674316, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000012218952179, Telerik.Reporting.Drawing.UnitType.Inch));

 

 

this.textBox1.Value = "[=Fields.[Company Name]]";

 

 

//

 

 

 

 

// Report1

 

 

 

 

//

 

 

 

 

this.Groups.AddRange(new Telerik.Reporting.Group[] {

 

 

this.labelsGroup});

 

 

this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {

 

 

this.labelsGroupHeader,

 

 

this.labelsGroupFooter,

 

 

this.pageHeader,

 

 

this.pageFooter,

 

 

this.reportHeader,

 

 

this.detail});

 

 

this.PageSettings.Landscape = false;

 

 

this.PageSettings.Margins.Bottom = new Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch);

 

 

this.PageSettings.Margins.Left = new Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch);

 

 

this.PageSettings.Margins.Right = new Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch);

 

 

this.PageSettings.Margins.Top = new Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch);

 

 

this.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Letter;

 

 

this.Style.BackgroundColor = System.Drawing.Color.White;

 

styleRule1.Selectors.AddRange(

new Telerik.Reporting.Drawing.ISelector[] {

 

 

new Telerik.Reporting.Drawing.StyleSelector("Title")});

 

styleRule1.Style.Color = System.Drawing.

Color.Black;

 

styleRule1.Style.Font.Bold =

true;

 

styleRule1.Style.Font.Italic =

false;

 

styleRule1.Style.Font.Name =

"Tahoma";

 

styleRule1.Style.Font.Size =

new Telerik.Reporting.Drawing.Unit(20, Telerik.Reporting.Drawing.UnitType.Point);

 

styleRule1.Style.Font.Strikeout =

false;

 

styleRule1.Style.Font.Underline =

false;

 

styleRule2.Selectors.AddRange(

new Telerik.Reporting.Drawing.ISelector[] {

 

 

new Telerik.Reporting.Drawing.StyleSelector("Caption")});

 

styleRule2.Style.Color = System.Drawing.

Color.Black;

 

styleRule2.Style.Font.Name =

"Tahoma";

 

styleRule2.Style.Font.Size =

new Telerik.Reporting.Drawing.Unit(11, Telerik.Reporting.Drawing.UnitType.Point);

 

styleRule2.Style.VerticalAlign = Telerik.Reporting.Drawing.

VerticalAlign.Middle;

 

styleRule3.Selectors.AddRange(

new Telerik.Reporting.Drawing.ISelector[] {

 

 

new Telerik.Reporting.Drawing.StyleSelector("Data")});

 

styleRule3.Style.Font.Name =

"Tahoma";

 

styleRule3.Style.Font.Size =

new Telerik.Reporting.Drawing.Unit(11, Telerik.Reporting.Drawing.UnitType.Point);

 

styleRule3.Style.VerticalAlign = Telerik.Reporting.Drawing.

VerticalAlign.Middle;

 

styleRule4.Selectors.AddRange(

new Telerik.Reporting.Drawing.ISelector[] {

 

 

new Telerik.Reporting.Drawing.StyleSelector("PageInfo")});

 

styleRule4.Style.Font.Name =

"Tahoma";

 

styleRule4.Style.Font.Size =

new Telerik.Reporting.Drawing.Unit(11, Telerik.Reporting.Drawing.UnitType.Point);

 

styleRule4.Style.VerticalAlign = Telerik.Reporting.Drawing.

VerticalAlign.Middle;

 

 

this.StyleSheet.AddRange(new Telerik.Reporting.Drawing.StyleRule[] {

 

styleRule1,

styleRule2,

styleRule3,

styleRule4});

 

this.Width = new Telerik.Reporting.Drawing.Unit(6.4583334922790527, Telerik.Reporting.Drawing.UnitType.Inch);

 

((System.ComponentModel.

ISupportInitialize)(this.dataSet)).EndInit();

 

((System.ComponentModel.

ISupportInitialize)(this)).EndInit();

 

}

 

 

#endregion

 

 

 

private GroupHeaderSection labelsGroupHeader;

 

 

private GroupFooterSection labelsGroupFooter;

 

 

private Group labelsGroup;

 

 

private PageHeaderSection pageHeader;

 

 

private Telerik.Reporting.TextBox reportNameTextBox;

 

 

private PageFooterSection pageFooter;

 

 

private Telerik.Reporting.TextBox currentTimeTextBox;

 

 

private Telerik.Reporting.TextBox pageInfoTextBox;

 

 

private ReportHeaderSection reportHeader;

 

 

private Telerik.Reporting.TextBox titleTextBox;

 

 

private DetailSection detail;

 

 

private DataSet dataSet;

 

 

private ClassLibrary1.DataSetTableAdapters.DataSetTableAdapter dataSetTableAdapter1;

 

 

private Telerik.Reporting.TextBox textBox1;

 

}

}

now when i try to use this class from webreport viewer :

 

ClassLibrary1.

Report1 rpt = new ClassLibrary1.Report1(cn.ConnectionString);

 

rpt.constr = cn.ConnectionString;

 

ReportViewer1.Report = rpt;

Viewer shows this twice :

An error has occured while processing TextBox 'textBox1':
Missing operator before Name operand.
An error has occured while processing TextBox 'textBox1':
Missing operator before Name operand.


can you tell me whats going wrong wrong?

Steve
Telerik team
 answered on 16 Nov 2009
1 answer
84 views


hi.

error message :

http://domain.co.kr/Telerik.Report.Viewer.axd?culture=ko-


why korean language does not printed on the papaer even though already press the print button


i can't Print. why error message?
i can't korean language print ???

language : korean



sample source plz..

wingsbox@gmail.com




Steve
Telerik team
 answered on 13 Nov 2009
2 answers
79 views
I watched Evan Hutnick's Webinar today and It's great to see Telerik reporting has made it to Silverlight. The implementation seems to be fairly straight forward. Although, I have several questions about the Communication between the SL Viewer and Report processor, but I'll differ those questions to another post.

However, I have an important question in regards to exporting to XPS.
a) I saw that viewer has a button that the user can select to export to XPS. Is it possible not to show the viewer and through code export that XPS to a local storage? My goal is for the Report processor to create the report, the communication delivers that to SL client, and then I can save it as XPS to show it in my Silverlight app in my own way?
b) If not, is it possible that we can generate the XPS at the service level (Report processor) and then send the XPS to SL client?

Basically, I need a way to show a nicely created XPS report that I can display in my own Silverlight app, rather than Report Viewer?

Thanks!
..Ben
Svetoslav
Telerik team
 answered on 13 Nov 2009
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?