// Specifying the assembly qualified name of the Report class for the TypeName of the report source<
br
>
ViewerReportSource = new TypeReportSource {TypeName = selectedReport.ReportType.AssemblyQualifiedName};<
br
><
br
>
// create instance of report
<
br
>var report = (Report)Activator.CreateInstance(selectedReport.ReportType);
<
br
><
br
>
// Set filters (datasource params)<
br
>
var ds = report.DataSource as SqlDataSource;<
br
>
ds.Parameters["@UserID"].Value = 999;
OK I have looked in the docs to no avail.
Take a look at the attached files. What I want to do is get the value that is in the first section Total
(This is a group footer section in Telerik) in the example the value is 81 and I want to show this value in the report footer section. I want to do the same thing for the next group. Things work great when used under the group, and for the entire report SUM() works but how would I display a group value that is the result of a SUM() on the group in the report footer?
I’m sure this can’t be hard but can’t seem to find the info on what to put into the text box value.
I was thinking it might be something like value = MyReport. sectionNamesGroupFooter(0). Sum(Fields.Count) or something with the 0 representing the first group if I wanted the value of the second group I would use value = MyReport. sectionNamesGroupFooter(1). Sum(Fields.Count)
Thanks
public
partial
class
Report : Telerik.Reporting.Report
{
public
Report()
{
InitializeComponent();
for
(
int
i = 0; i < 3; ++i)
{
Panel panel =
new
Panel()
{
Docking = DockingStyle.Top,
};
for
(
int
j = 0; j < 2; ++j)
{
panel.Items.Add(GetPanel(j));
}
this
.detail.Items.Add(panel);
}
this
.detail.Items[0].Style.BackgroundColor = Color.LightBlue;
this
.detail.Items[1].Style.BackgroundColor = Color.LightCoral;
this
.detail.Items[2].Style.BackgroundColor = Color.LightCyan;
}
private
Panel GetPanel(
int
i)
{
Panel panel =
new
Panel()
{
Docking = DockingStyle.Top,
};
TextBox textBox1 =
new
TextBox()
{
Docking = DockingStyle.Left,
Location =
new
PointU(Unit.Mm(0D), Unit.Mm(0D)),
Size =
new
SizeU(Unit.Mm(50D), Unit.Mm(0D)),
Value = i +
" - Text Box"
};
panel.Items.Add(textBox1);
TextBox textBox2 =
new
TextBox()
{
Docking = DockingStyle.Fill,
Location =
new
PointU(Unit.Mm(50D), Unit.Mm(0D)),
Size =
new
SizeU(Unit.Mm(124D), Unit.Mm(0D)),
Value = i +
" - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eleifend, dolor ac posuere sollicitudin, nisl nisl hendrerit odio, at pulvinar orci odio vitae ante. Phasellus sapien neque, dignissim nec libero id, iaculis fermentum risus. Aliquam erat volutpat. Praesent mattis lorem vel vulputate fringilla. Donec posuere dui vel nisi egestas, sit amet egestas sapien accumsan. Nullam vehicula ac eros sit amet congue. Integer gravida dolor sit amet justo ultricies, ac euismod nisi auctor. Proin et sem laoreet, sollicitudin ipsum sed, pharetra quam. Sed dapibus, erat in hendrerit tincidunt, dui arcu lacinia mi, maximus ullamcorper purus diam ac nisl. Nunc pulvinar ante vel semper posuere. Ut in pretium sapien. Interdum et malesuada fames ac ante ipsum primis in faucibus. Ut sit amet egestas sem. Duis faucibus libero turpis, sit amet finibus nisl hendrerit nec. "
};
panel.Items.Add(textBox2);
return
panel;
}
}