Telerik Forums
Reporting Forum
1 answer
84 views
Hello all, i got problem passing string from default.aspx to report1.vb (telerik report code). Im using session to pass the string but it seems that report1.vb couldn't accept the string even when im using System.Web.HttpContext.Current.Session("name"). This is my code for defaultx.aspx and report1.vb

defaultx.aspx
<code>
 If DropDownList1.Text <> "Select" Then
            Session("name") = DropDownList1.SelectedValue.ToString
            Response.Redirect("Webform1.aspx")
        End If
</code>

report1.vb

InitializeComponent()
Dim valueFromDropdown As String = System.Web.HttpContext.Current.Session("name")
Dim objCommand As New SqlCommand
        
objCommand.CommandText = "SELECT * FROM student where Name='" + valueFromDropdown & "'"
objCommand.Connection = New SqlConnection("Data Source=(local)\FT2010;Initial Catalog=student;Integrated Security=True")
objCommand.Connection.Open()

FYI I have insert telerik reportviewer in Webform1.aspx and also set report location in its properties (telerik reportviewer) but when debugging, the error occured "exception has been thrown by the target of an invocation" and it points me to the System.Web.HttpContext.Current.Session("name") code in report1.vb

What im doing wrong here please guide me. Thanks!
Steve
Telerik team
 answered on 11 Oct 2011
1 answer
100 views
Hi,

I've followed this thread http://www.telerik.com/community/forums/reporting/telerik-reporting/bind-grouping-runtime.aspx and have downloaded the example (which works fine).  I've implemented the same techniques (as far as I know) in my own report, but when doing a preview, instead of getting a drop down box with a list of items that I can group by, I get a free text field.  If I enter a valid column name in this field, it works, but I would like my users to select from a drop down.
I've very likely missed something in your example, but I can't find which thing I need to change.

Thanks

Mick
Mick
Top achievements
Rank 1
 answered on 10 Oct 2011
0 answers
176 views
Hi' I'm working with telerik reporting q2 2010. My problem is the next:
I'm doing a master-detail report wich I generate on a button_click event
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using SistemaControlGuarderias.CJFBD;
using ModeloSolicitudesGuarderias;
using ClsGrals;
using System.Data.SqlClient;
using Reportes;
  
  
namespace SistemaControlGuarderias
{
    public partial class ConsultaReporte : System.Web.UI.Page
    {
         string sScript;
     byte circuito;
     short estado,ciudad;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
  
  
                var usuarioSession = (Usuario)Session["usuarioSesion"];
               
                Label3.Text = usuarioSession.NombreNPM;
  
                if (usuarioSession.RolRD == 2)
                {
                    Label4.Text = "ADMINISTRADOR CENDI CENTRAL";
                }
                llenaComboEstatus();
                llenaComboCto();
                
            }
        }
  
        private void llenaComboCto()
        {
            RadComboBox2.Items.Insert(0, new RadComboBoxItem(" Seleccionar ", "0"));
            RadComboBox2.Items.Insert(1, new RadComboBoxItem("1", "1"));
            RadComboBox2.Items.Insert(2, new RadComboBoxItem("2", "2"));
            RadComboBox2.Items.Insert(3, new RadComboBoxItem("3", "3"));
            RadComboBox2.Items.Insert(4, new RadComboBoxItem("4", "4"));
            RadComboBox2.Items.Insert(5, new RadComboBoxItem("5", "5"));
            RadComboBox2.Items.Insert(6, new RadComboBoxItem("6", "6"));
            RadComboBox2.Items.Insert(7, new RadComboBoxItem("7", "7"));
            RadComboBox2.Items.Insert(8, new RadComboBoxItem("8", "8"));
            RadComboBox2.Items.Insert(9, new RadComboBoxItem("9", "9"));
            RadComboBox2.Items.Insert(10, new RadComboBoxItem("10", "10"));
            RadComboBox2.Items.Insert(11, new RadComboBoxItem("11", "11"));
            RadComboBox2.Items.Insert(12, new RadComboBoxItem("12", "12"));
            RadComboBox2.Items.Insert(13, new RadComboBoxItem("13", "13"));
            RadComboBox2.Items.Insert(14, new RadComboBoxItem("14", "14"));
            RadComboBox2.Items.Insert(15, new RadComboBoxItem("15", "15"));
            RadComboBox2.Items.Insert(16, new RadComboBoxItem("16", "16"));
            RadComboBox2.Items.Insert(17, new RadComboBoxItem("17", "17"));
            RadComboBox2.Items.Insert(18, new RadComboBoxItem("18", "18"));
            RadComboBox2.Items.Insert(19, new RadComboBoxItem("19", "19"));
            RadComboBox2.Items.Insert(20, new RadComboBoxItem("20", "20"));
            RadComboBox2.Items.Insert(21, new RadComboBoxItem("21", "21"));
            RadComboBox2.Items.Insert(22, new RadComboBoxItem("22", "22"));
            RadComboBox2.Items.Insert(23, new RadComboBoxItem("23", "23"));
            RadComboBox2.Items.Insert(24, new RadComboBoxItem("24", "24"));
            RadComboBox2.Items.Insert(25, new RadComboBoxItem("25", "25"));
            RadComboBox2.Items.Insert(26, new RadComboBoxItem("26", "26"));
            RadComboBox2.Items.Insert(27, new RadComboBoxItem("27", "27"));
            RadComboBox2.Items.Insert(28, new RadComboBoxItem("28", "28"));
            RadComboBox2.Items.Insert(29, new RadComboBoxItem("29", "29"));
            RadComboBox2.Items.Insert(30, new RadComboBoxItem("30", "30"));
            RadComboBox2.Items.Insert(31, new RadComboBoxItem("31", "31"));
        }
  
        private void llenaComboEstatus()
        {
            RadComboBox1.Items.Insert(0, new RadComboBoxItem(" Seleccionar ", "0"));
        }
  
        protected void RadComboBox2_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
              
            circuito = Convert.ToByte(RadComboBox2.SelectedValue);
            if (RadComboBox2.SelectedIndex==0)
            {
                Session["RepCircuito"] = Convert.ToInt32(0);
                  
            }
  
            Session["RepCircuito"] = circuito;
         //   Session["RepStatus"] = "";
            var EdosContext = new BD_INSTEntities();
  
        }
  
        protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            //if(RadComboBox1.SelectedIndex ==0)
            //{
                  
            //    Session["RepStatus"] = null;
            //}
            //else
            //{
                Session["RepStatus"] = RadComboBox1.SelectedValue;
           // Session["RepCircuito"] = "0";
             
  
            //}
  
        }
        private void Alerta(string sMensaje)
        {
            sScript = "<script>javascript:alert(' :: ";
            sScript += sMensaje;
            sScript += " ::');</script>";
            Controls.Add(new LiteralControl(sScript));
        }
  
        protected void btnGeneraRep_Click(object sender, EventArgs e)
        {
           
            if(Session["RepStatus"] != null && Session["fecha1"] == null && Session["fecha2"] == null ) 
            {
                Alerta("Elige un rango de fechas");
                
                RadDatePicker1.SelectedDate = null;
                RadDatePicker2.SelectedDate = null;
                RadComboBox1.ClearSelection();
                RadComboBox2.ClearSelection();
                //Session["RepStatus"] = null;
                //Session["RepCircuito"] = null;
                return;
            }
           if (Session["RepStatus"] == null && Session["fecha1"] == null && Session["fecha2"] == null && Session["RepCircuito"] == null)
           {
               Alerta("Selecciona solo los campos que se te piden");
  
               RadDatePicker1.SelectedDate = null;
               RadDatePicker2.SelectedDate = null;
               RadComboBox1.ClearSelection();
               RadComboBox2.ClearSelection();
               //Session["RepStatus"] = null;
               //Session["RepCircuito"] = null;
               return;
           }
  
           if (Session["RepStatus"] == null && Session["fecha1"] != null && Session["fecha2"] != null && Session["RepCircuito"] == null)
           {
               Alerta("Selecciona solo los campos que se te piden");
  
               RadDatePicker1.SelectedDate = null;
               RadDatePicker2.SelectedDate = null;
               RadComboBox1.ClearSelection();
               RadComboBox2.ClearSelection();
               //Session["RepStatus"] = null;
               //Session["RepCircuito"] = null;
               return;
           }
  
  
           if (Session["RepCircuito"]!= null && Session["RepStatus"] == null && Session["fecha1"] == null && Session["fecha2"] == null)
           {
               Response.Write("<script type='text/javascript'>detailedresults=window.open('iuReportexCriterio.aspx');</script>");
               RadDatePicker1.SelectedDate = null;
               RadDatePicker2.SelectedDate = null;
               RadComboBox1.ClearSelection();
               RadComboBox2.ClearSelection();
               return;
           }
  
  
  
           if (Session["RepStatus"].ToString() != "0" && Session["fecha1"] != null && Session["fecha2"] != null )
           {
               Response.Write("<script type='text/javascript'>detailedresults=window.open('iuReportexCriterio.aspx');</script>");
  
               RadDatePicker1.SelectedDate = null;
               RadDatePicker2.SelectedDate = null;
               RadComboBox1.ClearSelection();
               RadComboBox2.ClearSelection();
  
               return;
  
           }
  
  
            
            
             
            if (Session["RepStatus"].ToString() != "0" && Session["fecha1"] != null && Session["fecha2"] != null && RadComboBox2.SelectedIndex!=0)
            {
                Response.Write("<script type='text/javascript'>detailedresults=window.open('iuReportexCriterio.aspx');</script>");
  
  
                RadDatePicker1.SelectedDate = null;
                RadDatePicker2.SelectedDate = null;
                RadComboBox1.ClearSelection();
                RadComboBox2.ClearSelection();
                //Alerta("Selecciona solo los campos que se te piden");
                //RadDatePicker1.SelectedDate = null;
                //RadDatePicker2.SelectedDate = null;
                //RadComboBox1.ClearSelection();
                //RadComboBox2.ClearSelection();
                ////Session["RepStatus"] = null;
                ////Session["RepCircuito"] = null;
                return;
            }
            if (Session["RepStatus"].ToString() != "0" && Session["fecha1"] != null && Session["fecha2"] != null  )
            {
                Response.Write("<script type='text/javascript'>detailedresults=window.open('iuReportexCriterio.aspx');</script>");
  
  
                RadDatePicker1.SelectedDate = null;
                RadDatePicker2.SelectedDate = null;
                RadComboBox1.ClearSelection();
                RadComboBox2.ClearSelection();
                //Session["RepCircuito"] = null;
                //Session["fecha1"] = null;
                //Session["fecha2"] = null;
                //Session["RepStatus"] = null;
                return;
  
            }
  
            
  
            
            else
           
            {
                Alerta("Selecciona un Estatus y rango de fechas ");
           
            }
            RadDatePicker1.SelectedDate = null;
            RadDatePicker2.SelectedDate = null;
            RadComboBox1.ClearSelection();
            RadComboBox2.ClearSelection();
              
        }
  
        protected void RadDatePicker1_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
        {
            Session["fecha1"] = RadDatePicker1.SelectedDate;
        }
  
        protected void RadDatePicker2_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
        {
            Session["fecha2"] = RadDatePicker2.SelectedDate;
        }
  
        protected void RadMenu1_ItemClick(object sender, RadMenuEventArgs e)
        {
            if (e.Item.Text == "SALIR")
            {
  
  
                FormsAuthentication.SignOut();
                Session.Abandon();
                Response.Redirect("iuLogin.aspx");
            }
        }
  
        protected void RadComboBox1_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
        {
  
            if (e.Item.Text == "Registrada")
            {
                e.Item.Text = "Registradas/En Lista de Espera";
  
            }
        }
    }
}
Depending of the values of the comboboxes will be the parameters of the report, amd as you can see in the btnGeneraRep_Click event if conditions are valid, it opens a new page whose code behind is the next
    public partial class iuReportexCriterio : System.Web.UI.Page
    {
        string parametro;
        private DateTime fecha1, fecha2;
        private string sScript;
         
  
        protected void Page_Load(object sender, EventArgs e)
        {
            //int total = Convert.ToInt32(Session["ReportSource"].ToString());
            //parametro = Convert.ToString(Session["RepStatus"].ToString());
            int parametro2 = (Convert.ToInt32(Session["RepCircuito"]));
            //string parametro = Session["RepStatus"].ToString();
            //Session["RepStatus"] = "Registrada";
            //if (parametro2 != 0&& Session["RepCircuito"] == null&&Session["fecha1"]== null&&Session["fecha2"] == null)
            //{
  
            //    var report = new CriterioReporte2(parametro2);
            //    report.ReportParameters.Add("Circuito", ReportParameterType.Integer, parametro2);
            //    ReportViewer1.Report = report;
            //    Session["RepStatus"] = null;
            //    Session["RepCircuito"] = null;
            //    Session["fecha1"] = null;
            //    Session["fecha2"] = null;
            //    return;
            //}
  
  
            if (Session["RepStatus"]!=null && Session["fecha1"] != null && Session["fecha2"] != null  )
            {
                 parametro = Session["RepStatus"].ToString();
                //fecha1 = (DateTime) Session["fecha1"];
                //fecha2 = (DateTime) Session["fecha2"];
                var concentrado = new RepConcentrado();
  
                //if (total == 0)
                ////if (concentrado.Report.DataSource == null)
                //{
                //    Alerta("NO hay registros con el criterio seleccionado");
                //    Response.Write("<script type='text/javascript'>detailedresults=window.close('iuReportexCriterio.aspx');</script>");
                    
                //}
                
                ReportViewer1.Report = concentrado;
                Session["RepStatus"] = null;
                Session["RepCircuito"] = null;
                Session["fecha1"] = null;
                Session["fecha2"] = null;
                return;
            }
            
        
            if (!IsPostBack)
            {
                if (parametro != "" )
                {
  
  
  
                    var report = new CriterioReporte(parametro, fecha1, fecha2);
                    //var totales = new ReoTotales(parametro2, fecha1, fecha2);
                    //var concentrado = new RepConcentrado();
                    report.ReportParameters.Add("Estatus", ReportParameterType.String, parametro);
                    report.ReportParameters.Add("fecha1", ReportParameterType.DateTime, fecha1);
                    report.ReportParameters.Add("fecha2", ReportParameterType.DateTime, fecha2);
                 //   totales.ReportParameters.Add("Circuito", ReportParameterType.Integer, parametro2);
                      
                    ReportViewer1.Report = report;
  
                }
  
                if (parametro2 != 0 && parametro==null)
                {
                    var report = new CriterioReporte2(parametro2);
                    report.ReportParameters.Add("Circuito", ReportParameterType.Integer, parametro2);
                    ReportViewer1.Report = report; 
                }
            }
            Session["RepCircuito"] = null;
            Session["fecha1"] = null;
            Session["fecha2"] = null;
            Session["RepStatus"] = null;
        }
        private void Alerta(string sMensaje)
        {
            sScript = "<script>javascript:alert(' :: ";
            sScript += sMensaje;
            sScript += " ::');</script>";
            Controls.Add(new LiteralControl(sScript));
        }
    }
}
Here's is where I call the report. Repconcentrado is a Master-Detail report where the master report is called criterioreport(the code below) and reptoteles wich contains the count result of sorted by "Circuito"


What I want to do is when clicking  btnGeneraRep_Click  in the first page send an alert wich says that there's no data under the specified criteria and do not redirect to the second page.

Here's the code of my report
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Telerik.Reporting;
using Telerik.Reporting.Drawing;
using ModeloSolicitudesGuarderias;
using System.Linq;
using System.Web;
namespace Reportes
{
   
     
    /// <summary>
    /// Summary description for CriterioReporte.
    /// </summary>
    public partial class CriterioReporte : Telerik.Reporting.Report
    {
        short claveEdo, claveCd;
         int circuito;
         //private List<Menor> RepMenores
         //{
         //    get
         //    {
         //        if (HttpContext.Current.Session["RepMenores"] == null)
         //        {
         //            var _RepMenores = new List<Menor>();
         //            HttpContext.Current.Session["RepMenores"] = _RepMenores;
         //        }
         //        return (List<Menor>)HttpContext.Current.Session["RepMenores"];
         //    }
         //    set { HttpContext.Current.Session["RepMenores"] = value; }
  
         //}
  
        public CriterioReporte(string Estatus,DateTime fecha,DateTime fecha2)
        {
             
       
            InitializeComponent();
            if (fecha != fecha2)
            {
                var bdsseguaReporte = new BD_SSEGUAEntities();
                var query = from m in bdsseguaReporte.Menores
  
                            where
                                ((m.Solicitud.CTEdoSolicitud.fcDescEdoSol == Estatus) &&
                                 ((m.fdFchRegMenor >= fecha.Date && m.fdFchRegMenor <= fecha2.Date)))
  
                            select m;
                   Report.DataSource = query;
  
                //if (query.Count() > 0)
                //{
                //    RepMenores.Add(query as Menor);
                      
                //}
  
  
            }
  
            //if (RepMenores.Count() == 0)
            //{
            //    //Report.DataSource = null;
            //    HttpContext.Current.Session["ReportSource"] =RepMenores.Count();
            //}
            //else
            //{
            //    Report.DataSource = RepMenores;
            //    return;
            //}
  
  
  
            if (fecha == fecha2)
            {
                var fech2 = fecha2.AddDays(1);
                var bdsseguaReporte = new BD_SSEGUAEntities();
                Report.DataSource = from m in bdsseguaReporte.Menores
  
                                    where
                                        ((m.Solicitud.CTEdoSolicitud.fcDescEdoSol == Estatus) &&
                                         ((m.fdFchRegMenor >= fecha.Date && m.fdFchRegMenor <= fech2)))
  
                                    select m;
  
            }
  
            textBox25.Value = "Periodo: del" +" "+ fecha.ToShortDateString() +" "+ "al" +" "+ fecha2.ToShortDateString();
            textBox24.Value = "Fecha:"+" "+DateTime.Now.ToShortDateString();
            //textBox31.Value = "Registradas/En Lista de Espera";
            // TODO: Add any constructor code after InitializeComponent call
            //
             
        }
  
          
        private void textBox8_ItemDataBound(object sender, EventArgs e)
        {
  
            claveEdo = Convert.ToInt16((sender as Telerik.Reporting.Processing.TextBox).Value);
            var bdinstContext = new BD_INSTEntities();
            var estado = (from edo in bdinstContext.Cat_Edo
                          where edo.cve_edo == claveEdo
                          select edo).First();
  
            (sender as Telerik.Reporting.Processing.TextBox).Value = estado.nom_edo;
        }
  
        private void textBox9_ItemDataBound(object sender, EventArgs e)
        {
            claveCd = Convert.ToInt16((sender as Telerik.Reporting.Processing.TextBox).Value);
            var bdinstContext = new BD_INSTEntities();
            var ciudad = (from cd in bdinstContext.Cat_cd
                          where (cd.cve_cd == claveCd) && (cd.cve_edo == claveEdo)
                          select cd).First();
  
            (sender as Telerik.Reporting.Processing.TextBox).Value = ciudad.nom_cd;
        }
  
        private void groupHeaderSection1_ItemDataBound(object sender, EventArgs e)
        {
            //var section = (sender as Telerik.Reporting.Processing.GroupSection);
            //var txtCirc = (Telerik.Reporting.Processing.TextBox)section.ChildElements.Find("textBox28", false)[0];
            //List<int> list = null;
            //var circuito = Convert.ToInt32(txtCirc);
            //list.Add(circuito);
             
              
            //System.Web.HttpContext.Current.Session["txtCirc"] = txtCirc;
  
        }
  
        private void textBox31_ItemDataBound(object sender, EventArgs e)
        {
            //if(textBox31.Value=="Registrada")
            //{
            //    textBox31.Value = "Registradas/En Lista de Espera";
            //}
        }
  
        private void reportHeaderSection1_ItemDataBound(object sender, EventArgs e)
        {
            var section = (sender as Telerik.Reporting.Processing.ReportSection);
            if (section != null)
            {
                var txtStatus = (Telerik.Reporting.Processing.TextBox)section.ChildElements.Find("textBox31", false)[0];
                if (txtStatus.Text == "Registrada")
                {
                    txtStatus.Value = "Registradas/En Lista de Espera";
                }
            }
        }
  
   
    }
}

Hope yor help.
Regards Cristian.
Cristian
Top achievements
Rank 1
 asked on 07 Oct 2011
10 answers
981 views
Hello,

I have a (hopefully) easy question/problem:

I am using an objectdatasource to populate a Telerik Report. This is working fine. Now I want to change one of the parameters of the select function in the DataSource to accept a multi-value parameter (multiple ints), but regardless what I try as type (object, object[], int[]), I always get the error that the following error during creation of the report:

An error has occured while processing Table 'crosstab1':
An error has occured while resolving 'MyObjectSource' data source: Ein Objekt muss IConvertible implementieren.
The last error translates to "an object has to implement IConvertible".

I even changed the parameter of the function in the objectdatasource to type IConvertible, with no luck.

What am I doing wrong to get multivalue parameters to work?

BTW: I am still at Q1 2010 release and have not yet updated to Q2

best regards

Ulrik
Roy Halvorsen
Top achievements
Rank 1
 answered on 07 Oct 2011
7 answers
1.6K+ views
I am trying to write a simple report with one parameter. The data field that I am using as a parameter, contains Null values. When I try to run the report, I get the error: An error has occured while processing Report": Object cannot be cast from DBNull to other types.

The field column is a date field.

If I remove the parameter, the report works. How do I get around the Null values?

This is a class in a VB.Net project, not an ASP.Net page.

Adam
Top achievements
Rank 1
 answered on 06 Oct 2011
2 answers
458 views
I have the filters for my textbox set up this way:

             =Fields.LeaseType         =      =Parameters.DealTypeId.Value
AND      =Fields.MedicalEntityId     =      =Parameters.MedicalEntity.Value

However, MedicalEntityId is a nullable value in the database, and I just want it to display the records where the MedicalEntityId is null when I don't specify a value for it in the dropdown list under the preview tab.

When I add in the second parameter and I try to run the report, I get this error: "Object cannot be cast from DBNull to other types." 

My initial thought was to change the second filter expression this way :

AND     =Fields.MedicalEntityId     =       =IsNull(Parameters.MedicalEntity.Value, Null)

but I get the same result with that. What am I missing?
Nick
Top achievements
Rank 1
 answered on 06 Oct 2011
1 answer
186 views

Sorry if I mistake with forum, I don't know where post this question.

So my question is, can I use Telerik Reporting with Oracle APEX.

Again sorry.

Thanks.

Peter
Telerik team
 answered on 06 Oct 2011
1 answer
183 views
Error:
A connection string was referenced by name but could not be resolved through the web.config.

I am running into this on my reporting project.  In my web.config file I have:
<connectionStrings configSource="sql.config"/>

And in the sql.config I have:
<add name="BarcodeEntityDiagrams" connectionString="data source=ERICWIN7-PC\SQLEXPRESS;initial catalog=Barcode;integrated security=True"
  providerName="System.Data.SqlClient" />

I create a brand new report, add a OpenAccessDataSource using the wizard and point the connection string to BarcodeEntityDiagrams.  When I go to the Preview tab of the report I get the error:
An error has occurred while processing Report 'VendorDetails':
Exception has been thrown by the target of an invocation.
------------- InnerException -------------
System.Configuration.ConfigurationErrorsException: A connection string was referenced by name 'Barcode' but could not be resolved through the web.config or the executables app.config file.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.connect(ConnectionString connectionString, IDictionary driverProps)
at OpenAccessRuntime.Relational.sql.SqlDriver.InitializeFor(ConnectionString connectionString, Boolean noConnect, PropertySet props, Driver& driver, Connection& conn)
at OpenAccessRuntime.Relational.RelationalStorageManagerFactory..ctor(StorageManagerFactoryBuilder b)
at OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createSmfForURL()
------------- InnerException -------------
A connection string was referenced by name 'Barcode' but could not be resolved through the web.config or the executables app.config file

Again, this is a brand new report using the report wizard. No custom code at all.  Any suggestions? I'm using Reporting 5.1.11.713



Steve
Telerik team
 answered on 06 Oct 2011
1 answer
148 views
I'm evaluating reports and I'm stuck. I need to generate a report over multiple days gathering data from csv files. My plan is to read in all the data and parse it into classes. From there I create a reportbook and add a report per day. On the report I would like to show something like the attached image.

http://www.telerik.com/ClientsFiles/304709_example-report.png

Here are the two data models I was planning to use.

public class IntervalApproachModel
{
    public IntervalApproachModel()
    {
        Northbound = new ApproachCountModel();
        Eastbound = new ApproachCountModel();
        Southbound = new ApproachCountModel();
        Westbound = new ApproachCountModel();
        Unassigned = new ApproachCountModel();
    }
 
    public DateTime Time
    {
        get;
        set;
    }
 
    public ApproachCountModel Northbound
    {
        get;
        set;
    }
 
    public ApproachCountModel Eastbound
    {
        get;
        set;
    }
 
    public ApproachCountModel Southbound
    {
        get;
        set;
    }
 
    public ApproachCountModel Westbound
    {
        get;
        set;
    }
 
    public ApproachCountModel Unassigned
    {
        get;
        set;
    }
}
 
    public class ApproachCountModel
    {
        public ApproachTypes ApproachType
        {
            get;
            set;
        }
 
        public int Left
        {
            get;
            set;
        }
 
        public int Right
        {
            get;
            set;
        }
 
        public int UTurn
        {
            get;
            set;
        }
 
        public int Through
        {
            get;
            set;
        }
 
        public int Peds
        {
            get;
            set;
        }
 
        public int Total
        {
            get
            {
                return Left + Right + UTurn + Through + Peds;
            }
        }
    }

When I create the report I call a setup method that takes a model with all the count data for the date. When the report calls the NeedDataSource event I parse the data into time slices and fill an IntervalApproachModel with all the counts during that time slice. I set the data source to a list of IntervalApproachModels.

I was trying to use a crosstab but I can't seem to get it to appear like the image. Is this the correct way to achieve my goal? How can I set up the crosstab to display correctly?
Andrew
Top achievements
Rank 2
 answered on 06 Oct 2011
1 answer
278 views
I have designed my first report. Data connection was created via the wizard and works fine in the preview mode. However when trying to launch the report via a webviewer on an aspx page, it is unable to connect to the database. The error says:

An error has occurred while processing Report 'RTARevenues':
Unable to establish a connection to the database. Please, verify that your connection string is valid. In case you use a named connection string from the application configuration file, make sure the name is correct and the connection string settings are present in the configuration file of your application.
------------- InnerException -------------
Format of the initialization string does not conform to specification starting at index 0.

I tried copying the connection string used elsewhere in the project into the app.config file and using it for the report but that did not work either.
What do I need to do to get this to work?
Thanks
Steve
Telerik team
 answered on 06 Oct 2011
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?