Telerik Forums
Reporting Forum
5 answers
743 views

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> ";

Stef
Telerik team
 answered on 25 Aug 2015
1 answer
198 views
Hi,

I'm trying to use a custom function in my expression to decide what field should be displayed in the textbox, what grouping should be done, what formatting style should be applied, visibility and how the drilldown functions work.

So far I got here (example of displaying text)
C#
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;
            }
        }

My expression:
= GroupDisplay(1, Parameters, Fields.TxTicket_CenterKey, Fields.TxTicket_UserKey_BilledByKey, NULL, Fields.TxTicket_BillDT)

The reason why I am using the 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.

Am I using a bad approach to solve this or is it something that is not possible in the current release of Telerik Reporting

Kind regards,
Frank
Missing User
 answered on 25 Aug 2015
2 answers
495 views

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 &amp; 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

 

 

 

 

 

Jono
Top achievements
Rank 1
 answered on 25 Aug 2015
4 answers
136 views
I am trying to learn how to use your data access and reporting modules by creating a very basic project in VS2013 that accesses an oracle database, but i keep coming up with an error.
Here is what i am doing
(just using default names as provided by wizards)
new project -> class library -> add new item -> telerik data access domain model -> select populate from database, backend = oracle -> next -> choose connection -> I have a connection created already from server explorer which works -> name is "connection" -> next -> select the schema i want to use -> select the table i want to use -> next->next->finish -> project gets reloaded -> build solution
add new item -> telerik report q3 2014 wizard -> table wizard -> ok -> add new data source -> select Open Access Data Source -> ok -> choose "connection" as data connection -> choose "ClassLibrary1" and "EntitiesModel1" as object context -> next -> choose IQueryable method that is same name as my table as object context member -> finish -> next -> add my fields (only have 2, one is primary key) -> next -> select normal as style -> next -> finish
report designer is shown -> select preview tab -> get following error
Type is enhanced and registered, but not available from the database class meta data. this can be caused by a wrong connection id or configuration. Parameter name: type Actual value was ClassLibrary1.COURT (COURT is the name of my table)

What am I doing wrong,











Stef
Telerik team
 answered on 24 Aug 2015
1 answer
552 views
Hi:
 We have a MVC project that to load a summary table (e.g a list of ​staff, with its role and location) When each row is click, it ​needs to print out a detail report directly to the local printer​, can I ask it is possible to do this with telerik reporting on a MVC project? (There is no need to view the generated report)

Many thanks

William
Nasko
Telerik team
 answered on 24 Aug 2015
8 answers
1.0K+ views
Hi,
I'm really new to Telerik and really love what this thing has done to me so far.

I have a question about Master and SubReport. How can I hide subreport if the subreport do not have the data. Right now the Master and the subreports work well, but if one or two of the sub reports do not have the data from the master report, how do i hide it? because it display an error that should not be seen by the end user....

I really need some help for it in VB because recently i only found them in C#. Thank you.
Stef
Telerik team
 answered on 24 Aug 2015
1 answer
525 views
Can I know how to add column group in telerik report?
Nasko
Telerik team
 answered on 24 Aug 2015
3 answers
201 views

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

Nasko
Telerik team
 answered on 24 Aug 2015
2 answers
154 views

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.  

Gökhan
Top achievements
Rank 1
 answered on 22 Aug 2015
0 answers
468 views

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();

Carlos
Top achievements
Rank 1
 asked on 21 Aug 2015
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?