public partial class My_Report : Telerik.Reporting.Report
{
public My_Report()
{
InitializeComponent();
this.DataSource = null;
this.NeedDataSource += new System.EventHandler(this.My_Report_NeedDataSource);
}
private void My_Report_NeedDataSource(object sender, System.EventArgs e)
{
//Transfer the ReportParameter value to the parameter of the select command
this.sqlDataAdapter1.SelectCommand.Parameters["@PersonID"].Value = 8;
this.sqlDataAdapter1.SelectCommand.Parameters["@OperatorID"].Value = 11;
//Take the Telerik.Reporting.Processing.Report instance and set the adapter as it's DataSource
Telerik.Reporting.Processing.
Report report = (Telerik.Reporting.Processing.Report)sender;
report.DataSource =
this.sqlDataAdapter1;
}
}
I have each of my fields in a table referencing in this manner:
=Fields.TaskNumber
I do no receive any errors or anything, so I am looking for some guidance.
Thanks, Mike
More info:
When I added this to my NeedDataSource method:
this.sqlConnection1.Open();
int rows = this.sqlSelectCommand1.ExecuteNonQuery();
rows returns -1, so I am somehow not getting any data back. I removed the parameters from the sproc and just hardcoded them and I still get a return value of -1 in rows. Any ideas?
Dim objMainReport As Telerik.Reporting.Report = New RequestsByDate()
objMainReport.DataSource = dsTemp.Tables(0) '-- table is available here
ReportViewer1.Report = objMainReport
ReportViewer1.DataBind()
I know that it is probably something to do with my RequestsByDate class, but I really have no clue. Any help would be appreciated.
Thanks in advance,
Mark
Public Sub New()
InitializeComponent()
End Sub
Private Sub JobPlan_Frontsheet_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.NeedDataSource
Dim fs As New CPSMDAL.JobPlan
Dim fsDT As DataTable = fs.JobPlanReport(JobPlan_ID)
Me.DataSource = fsDT
End Sub
List
<string> campaignTypes = ReportGenerator.GetCampaignTypes(parameters/metadata goes here..);
int i = 0;
foreach (string campaignType in campaignTypes)
{
ReportParameter rp = new ReportParameter(campaignType, ReportParameterType.String, campaignType);
this.ReportParameters.Add(rp);
this.Report.ReportParameters[i].UI.Text = campaignType;
this.Report.ReportParameters[i].UI.Visible = true;
i = i + 1;
}
So the area in green..this goes ahead and adds 3 parameters (i had 3 items in the list), but the problem is they are all new parameters in textboxes! I wanted to have 3 in one report parameter collection, as a dropdownlist.
I understand there is a reportparametercollection, but I did not see a way to add it to the report. Only to create it and add report items to it. This code is in the constructor of my report, by the way. Any suggestions on how to get the dropdownlist to appear, and have it's datasource as the generic?
Thanks so much!