I'm almost there. Subreport is displaying but theres no data in it. What am I doing wrong please?
Winforms. ObjectDatasource using a dataset with 2 tables, master and detail.
My report represents a paper questionnaire/Form. Master is a single row table with a person's personal details eg name, address etc. The details table is multi row and represents the questions and answers that the person filled out. The tables are linked by an ID field. Ive added the ID to the filter field. For testing purposed I've created a dummy main and multi detail records.
Main report designer file entries
//
// HealthQuestionnaireDataSet
//
this.HealthQuestionnaireDataSet.DataMember = "MainDetail";
this.HealthQuestionnaireDataSet.DataSource = typeof(pulse.move.datasources.datasetHealthQuestionaire);
this.HealthQuestionnaireDataSet.Name = "HealthQuestionnaireDataSet";
//
// subReport1
//
this.subReport1.Name = "subReport1";
typeReportSource1.Parameters.Add(new Telerik.Reporting.Parameter("parmId", "= Fields.Id"));
typeReportSource1.TypeName = "pulse.move.telerik.reportlib.RptHealthQuestionnaireSubDetail, pulse.move.telerik.reportlib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
this.subReport1.ReportSource = typeReportSource1;
I call the following static method in the code behind of my main report to generate the report onto the ReportViewer using the dataset passed in. This seems to work correctly. If I change the code to read "var report = new RptHealthQuestionnaireMainDetail { DataSource = dataset };" then it fails to generate. I wondered if this was the cause of my problem with the sub report not working.
public static void GenerateReport(datasetHealthQuestionaire dataset, ReportViewer viewer)
{
viewer.CancelRendering();
var report = new RptHealthQuestionnaireMainDetail { DataSource = dataset.maindetail };
var reportSource = new InstanceReportSource {ReportDocument = report};
viewer.ReportSource = reportSource;
viewer.RefreshReport();
}
I wasn't able to get the subreport to work in the designer, so I moved the binding code to the constructor of the sub report to make it easier to debug and change.
The subreport displays the labels correctly, but there's no data. What am I missing to bind the data correctly?
public RptHealthQuestionnaireSubDetail()
{
//
// Required for telerik Reporting designer support
//
InitializeComponent();
Bindings.Clear();
// tried both of the following. Makes no difference. Still no data
//Bindings.Add(new Telerik.Reporting.Binding("DataSource", "=ReportItem.DataObject"));
Bindings.Add(new Telerik.Reporting.Binding("DataSource", "=ReportItem.Parent.Parent.DataObject"));
}
//
// RptHealthQuestionnaireSubDetail
//
// Commented out the following 2 lines and moved them to the constructor
//this.Bindings.Add(new Telerik.Reporting.Binding("DataSource", "=ReportItem.DataObject"));
//this.DataSource = this.HealthQuestionnaireDataSource;
this.Filters.Add(new Telerik.Reporting.Filter("= Fields.Id", Telerik.Reporting.FilterOperator.Equal, "= Parameters.parmId.Value"));
this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
this.detailSection1});
this.Name = "RptHealthQuestionnaireSubDetail";
reportParameter1.Name = "parmId";
reportParameter1.Type = Telerik.Reporting.ReportParameterType.Integer;
this.ReportParameters.Add(reportParameter1);
I designed the my report on Telerik Reporting. When I export to Excel, something error appeared. Most of column is split as my picture.
Someone help me to fix this error please ?
I am getting the following exception when attempting to export a report from WPF Report Viewer to any format in the pull down list:
System.ArgumentNullException was unhandled by user code
HResult=-2147467261
Message=Value cannot be null.
Parameter name: format
Source=mscorlib
ParamName=format
StackTrace:
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(String format, Object arg0)
at Telerik.ReportViewer.Wpf.ReportViewerModel.ExportReport(String format, Hashtable deviceInfo)
at Telerik.ReportViewer.Wpf.ReportViewerModel.set_SelectedRenderingExtension(RenderingExtension value)
InnerException:
I'm not sure when this started. Has anyone else seen this problem?
Thanks
I have Web Forms report viewer ASPX and I'm trying to set a parameter "Parameter1" included in the designer like this:
if (!IsPostBack)
{
int AppointmentID = Convert.ToInt16((string)Request.QueryString["AppointmentID"]);
ReportLibrary.ClientApptInvoice rpt = new ReportLibrary.ClientApptInvoice();
rpt.ReportParameters["Parameter1"].Value = AppointmentID;
}
when I run the report viewer page I get "Missing or invalid parameter value" and the parameter field which is set visible appears to allow entry.
What am I missing ? I was trying to follow this - http://docs.telerik.com/reporting/designing-reports-parameters-programmatic-control
Thanks
Hi,
Is it possible to load data from a text file to the telerik report?
Currently we have an external source of data coming from a text file. it is already formatted the way client wants to display on their end.
What we want to do is, we load the entire data to the telerik report without doing much data formatting and layout adjustment.
Is this possible on telerik reporting by setting the datasource to the textfile?
Thanks,
I'm trying to replicate an Invoice using Telerik Reporting. The detail section contains a table that lists each order's item. It holds around 15 items per page but I need it to hold 30.
Basically I want to turn this:
------------------------------------------------------------------------
# | Description | Qty | Unit Price | Price
------------------------------------------------------------------------
1 | XXXXXXXXXXXXX | 001 | 15.00 | 15.00
2 | YYYYYYYYYYY | 005 | 2.50 | 12.50
Into this:
------------------------------------------------------------------------
# | Desc. | Qty | U. Price | Price | # | Desc. | Qty | U. Price | Price
------------------------------------------------------------------------
1 | XXXXX | 001 | 15.00 | 15.00 | 3 | ZZZZZ | 002 | 15.00 | 30.00
2 | YYYY | 005 | 2.50 | 12.50 |
I think it can be done using a crosstab by I tried and couldn't do it. Any help is appreciated.
Hello!
I have a
Silverlight application that uses Telerik reporting. Also this application uses
Microsoft Prims.
After
upgrading from current version of Telerik (6.0.12.215, Q1 2012 Visual Studio
2011 Refresh) to newer (11.1.17.614, R2 2017) issues occurred.
After minor
changes in source code (correcting to use right namespaces) solution builds
fine, even runs fine, but reports shows nothing useful (no values in
parameter-binding fields). So, parameters now do not passes to reports.
This is some source code.
protected void NavigateToPermissionReport()
{
string navigationSource = AppPages.PermissionReportView + "?" +
string.Join("&", this.Parameters.Select(parameter => string.Format("{0}={1}", parameter.Key, parameter.Value)));
this.EventAggregator.GetEvent<NavigateToPageEvent>().Publish(true);
this.RegionManager.RequestNavigate(AppRegions.NavigationRegion, navigationSource);
}
After this piece of code “black magic” happen and execution comes directly to report’s code:
private void OnPermissionItemDataBinding(object sender, EventArgs e)
{
this.ItemDataBinding -= this.OnPermissionItemDataBinding;
this.BeginGetPermission(this.ReportParameters);
}
private void BeginGetPermission(ReportParameterCollection parameters){
PermissionViewModel viewModel = new PermissionViewModel();
viewModel.LoadData(parameters);
this.DataSource = new ObjectDataSource(viewModel, string.Empty);
}
What happens
between these parts of the code I can’t figure out.
So, before upgrading, parameters in ReportParameterCollection had the same values as in navigationSource, but after, parameters became null.
Why this can
happen?
Thanks.
Hello, i have a report made with reporting Q3 2013 and VS 2012. When installing it on the client, it gives error 40: a connection with SQL could not be opened. The report in local is ok. that could be happening? other report in the same app are ok, with de same connection.
I'm using SqldAtaSource with connection defined in web.config.
Thank you