This is a migrated thread and some comments may be shown as answers.

The report viewer don't shome the report

9 Answers 877 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 19 Aug 2015, 06:35 PM

I can't see the report, i calculate a dataset to send it at report datasourse but i can't see anything, this is the code:

            Report miReporte = new Report();
            if(param.Count>0)
                foreach (ParametrosSP mid in param)
                {
                    miReporte.ReportParameters.Add(mid._nombre, mid._tipo, null);
                }

            miReporte.Width = Telerik.Reporting.Drawing.Unit.Inch(4);

            Telerik.Reporting.DetailSection detailSection = new Telerik.Reporting.DetailSection();

            detailSection.Height = Telerik.Reporting.Drawing.Unit.Inch(0.2);
            miReporte.Items.Add(detailSection);

            Telerik.Reporting.Table tabla = new Telerik.Reporting.Table();
            tabla.DataSource = ds.Tables[0];
            detailSection.Items.Add(tabla);
            rrv_VistaReporte.ReportSource = miReporte;
            rrv_VistaReporte.RefreshReport();

param is an ArrayList that has the parameters, rrv_VistaReporte is the Telerik.ReportViewer

9 Answers, 1 is accepted

Sort by
0
Accepted
Ellis
Top achievements
Rank 1
answered on 19 Aug 2015, 07:43 PM

Hi Carlos, everything is working as expected with your code, you are no​t seeing anything because there is nothing to show. 
Let me explain; you are adding a table to the detail section of your report but that table is just a logical item, you should add columns and rows into it, and text-boxes to them. Here under I'll paste the code to show a simple table, but anytime that you run into issues I'll recommend that you create a new blank report and play with designer so you can see the auto generated code, that's exactly what I did to create this snippet.

Telerik.Reporting.TextBox textBox1 = new Telerik.Reporting.TextBox();
Telerik.Reporting.TextBox textBox2 = new Telerik.Reporting.TextBox();
Telerik.Reporting.TextBox textBox3 = new Telerik.Reporting.TextBox();
Telerik.Reporting.TextBox textBox4 = new Telerik.Reporting.TextBox();
Telerik.Reporting.TextBox textBox5 = new Telerik.Reporting.TextBox();
Telerik.Reporting.TextBox textBox6 = new Telerik.Reporting.TextBox();
//
// table1
//
table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Inch(1.0000002384185791D)));
table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Inch(1.0000001192092896D)));
table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Inch(1.0000001192092896D)));
table1.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D)));
table1.Body.SetCellContent(0, 0, textBox4);
table1.Body.SetCellContent(0, 1, textBox5);
table1.Body.SetCellContent(0, 2, textBox6);
tableGroup1.Name = "tableGroup";
tableGroup1.ReportItem = textBox1;
tableGroup2.Name = "tableGroup1";
tableGroup2.ReportItem = textBox2;
tableGroup3.Name = "tableGroup2";
tableGroup3.ReportItem = textBox3;
table1.ColumnGroups.Add(tableGroup1);
table1.ColumnGroups.Add(tableGroup2);
table1.ColumnGroups.Add(tableGroup3);
table1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
textBox4,
textBox1,
textBox2,
textBox3,
textBox5,
textBox6});
table1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(1.7000001668930054D), Telerik.Reporting.Drawing.Unit.Inch(1.1000000238418579D));
table1.Name = "table1";
tableGroup4.Groupings.Add(new Telerik.Reporting.Grouping(null));
tableGroup4.Name = "detailTableGroup";
table1.RowGroups.Add(tableGroup4);
table1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(3.0000002384185791D), Telerik.Reporting.Drawing.Unit.Inch(0.58333331346511841D));
//
// textBox1
//
textBox1.Name = "textBox1";
textBox1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D));
textBox1.Value = "Head 1";
//
// textBox2
//
textBox2.Name = "textBox2";
textBox2.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D));
textBox2.Value = "Head 2";
//
// textBox3
//
textBox3.Name = "textBox3";
textBox3.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(0.99999994039535522D), Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D));
textBox3.Value = "Head 3";
//
// textBox4
//
textBox4.Name = "textBox4";
textBox4.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D));
textBox4.Value = "Detail 1";
//
// textBox5
//
textBox5.Name = "textBox5";
textBox5.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D));
textBox5.Value = "Detail 2";
//
// textBox6
//
textBox6.Name = "textBox6";
textBox6.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(0.99999994039535522D), Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D));
textBox6.Value = "Detail 3";

0
Carlos
Top achievements
Rank 1
answered on 19 Aug 2015, 08:25 PM
so i need to declare a textboxt for each data in the table? or just the headers and the first row
0
Ellis
Top achievements
Rank 1
answered on 19 Aug 2015, 11:31 PM

Hi Carlos, One for each column of relevant piece of data. At minimum one for each column in the header and one for each column in the detail section; however if you need to group your data that will require for more text-boxes for you to show the information.

Best Regards,

Ellis.

 

0
Carlos
Top achievements
Rank 1
answered on 20 Aug 2015, 03:01 PM

I implement this code but i have the error in the image what i did wrong?

protected void rlibo_ListaReportes_SelectedIndexChanged(object sender, EventArgs e)
        {
            int i,j;
            ArrayList sp = new ArrayList(), param = new ArrayList();
            int idReporte = int.Parse(rlibo_ListaReportes.SelectedValue.ToString());
            ds = ConexionSQL.obtieneDatos("select nombre_SP, entradas, salidas from reportes where idReporte = " + idReporte);
            for (i = 0; i < ds.Tables[0].Rows[0].ItemArray.Length; i++)
            {
                sp.Add(ds.Tables[0].Rows[0].ItemArray[i].ToString());
            }
            ds = ConexionSQL.obtieneDatos("select idParametro, nombreParametro, tipoParametro, direccionParametro, tamaño from SP_Parametros where idReporte = " + idReporte);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (int.Parse(sp[1].ToString()) > 0)
                {
                    for (i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        ArrayList temp = new ArrayList();
                        for (j = 0; j < ds.Tables[0].Rows[0].ItemArray.Length; j++)
                        {
                            temp.Add(ds.Tables[0].Rows[i].ItemArray[j].ToString());
                        }
                        ParametrosSP SP_Parametro = new ParametrosSP(temp);
                        param.Add(SP_Parametro);
                    }
                }
                else if (int.Parse(sp[2].ToString()) > 0)
                {
                    for (i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        ArrayList temp = new ArrayList();
                        for (j = 0; j < ds.Tables[0].Rows[0].ItemArray.Length; j++)
                        {
                            temp.Add(ds.Tables[0].Rows[i].ItemArray[j].ToString());
                        }
                        ParametrosSP SP_Parametro = new ParametrosSP(temp);
                        param.Add(SP_Parametro);
                    }
                }
            }
 
            ds = ConexionSQL.EjecutaSP_Dinamico(sp[0].ToString(), param, int.Parse(sp[1].ToString()), int.Parse(sp[2].ToString()));
 
            Report miReporte = new Report();
            if(param.Count>0)
                foreach (ParametrosSP mid in param)
                {
                    miReporte.ReportParameters.Add(mid._nombre, mid._tipo, null);
                }
 
            miReporte.Width = Telerik.Reporting.Drawing.Unit.Inch(4);
 
            Telerik.Reporting.DetailSection detailSection = new Telerik.Reporting.DetailSection();
 
            detailSection.Height = Telerik.Reporting.Drawing.Unit.Inch(0.2);
            miReporte.Items.Add(detailSection);
 
            Telerik.Reporting.Table tabla = new Telerik.Reporting.Table();
 
            tabla.DataSource = ds.Tables[0];
            detailSection.Items.Add(tabla);
             
            int rows=ds.Tables[0].Rows.Count, columnas=ds.Tables[0].Rows[0].ItemArray.Length;
            Telerik.Reporting.TextBox[,] datos= new Telerik.Reporting.TextBox[rows,columnas];
            Telerik.Reporting.TableGroup[] tg_Grupos= new TableGroup[columnas];
            Telerik.Reporting.TableGroup grupo1 = new TableGroup();
 
            for (i = 0; i < rows; i++)
            {
 
                for (j = 0; j < columnas; j++)
                {
                    datos[i, j] = new Telerik.Reporting.TextBox();
                     
                    tabla.Body.SetCellContent(i, j, datos[i, j]);
                    tabla.Body.SetCellContent(0, j, datos[0, j]);
                    if (i == 0)
                    {
                        tabla.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Inch(1.0000002384185791D)));
                        tg_Grupos[j] = new TableGroup();
                         
                        tg_Grupos[j].ReportItem = datos[0, j];
                        tg_Grupos[j].Name = "tableGroup" + j;
                        tabla.ColumnGroups.Add(tg_Grupos[j]);
 
                        datos[i, j].Name = "titulo" + i.ToString() + j.ToString();
                        datos[i, j].Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D));
                        datos[i, j].Value = "titulo"+j;
                        tabla.Items.Add(datos[i, j]);
                    }
                }
                 
                tabla.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D)));
 
 
                for (j = 0; j < columnas; j++)
                {
                    datos[i, j].Name = "dato" + i.ToString() + j.ToString();
                    datos[i, j].Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D));
                    datos[i, j].Value = ds.Tables[0].Rows[i].ItemArray[j].ToString();
                    tabla.Items.Add(datos[i,j]);
                }
                tabla.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(1.7000001668930054D), Telerik.Reporting.Drawing.Unit.Inch(1.1000000238418579D));
                tabla.Name = "table1";
            }
            grupo1.Groupings.Add(new Telerik.Reporting.Grouping(null));
            grupo1.Name = "detailTableGroup";
            tabla.RowGroups.Add(grupo1);
            tabla.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(3.0000002384185791D), Telerik.Reporting.Drawing.Unit.Inch(0.58333331346511841D));
 
 
 
            miReporte.DataSource = ds.Tables[0];
             
            rrv_VistaReporte.ReportSource = miReporte;
            rrv_VistaReporte.RefreshReport();

 

             
        }

0
Ellis
Top achievements
Rank 1
answered on 20 Aug 2015, 03:48 PM

Hola Carlos, creo el problema esta aquí:

tabla.Body.SetCellContent(i, j, datos[i, j]);
tabla.Body.SetCellContent(0, j, datos[0, j]);

​El método SetCellContent sirve para asignarle la cantidad de celdas en en el detalle de la tabla, y estás agregando mas Filas de las que realmente tienes.

Me explico; Solo tienes una fila en la tabla:

tabla.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D)));

SetCellContent pide como parametros (indiceFila, indiceColumna, itemReporte), y cuando dices "(i, j, datos[i, j])" la variable "i" no siempre trae 0, de ahí es el mensaje que la tabla tiene 4 Filas cuando solo esta preparado para una.

 Saludos,

Ellis.

0
Ellis
Top achievements
Rank 1
answered on 20 Aug 2015, 04:04 PM

Oh Snap! Sorry guys, now for the English Speakers!

Hi Carlos, I think that the issue is in these lines:

tabla.Body.SetCellContent(i, j, datos[i, j]);
tabla.Body.SetCellContent(0, j, datos[0, j]);

The SetCellContent method is used to assign cells to the table's detail and you are adding more rows that the ones that you actually have.

Let me explain; you just have one row in the table:

tabla.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(Telerik.Reporting.Drawing.Unit.Inch(0.2916666567325592D)));
SetCellContent parameters are (rowIndex, columnIndex, reportItem), but you are using "(i, j, datos[i, j])" wuere "i" can be any number different from 0 which is the one expected for a table that has only one row, therefore the error message shown on your print screen.

 Best Regards,

Ellis.

 

 

 

 

 

0
Carlos
Top achievements
Rank 1
answered on 20 Aug 2015, 08:55 PM

I Reorder the code but the issue still happends

 

               //Se crea una variable de tipo Reporte
            Report miReporte = new Report();
 
            //Se asignan los parametros si es necesario
            if (param.Count > 0)
                foreach (ParametrosSP mid in param)
                    miReporte.ReportParameters.Add(mid._nombre, mid._tipo, null);
 
            //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();
 
            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 = "tb_Titulo" + 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 = "Titulo " + 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 = "Titulo" + 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 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[filas, columnas];
            for (i = 0; i < filas; i++)
            {
                //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 asigna un nuevo textbox a cada celda del arreglo
                    contenido[i, j] = new Telerik.Reporting.TextBox();
                    //Se le asigna un nombre al textbox
                    contenido[i, j].Name = "tb_Celda" + i.ToString() + j.ToString();
                    //Se le asigna un tamaño al textbox
                    contenido[i, 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[i, j].Value = ds.Tables[0].Rows[i].ItemArray[j].ToString();
                    //Se asigna el textbox a cada celda de la tabla
                    tabla.Body.SetCellContent(i, j, contenido[i, j]);
                    //Se agrega el textbox a la tabla
                    tabla.Items.Add(contenido[i, j]);
                }
 
            }
 
            ////Se agrega el grupo de renglones
            tg_General.Groupings.Add(new Telerik.Reporting.Grouping(null));
            //Se le asigna un nombre al grupo
            tg_General.Name = "detailTableGroup";
            //Se agrega el grupo a la tabla
            tabla.RowGroups.Add(tg_General);
            //Se redimensiona la tabla
            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();

I have 4 rows but at the end the table has just one an it is null, 

0
Ellis
Top achievements
Rank 1
answered on 21 Aug 2015, 12:52 PM

Hi Carlos,

I think that you have the wrong approach to this, this is a reporting engine and you are trying to create a table with the data instead of pointing the table to the data. Again I will recommend you to do a simple report with the Report Designer and see the auto generated code so you can achieve what you need.

Best Regards,

Ellis.

0
Carlos
Top achievements
Rank 1
answered on 21 Aug 2015, 06:20 PM

Ok i did it how you said so i have now this code:

 

//Se crea una variable de tipo Reporte
            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.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 asignan los datos de labase de datos
            miReporte.DataSource = ds.Tables[0];
            //Se asigna el reporte al visualizador
            rrv_VistaReporte.ReportSource = miReporte;
            //Se refresca la vista
            rrv_VistaReporte.RefreshReport();

i create the report in the Report Designer but the error sends this

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
 
Información de versión: Versión de Microsoft .NET Framework:4.0.30319; Versión ASP.NET:4.0.30319.34248

Tags
General Discussions
Asked by
Carlos
Top achievements
Rank 1
Answers by
Ellis
Top achievements
Rank 1
Carlos
Top achievements
Rank 1
Share this question
or