I am trying to add toggle visibility functionality in my telerik reports. The telerik report version which I'm using is Q3 2014.
In my report, I have two groups, and a detail section.
Group1: catalog number
Group2: date
I have read the documentation for it, and when I set, it's not working. I think I'm making some mistake but I don't know where I'm going wrong.
Can someone please provide a demo code or solution to me.Hi,
I'm trying to pass a parameter to a Telerik report that is expecting a DateTime parameter from javascript. My code is this:
$("#reportViewer")
.telerik_ReportViewer({
serviceUrl: "/api/reports/",
templateUrl: "/src/vendor/ReportViewer/templates/telerikReportViewerTemplate.html",
reportSource: {
report: "MyFullyQualified assembly name",
parameters: {
sessionId: "b57c7405-5d1d-4513-841c-4c7b2015d376",
otherId: "8e44c09d-771e-453c-83e9-1723faaed2fd",
periodEnd: "2015-06-30"
}
}
});
As you can see the periodEnd is currently represented as a string in javascript. Looking at my Chrome dev tools, it looks like it's failing because the string containing the periodEnd is not being parsed as a .Net DateTime. I've also tried passing a javascript date object i.e. new Date("2015-06-30") with the same result.
The exception message I'm getting is: "Missing or invalid parameter value. Please input valid data for all parameters."
The Telerik API response to /api/reports/clients/2334-etc is as follows. You can see that the value for periodEnd is null even though I am specifying it.
[{"name":"sessionId","type":"System.String","text":"sessionId","multivalue":false,"allowNull":false,"allowBlank":false,"isVisible":false,"autoRefresh":false,"hasChildParameters":false,"childParameters":null,"availableValues":null,"value":"b57c7405-5d1d-4513-841c-4c7b2015d376","id":"sessionId","label":"b57c7405-5d1d-4513-841c-4c7b2015d376"},
{"name":"otherId","type":"System.String","text":"otherId","multivalue":false,"allowNull":false,"allowBlank":false,"isVisible":false,"autoRefresh":false,"hasChildParameters":false,"childParameters":null,"availableValues":null,"value":"8e44c09d-771e-453c-83e9-1723faaed2fd","id":"otherId","label":"8e44c09d-771e-453c-83e9-1723faaed2fd"},
{"name":"periodEnd","type":"System.DateTime","text":"periodEnd","multivalue":false,"allowNull":false,"allowBlank":false,"isVisible":false,"autoRefresh":false,"hasChildParameters":false,"childParameters":null,"availableValues":null,"value":null,"id":"periodEnd","label":null}]
Any help is much appreciated,
Ciaran O'Neill
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<
Guid
>" %>
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=6.1.12.820, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
<%@ Register Assembly="Telerik.Reporting, Version=6.1.12.820, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
Namespace="Telerik.Reporting" TagPrefix="telerik" %>
<%@ Import Namespace="System.Web.Mvc" %>
<%@ Import Namespace="JobSystem.BusinessLogic.Services" %>
<%@ Import Namespace="JobSystem.Reporting.Data.NHibernate" %>
<!DOCTYPE html>
<
html
>
<
head
runat
=
"server"
>
<
title
>Consignment Note</
title
>
</
head
>
<
body
>
<
form
id
=
"main"
method
=
"post"
action
=
""
>
<
telerik:ReportViewer
ID
=
"ReportViewer1"
Width
=
"100%"
Height
=
"800px"
runat
=
"server"
>
</
telerik:ReportViewer
>
</
form
>
<
script
runat
=
"server"
>
public override void VerifyRenderingInServerForm(Control control)
{
//To avoid the server form (<
form
runat
=
"server"
>) requirement
//base.VerifyRenderingInServerForm(control);
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
var dataSource = new Telerik.Reporting.ObjectDataSource();
dataSource.DataSource = typeof(NHibernateConsignmentReportDataProvider);
dataSource.DataMember = "GetConsignmentReportData";
dataSource.Parameters.Add(new Telerik.Reporting.ObjectDataSourceParameter("consignmentId", typeof(Guid), Model));
var companyDetailsService = DependencyResolver.Current.GetService<
CompanyDetailsService
>();
var report = new JobSystem.Reporting.ReportDefinitions.TelerikConsignmentReport();
var company = companyDetailsService.GetCompany();
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(company.DefaultCultureCode);
var logo = companyDetailsService.GetCompanyLogo();
var pageWidth = report.Width.Value;
report.MainLogo.Value = logo;
report.DataSource = dataSource;
var instanceReportSource = new Telerik.Reporting.InstanceReportSource();
instanceReportSource.ReportDocument = report;
ReportViewer1.ReportSource = instanceReportSource;
}
</
script
>
</
body
>
</
html
>
The web.config like so:
<
system.web
>
<
httpHandlers
>
<
add
type
=
"Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=6.1.12.820, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
path
=
"Telerik.ReportViewer.axd"
verb
=
"*"
validate
=
"true"
/>
</
httpHandlers
>
<
system.web
>
<
system.webServer
>
<
validation
validateIntegratedModeConfiguration
=
"false"
/>
<
modules
runAllManagedModulesForAllRequests
=
"true"
/>
<
handlers
>
<
add
name
=
"Telerik.ReportViewer.axd_*"
type
=
"Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=6.1.12.820, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
path
=
"Telerik.ReportViewer.axd"
verb
=
"*"
preCondition
=
"integratedMode"
/>
</
handlers
>
</
system.webServer
>
I am really fighting objects on my report in that when I preview them, the fields move on me.
Background: I have a 17 individual SQL queries unioned together (dont ask, it is how I have to do it do to a limitation imposed by our software not Telerik).
a. I have a table on the report that is filtered to return 5 records only. (table A)
b. beneath the table, I have a text field
c. Beneath the text field is list control with a field in it (filtered to pull just one record only) (list B)
d. to the right of Table A, I have another table that is filtered to return 10 records only (table C)
The result when previewing the report is that table A displays properly its 5 records. Table C displays properly with its 10 records. Label (point b above) displays just below table A as I designed it.
Now here is the issue. List B is below the label but it moved way down the page to start just below the end of the rows in Table C
Basically I have a bunch of tables, text fields as labels/titles all over this report and as I add items to the report, they seem to attaching themselves to other objects on the reports.
Is there a way to see what they are attached to and/or tell it to stop doing that and just go where I put the field.
I have read the document online a few times and I just can't figure this out. Any help would be great.
Hi,
I am trying to load a trdp file into memory to read what parameters a Report has to create a filter page to fill up the parameters. I also need to set the connection string and provider name dynamically. I can do it using the code on the follow link:
But, it works for trdx (legancy) file. Using a UriReportSource, the code bellow does not work for trdp file to take a Report object and read information on the report.
Report DeserializeReport(UriReportSource uriReportSource)
{
var settings = new System.Xml.XmlReaderSettings();
settings.IgnoreWhitespace = true;
using (var xmlReader = System.Xml.XmlReader.Create(uriReportSource.Uri, settings))
{
var xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
var report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
return report;
}
}
This code with trdx (which is a xml) works fine, but my question is about the binary trdp.
How can I convert a uriReportSource (or given a path for a trdp file how to take it) into a Telerik.Reporting.Report object?
I need to to read the structure of the report and make changes (replace connectionstirng, read expected parameters, etc..).
Thank you.
I am using Telerik HTML5 Report Viewer Template where there are options to export PDF,CSV etc. Getting an out of memory exception while exporting to PDF because report has lot of images.
I am setting DataMember attribute to a method name to fetch report data. DataMember method is called in many instances like when report is being loaded or exported or when previewed.
Is there a mechanism by which I can get the information about what triggered the DataMember method.
For e.g. if Export to PDF is clicked how can I know that Export to PDF has triggered the DataMember method.
I also need suggestion on following stuff.
If I create a custom export to PDF button by modifying Telerik HTML5 Report Viewer Template
1. How can I hook my server side API to that button?
2. How can I pass the report parameters to that API?