Telerik Forums
Reporting Forum
3 answers
88 views
Hi,

I have been having a problem displaying a simple report in a winforms app with the report viewer. I followed the tutorial videos, but do not know what is going wrong.

Below is what I get when I select the Report Property of the Report Viewer. In the video, the reports would show up in this list. The name of the report I want to appear in this list is TestReport.cs





Below is how my solution is setup:



And since I could not select my report via the property menu, I tried to do it in code like this, which also failed:



And finally, here is the error I am getting when running the app and click refresh.




My main question is, how do I set the report via the report property of the report viewer?

My second question is, how do I set which report to show via code?

Thanks in advance
ajpetersen
Top achievements
Rank 1
 answered on 27 Sep 2011
4 answers
94 views
Hello Telerik,
I'm using 5.1.11.713, and I'm developing a new report, when I print or export it I don't see a subreport (and a field filled with .Value property)
If I set UseNativePrinting to true it prints it....
the only strange thing I'm doing is so :

if (tipoLegame != -1)
         {
             switch (tipoLegame)
             {
                 case 0:
                     subReportAnagrafica.ReportSource = new SubPersonaFisica();
                     break;
                 case 1:
                     subReportAnagrafica.ReportSource = new SubPersonaGiurica();
                     break;
                 case 2:
                     subReportAnagrafica.ReportSource = new SubSCO();
                     break;
             }
 
             subReportAnagrafica.ReportSource.DataSource = dettagli;
             SetField(dettagli.Field);
 
             var risultatoDomande = reportFactory.GetListaDomandeRisposteUtente(IDUtente, IDQuestionario);
             this.table1.DataSource = risultatoDomande;

Any suggestion? I'm calling it from silverlight

...
 
  public ReportGen(int idQuestionario,int idCliente)
        {
            InitializeComponent();
 
            this.IDQuestionario = idQuestionario;
            this.IDCliente = idCliente;
 
            reportViewer.ReportServiceClientFactory = this;
            reportViewer.Report = myreport;
 
            if (CanUserExportToExcel())
            {
 
                btnEsporta.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                btnEsporta.Visibility = System.Windows.Visibility.Collapsed;
            }
 
            this.reportViewer.RenderBegin += new RenderBeginEventHandler(reportViewer_RenderBegin);
            this.Closed += new EventHandler<WindowClosedEventArgs>(DettaglioReportCliente_Closed);
        }
 
    private void reportViewer_RenderBegin(object sender, RenderBeginEventArgs args)
        {
            args.ParameterValues[STR_PARAM_QUESTIONARIO] = IDQuestionario;
            args.ParameterValues[STR_PARAM_IDUSER] = App.UtenteLoggato.IDInterno;
            args.ParameterValues[STR_PARAM_IDCLIENTE] = IDCliente;
        }
Steve
Telerik team
 answered on 27 Sep 2011
1 answer
382 views
Good .. I am new to telerik reporting, I am studying the Free version, because  I'm search of a reporting application to implement in my project.

1 - Suppose, that I have records of patients in a sanatorium, and I have to print each on a separate medical history ... I can be done with telerik reporting.

2 - I would place a subreport in report at the bottom of the page, to appear at the end of each sheet. in the footnotes.

3 - If possible create events, that run in each cycle of a new line generation of reports. where specific activities.

4 - You can change position and change the size, using a base value of database, example:
  if (data.name == true)
        textbox.location = (data.X, data.Y);
        textBox.Size = (data.W, data.H);


excuse my bad English, so my ideas in Spanish writing to explain better.

------ Spanish.

1 - Supongamos, que tengo Historias Clinicas de Pacientes en un Sanatorio, y tengo que imprimir cada historia clinica en hoja separada... se puede realizar con telerik reporting.

2 - Se puede colocar en un reporte un subreporte en la parte inferior de la pagina, con el fin de que aparezca al final de todas las hojas. en el pies de pagina.

3 - Si es posible, crear eventos que se ejecutan en cada ciclo del reporte en la generación de una nueva línea de informes (detail) y realice actividades específicas.

4 - Se puede cambiar de posición y cambiar el tamaño te un TextBox, tomando de referencia un valor la base de datos, por ejemplo:
 if (data.name == true)  
       textbox.location= (data.X, data.Y);
       textBox.Size=(data.W, data.H);
 
5 - Telerik report me permite asociar en un solo PDF, varios reportes. me explico
Se solicita los reporte del un dortor, el doctor tienes asociados un conjunto de pacientes, ellos un conjuntos de reportes según el caso. la idea es que se quiere generar un reporte que contenga todos los reportes que se llame desde el doctor.
(Me enredo explicando esta idea en ingles.)

Steve
Telerik team
 answered on 27 Sep 2011
1 answer
112 views
hello, i'm a newbie for telerik..
i get the task which i need to get the field from dataset to put in my telerik report but i dont know how to do that. i tried to bind the dataset but still didnt work. can somebody help me? thanks..
Steve
Telerik team
 answered on 27 Sep 2011
3 answers
228 views
I have a series of reports that depend on a variety of differing SQL queries. They vary by joins and several other criteria, so simple parameter substitution is not an option. I need to set the SQL Select Command at the time the report is initiated on the ASPX page that contains the Report Viewer.

In another thread, I have found out how to access certain report variables using the following technique:


Dim
report As Telerik.Reporting.Report = DirectCast(Me.ReportViewer1.Report, Telerik.Reporting.Report)

 

 

 

Dim txt As Telerik.Reporting.TextBox = TryCast(report.Items.Find("titleTextBox", True)(0), Telerik.Reporting.TextBox)
 

 

 

txt.Value = "

 

Updated Title Text"

How would I do the equivalent for the Datasource name, connection string or select command?

I need a clue as to the syntax and form, as the above "find" for a text control doesn't seem to apply.

 

 

 

 

 

Steve
Telerik team
 answered on 27 Sep 2011
6 answers
415 views
I have an existing .NET web application and currently working on implementing Telerik reports in it. Is it better to create reports in the same web application or to create a reports class library and then call them from the application? What are the pros and cons for each approach?
Steve
Telerik team
 answered on 27 Sep 2011
4 answers
394 views
I have laid out a table with the bottom row being empty. On the table_DataBound method, I am inserting text into that field. That field could be 50-100 lines of text. I am trying to align the report such that every item in the datasource (bound to my table) is on its own page (ie each processed table is on its own page).

I have attached some png's of the current output (each page of the resulting pdf).

Any help would be appreciated.
Kris
Top achievements
Rank 1
 answered on 26 Sep 2011
2 answers
119 views
Hi all,
I need some inspiration to create a report catalog that would contain multiple catalogs, sort of a Report Book of Catalogs.
For ex: Catalog A is for Sales would contain 3 distinct reports, B is for Billing would contain 5 reports, C is for Receivables....
Any suggestions would be appreciated.

Jack
Jack
Top achievements
Rank 1
 answered on 26 Sep 2011
0 answers
122 views
Hi, guys I'm trying to create a master detail report like invoice report and I'm getting the next error mesagge when I try to set de subreport reportsource. "Constructor on type 'Reportes.CriterioReporte' not found". The main report is named "RepConcentrado" and the two reports that will be master and detail are named 'CriterioReporte' wich has 3 parameters(string status, DateTime date1,DateTime date2) and "reoTotales which has (int CountryId,DateTime date1, DateTime date2).

 I followed the subreport video from telerik tv but in At the moment I try to set the report datasource the message comes out.
Here's the code for each report
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Telerik.Reporting;
using Telerik.Reporting.Drawing;
using ModeloSolicitudesGuarderias;
using System.Linq;
namespace Reportes
{
   
     
    /// <summary>
    /// Summary description for CriterioReporte.
    /// </summary>
    public partial class CriterioReporte : Telerik.Reporting.Report
    {
        short claveEdo, claveCd;
  
        public CriterioReporte(string Estatus,DateTime fecha,DateTime fecha2)
        {
             
       
            InitializeComponent();
            ////
            
            var bdsseguaReporte = new BD_SSEGUAEntities();
            Report.DataSource = from m in bdsseguaReporte.Menores
  
                                where (m.Solicitud.CTEdoSolicitud.fcDescEdoSol == Estatus && (m.fdFchRegMenor>=fecha &&m.fdFchRegMenor<= fecha2 ))
                                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;
        }
  
        
  
          
    }
}
This part willbe the master section
 And this the detail section
namespace Reportes
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using Telerik.Reporting;
    using Telerik.Reporting.Drawing;
    using System.Linq;
    using ModeloSolicitudesGuarderias;
  
  
    /// <summary>
    /// Summary description for ReoTotales.
    /// </summary>
    public partial class ReoTotales : Telerik.Reporting.Report
    {
        public ReoTotales(int Circuito,DateTime fecha,DateTime fecha2)
        {
             
            //
            // Required for telerik Reporting designer support
            //
            InitializeComponent();
            ////
            
            var bdsseguaReporte = new BD_SSEGUAEntities();
            Report.DataSource = from m in bdsseguaReporte.Menores
  
                                where (m.Solicitud.CTEdoSolicitud.fcDescEdoSol == "Registrada" && (m.fdFchRegMenor>=fecha &&m.fdFchRegMenor<= fecha2 )&& m.Solicitud.fiCircuito==Circuito)
                                select m;
            textBox13.Value = "Solicitudes recibidas durante el periodo"+" "+"del" +" "+ fecha.Date.ToShortDateString() + "al" +" "+ fecha2.Date.ToShortDateString();
            //table1.DataSource = Report.DataSource;
            //table1.Visible = true;
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
    }
}


Hope you could help.
Cristian
Top achievements
Rank 1
 asked on 26 Sep 2011
1 answer
90 views
One website the reports show up perfectly; however, on another website (because we have clients on the other side of the world so we have 2 sites with same exact code) i get the error "one or more parameters are not set or have invalid values".

I have compared the web.config files and they are the same also, except for sql server names based on which website it is...no cross domain stuff going on.

So why would this happen? Are there configuration issues that the website host needs to resolve or????

Other data displays work great it is just when I try to display a report.

Thanks,
Richard

Steve
Telerik team
 answered on 26 Sep 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?