public
class
DashboardController : Controller
{
public
ActionResult Index()
{
var model = data.GetReportData()
return
View(model);
}
}
@(Html.TelerikReporting().ReportViewer()
.Id("reportViewer1")
.ServiceUrl("/api/reports/")
.TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.htmll")
.ReportSource(new TypeReportSource{TypeName="MyReportLibrary, Dashboard"})
.ViewMode(ViewModes.INTERACTIVE)
.ScaleMode(ScaleModes.SPECIFIC)
.Scale(1.0)
.PersistSession(true)
)
private void Report1_ItemDataBound(object sender, EventArgs e)
{
SqlDataAdapter adapter = new SqlDataAdapter();
rep = new reportRepository();
List<ReportViewModel> model = rep.GetData();
// Creating and configuring the ObjectDataSource component:
var objectDataSource = new Telerik.Reporting.ObjectDataSource();
objectDataSource.DataSource = dsConvertion.ToDataSet(model); // GetData returns a DataSet with three tables
objectDataSource.DataMember = "tblFirst"; /// Indicating the exact table to bind to. If the DataMember is not specified the first data table will be used.
// Creating a new report
Telerik.Reporting.Report report = new Telerik.Reporting.Report();
// Assigning the ObjectDataSource component to the DataSource property of the report.
report.DataSource = objectDataSource;
// Use the InstanceReportSource to pass the report to the viewer for displaying
Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();
reportSource.ReportDocument = report;
}
I am new to Telerik reporting and am trying to include a simple graph from data that has two columns (X, Y), for instance
1 345
2 10
...
12 3273
The Graph wizard seems to assume a more complicated data structure and requires a category.
For the simple X Y graph I need there are no grouping or categories.
How do I graph this simple data.
The graph produced by the wizard also has "ALL" under the X axis for which I can not find the property displaying this text.
Clicking on ReportViewer after selecting check boxes from RadComboBox does not cause a post back if the report is in a control.
How can I make a RadComboBox cause post back when click in the report area, but only if something actually has changed in the RadComboBox?
I have 1 control with multiple rad combox with post back set to true.
I have another control with a ReportViewer.
If the reports isn’t loaded the post back works, but if a report is loaded there is no post back caused by the RadComboBox selecting in to the report viewer AREA.
Test.aspx
Partial
Class
test
Inherits
System.Web.UI.Page
Protected
Sub
Page_Load(sender
As
Object
, e
As
System.EventArgs)
Handles
Me
.Load
Alert.Show(
"Changed"
)
End
Sub
End
Class
<%@ Page Language=
"VB"
AutoEventWireup=
"false"
CodeFile=
"test.aspx.vb"
Inherits
=
"test"
%>
<%@ Register src=
"Options/MYfilters.ascx"
tagname=
"MYfilters"
tagprefix=
"uc1"
%>
<%@ Register src=
"Options/MYReport.ascx"
tagname=
"MYReport"
tagprefix=
"uc2"
%>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head runat=
"server"
>
<title></title>
</head>
<body>
<form id=
"form1"
runat=
"server"
>
<div>
<asp:ScriptManager ID=
"ScriptManager1"
runat=
"server"
>
</asp:ScriptManager>
<table style=
"width: 100%;"
>
<tr>
<td>
<uc1:MYfilters ID=
"MYfilters1"
runat=
"server"
/>
</td>
</tr>
</table>
<table style=
"width: 100%;"
>
<tr>
<td>
<uc2:MYReport ID=
"MYReport1"
runat=
"server"
/>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Myfilters.ascx.vb
<%@ Control Language=
"VB"
AutoEventWireup=
"false"
CodeFile=
"MYfilters.ascx.vb"
Inherits
=
"Options_MYfilters"
%>
<telerik:RadComboBox ID=
"Company_ComboBox"
runat=
"server"
AutoPostBack=
"True"
CheckBoxes=
"True"
EnableCheckAllItemsCheckBox=
"True"
MaxHeight=
"500px"
>
<Items>
<telerik:RadComboBoxItem runat=
"server"
Text=
"Company_1"
Value=
"Company_1"
Checked=
"True"
/>
<telerik:RadComboBoxItem runat=
"server"
Text=
"Company_2"
Value=
"Company_2"
/>
<telerik:RadComboBoxItem runat=
"server"
Text=
"Company_3"
Value=
"Company_3"
/>
</Items>
<Localization AllItemsCheckedString=
"All Companies Selected"
ItemsCheckedString=
"Select All Companies"
/>
</telerik:RadComboBox>
<%@ Control Language=
"VB"
AutoEventWireup=
"false"
CodeFile=
"MYReport.ascx.vb"
Inherits
=
"Options_MYReport"
%>
<%@ Register
Assembly
=
"Telerik.ReportViewer.WebForms"
Namespace
=
"Telerik.ReportViewer.WebForms"
TagPrefix=
"telerik"
%>
<telerik:ReportViewer ID=
"ReportViewer1"
runat=
"server"
Style=
"border: 1px solid #ccc;"
Width=
"100%"
Height=
"950px"
>
</telerik:ReportViewer>
Imports
Telerik.Reporting
Imports
Telerik.Web.UI
Partial
Class
Options_MYReport
Inherits
System.Web.UI.UserControl
Protected
Sub
Page_Load(sender
As
Object
, e
As
System.EventArgs)
Handles
Me
.Load
Dim
reportType
As
Type = Type.[
GetType
](
"CompanyQuarterlySales, ReportsClassLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
)
Dim
TheReport
As
IReportDocument =
DirectCast
(Activator.CreateInstance(reportType), IReportDocument)
Dim
instanceReportSource
As
New
Telerik.Reporting.InstanceReportSource()
instanceReportSource.ReportDocument = TheReport
Me
.ReportViewer1.ReportSource = instanceReportSource
Me
.Page.Title =
"Quartely - "
+ reportType.Name
Dim
report
As
Telerik.Reporting.Report =
DirectCast
(instanceReportSource.ReportDocument, Telerik.Reporting.Report)
report.ReportParameters(
"Top"
).Value =
"10"
report.ReportParameters(
"CompID"
).Value =
"13"
report.ReportParameters(
"Country"
).Value =
"*"
report.ReportParameters(
"OpCo"
).Value =
"*"
report.ReportParameters(
"Department"
).Value =
"*"
report.ReportParameters(
"Site"
).Value =
"*"
report.ReportParameters(
"StartDate"
).Value =
"2013"
Me
.ReportViewer1.RefreshReport()
End
Sub
End
Class
Attached is an image of what is happening.
Hello Telerik,
I am posting my question here at WPF > General Discussions, because I didn’t see a forum for WPF > ReportViewer (the closest thing I found was WPF > PDFViewer). I don’t want to get lost or forgotten, so if you know where I should post this question, please reply back, and let me know. BTW, I went ahead and posted a duplicate of this question on the Telerik Reporting forum.
I am using Visual Studio 2010 and RadControls for WPF, v.2013.3.1016.40 (Dev). My WPF project references Telerik.Reporting.dll, runtime version v4.0.30319.
I have been attempting to use the web resource How to: Add report viewer to a WPF application. When I try to apply Step #4 in this resource, I get the error:
Cannot find type Telerik.Reporting.ReportSource in module Telerik.Reporting.dll.
When I search the Internet for help, I cannot find a resolution to this problem. Can you please help?
Thank you