private void FrmVisualizadorContrato_Load(object sender, EventArgs e)
        {
            //ReportDocument report = new ReportDocument();
            //report.Load("C:\\Users\\João\\Documents\\Video Aulas\\Canal Professor Drausion\\1° Temporada\\KISNER_EVENTOS\\Apresentacao\\Relatorios\\Contrato\\RelContrato.rpt");
            //string path = System.Reflection.Assembly.GetExecutingAssembly().Location;
            //report.Load("\\Relatorios\\Contrato\\RelContrato.rpt");
            Relatorios.Contrato.RelContrato report = new Relatorios.Contrato.RelContrato();

            ParameterFieldDefinitions crParameterFieldDefinitions;
            ParameterFieldDefinition crParameterFieldDefinition;
            ParameterValues crParameterValues = new ParameterValues();
            ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();

            crParameterDiscreteValue.Value = codEvento;
            crParameterFieldDefinitions = report.DataDefinition.ParameterFields;
            crParameterFieldDefinition = crParameterFieldDefinitions["ParCodEvento"];
            crParameterValues = crParameterFieldDefinition.CurrentValues;
            //trabalhando com os brinquedos escolhidos pelo usuário! Usando DataSet
            /*Relatorios.Contrato.DsEventoBrinquedo eb = new Relatorios.Contrato.DsEventoBrinquedo();
            DataTable brinquedos = eb.Tables.Add("DtBrinquedo");

            brinquedos.Columns.Add("codBrinquedo", Type.GetType("System.Int32"));
            brinquedos.Columns.Add("nome", Type.GetType("System.String"));

            BrinquedoColecao bc = new BrinquedoColecao();
            */

            crParameterValues.Clear();
            crParameterValues.Add(crParameterDiscreteValue);
            crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);

            crystalReportViewer1.ReportSource = report;
            crystalReportViewer1.Refresh();
        }
예제 #2
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     RelContrato rpt = new RelContrato();
     rpt.Site = this.Site;
     return rpt;
 }