I am trying to show a report in HTML5. I have setup the Web API and I am able to successfully call the API with the xxx/formats and xxx/clients URL. However the next calls, which are clients/{clientid}/parameters and clients/{clientid}/instances are failing with a 404 and no additional information in Fiddler (see attached).
I included the Web API into my existing Web API, so the format of the URL is different than what is documented in the tutorials, but that shouldn't matter.
I have also seen that the 404 may indicate that the report file cannot be found. I have the following setup:
In the controller, I have this statement
Dim resolver = New ReportFileResolver(HttpContext.Current.Server.MapPath("~/Reports")).AddFallbackResolver(New ReportTypeResolver())and I have in the project location a Reports sub folder which contains the file Report1.trdx
In the Web Application, I build the html that has to be added to the page as following. The most noticeable is the ReportSource which is set to Report1 (I have also tried Report1.trdx with the same result)
Can you help me to set this up?
"<div id=\"reportViewer1\" class=\"k-widget\"> " + " loading... " + "</div> " + "<script type=\"text/javascript\"> " + " $(\"#reportViewer1\") " + " .telerik_ReportViewer({ " + " serviceUrl: \"/api/" + "token/" + Credentials.getToken(this.mainViewModel.connection) + "/" + this.mainViewModel.connection + "/" + "TelerikReports/\", " + " templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate-9.1.15.731.html', " + " reportSource: { " + " report: \"Report1\" " + " } " + " }); " + "</script> ";public static string GroupDisplay(int GroupNumber, Telerik.Reporting.ReportParameterCollection parameters, decimal? RecordCenterKey, decimal? RecordUserKey, DateTime? BillDT_DateTime, decimal BillDT) { switch (GetGroupingForGroupNumber(GroupNumber)) { case ReportGrouping.None: return string.Empty; case ReportGrouping.Centers: return CenterName(GetCenterKeyFromParameters(parameters), RecordCenterKey, GetViewSubCentersFromParameters(parameters)); case ReportGrouping.Users: return CreateUserName(RecordUserKey); case ReportGrouping.Date: return CheckDate(GroupDate(BillDT_DateTime, BillDT)); default: return string.Empty; } }Telerik.Reporting.ReportParameterCollection instead of using every parameter separately is because there are 7 default parameters and many optional depending on the report, I want to use the same expression in all 40 so if something changes I can change the expressions in code for all of them in no time.I have escaped the ampersand but still get this error
the unit.Description is "something something & something something"
I then run the following code;
var unit = HttpUtility.HtmlEncode(unit.Description);which returns "something something & something something"
this is bound to a field in a HtmlTextBox
Provider: {=Fields.Description.ToUpper()} ({=Fields.Identifier})which causes (see the attachment)
when I manually remove the ampersand the report renders just fine
I have read other threads on this suggesting to escape it but this is not working. Any ideas?
Telerik Version : Q2 2013 7.1.13.705
I've successfully put together a custom extension by using IRenderingExtension and I'm able to choose the option from the dropdown, select export, and get results in a format that I need. I've added parameters to the new extension in the web config, but I can't find them when I debug. They don't seem to be within the report, renderingcontext, or deviceinfo variables. I even just tested out with simple names and values such as "test". Is there something I'm missing?
Thanks,
Chuck
Hello,
I like to make a crosstab but i have two problems and you can see the image that i attached.First one is that i want to group the names of both rows and columns by asc order i tried to do it but it doesnt work . Second problem is that i am trying to match them . I have the informations of who choose who and the choice order . For example , esra's first choice is omer and i want to write 1 to that cell . Would be grateful of any advice .
Thanks.
I create a report but a i have this error
Error de servidor en la aplicación '/'.
Referencia a objeto no establecida como instancia de un objeto.Descripción: Excepción no controlada al ejecutar la solicitud Web actual. Revise el seguimiento de la pila para obtener más información acerca del error y dónde se originó en el código.
Detalles de la excepción: System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
Error de código fuente:
Se ha generado una excepción no controlada durante la ejecución de la solicitud Web actual. La información sobre el origen y la ubicación de la excepción pueden identificarse utilizando la excepción del seguimiento de la pila siguiente.
Seguimiento de la pila:
[NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.]
Telerik.Reporting.Processing.Table.ForEachCell(Action`1 action) +161
Telerik.Reporting.Processing.Table.MeasureDataItemContent(IMeasureContext context, SizeRF availableClientSize) +320
Telerik.Reporting.Processing.DataItem.MeasureContent(IMeasureContext context, SizeRF availableClientSize) +149
Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize) +289
Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize) +141
Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize) +135
Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize) +121
Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureChildItems(IMeasureContext context, SizeRF availableClientSize) +134
Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureContent(IMeasureContext context, SizeRF availableClientSize) +65
Telerik.Reporting.Processing.ReportSectionBase.MeasureContent(IMeasureContext context, SizeRF availableClientSize) +126
Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize) +289
Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize) +141
Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize) +135
Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize) +121
Telerik.Reporting.Processing.StackLayout.MeasureContent(IMeasureContext context, SizeRF availableClientSize) +261
Telerik.Reporting.Processing.Group.MeasureContent(IMeasureContext context, SizeRF availableClientSize) +123
Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize) +289
Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize) +141
Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize) +135
Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize) +121
Telerik.Reporting.Processing.StackLayout.MeasureContent(IMeasureContext context, SizeRF availableClientSize) +261
Telerik.Reporting.Processing.Report.MeasureContent(IMeasureContext context, SizeRF availableClientSize) +201
Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize) +289
Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize) +141
Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize) +135
Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize) +121
Telerik.Reporting.Processing.LayoutElement.MeasureElement(LayoutElement elementToMeasure, IMeasureContext context) +109
Telerik.Reporting.Html5Rendering.Html5ReportInteractive.MeasureReportCore(Report report, IMeasureContext measureContext) +51
Telerik.Reporting.BaseRendering.RenderingExtensionBase.MeasureReport(Report report, Hashtable deviceInfo) +90
Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback) +419
Telerik.Reporting.Processing.ReportProcessor.RenderCore(ExtensionInfo extensionInfo, IList`1 reports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback) +1372
Telerik.Reporting.Processing.ReportProcessor.RenderCore(String format, IList`1 reports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback) +103
Telerik.ReportViewer.WebForms.ReportPageOperation.RenderReport(String format, IList`1 processingReports, Hashtable deviceInfo, IRenderingContext renderingContext) +122
Telerik.ReportViewer.WebForms.ReportRenderOperation.PerformOperationOverride() +340
Telerik.ReportViewer.WebForms.ReportPageOperation.PerformOperationOverride() +173
Telerik.ReportViewer.WebForms.HandlerOperation.PerformOperation(HttpContext context, ICacheManager cacheManager) +74
Telerik.ReportViewer.WebForms.BasicHandler.ProcessRequest(HttpContext context) +276
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
the code is: ​
Report miReporte = new Report(); //Se asignan los parametros si es necesario if (param.Count > 0) foreach (ParametrosSP mid in param) { if (mid._direccion) { miReporte.ReportParameters.Add(mid._nombre, mid._tipoReporte, null); rrv_VistaReporte.ParametersAreaVisible = true; } } //Se asigna el ancho al reporte miReporte.Width = Telerik.Reporting.Drawing.Unit.Inch(4); //se declara el uso de la seccion de detalle en el reporte Telerik.Reporting.DetailSection ds_Seccion = new DetailSection(); //Se asigna un alto al detalle ds_Seccion.Height = Telerik.Reporting.Drawing.Unit.Inch(0.2); //Se declara una tabla para introducirla al detalle del reporte Telerik.Reporting.Table tabla = new Telerik.Reporting.Table(); //Obtenemos los valores de filas y columnas int filas = ds.Tables[0].Rows.Count; int columnas = ds.Tables[0].Rows[0].ItemArray.Length; //Se crea un arreglo de textbox que estaran colocados en las celdas de la tabla Telerik.Reporting.TextBox[] titulos = new Telerik.Reporting.TextBox[columnas]; //Se crea un arreglo de grupos de tabla para empezar a asignar valores Telerik.Reporting.TableGroup[] tg_Grupos = new TableGroup[columnas]; Telerik.Reporting.TableGroup tg_General = new TableGroup(); //Se obtienen los nombres de las columnas para el reporte string[] nombres = ConexionSQL.ParametrosSalidaObtenidos[0].ToString().Split(','); //Se le otorga una posición a la tabla tabla.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(1.7000001668930054D), Telerik.Reporting.Drawing.Unit.Inch(1.1000000238418579D)); //Se le asigna un Nombre a la tabla tabla.Name = "TablaReporte"; //Se declaran los textbox del contenido Telerik.Reporting.TextBox[] contenido = new Telerik.Reporting.TextBox[columnas]; //Se Agrega una nueva fila a la tabla tabla.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D))); for (j = 0; j < columnas; j++) { //Se inician cada uno de los valores que va a ir como titulos de las tablas titulos[j] = new Telerik.Reporting.TextBox(); //Se le asigna un nombre al textbox titulos[j].Name = nombres[j]; //Se le asigna un tamaño al textbox titulos[j].Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D)); //Se le asigna el valor al textbox //en este caso como prueba es generico titulos[j].Value = nombres[j]; //Se crean las columnas de la tabla tabla.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Inch(1.0000002384185791D))); //Se inician cada uno de los grupos por columna tg_Grupos[j] = new TableGroup(); //Se asigna un nombre a cada uno de los grupos tg_Grupos[j].Name = nombres[j]; //Se asigna un textBox para recibir los datos tg_Grupos[j].ReportItem = titulos[j]; //Se agregan los grupos a la tabla tabla.ColumnGroups.Add(tg_Grupos[j]); //Se agregan los textbox a la tabla //tabla.Items.Add(titulos[j]); //Se asigna un nuevo textbox a cada celda del arreglo contenido[j] = new Telerik.Reporting.TextBox(); //Se le asigna un nombre al textbox contenido[j].Name = "tb_Celda" + j.ToString(); //Se le asigna un tamaño al textbox contenido[j].Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D)); //Se le asigna el valor al textbox contenido[j].Value = "=Fields.[" + nombres[j] + "]"; //Se asigna el textbox a cada celda de la tabla tabla.Body.SetCellContent(i, j, contenido[j]); //Se agrega el textbox a la tabla tabla.Items.Add(contenido[j]); } tg_General.Groupings.Add(new Telerik.Reporting.Grouping(null)); tg_General.Name = "detailTableGroup"; tabla.DataSource = ds.Tables[0]; tabla.RowGroups.Add(tg_General); tabla.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(3.0000002384185791D), Telerik.Reporting.Drawing.Unit.Inch(0.58333331346511841D)); //Se agrega la tabla a la seccion ds_Seccion.Items.Add(tabla); //Se agrega la seccion de detalle al reporte miReporte.Items.Add(ds_Seccion); //Se asigna el reporte al visualizador rrv_VistaReporte.ReportSource = miReporte; //Se refresca la vista //rrv_VistaReporte.RefreshReport();