Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var report = new rptTestimonial();

            ParameterValues pvValues = new ParameterValues();

            ParameterDiscreteValue pdvDiscreteValue = new ParameterDiscreteValue();

            pdvDiscreteValue.Value = textBox1.Text;

            pvValues.Add(pdvDiscreteValue);

            ParameterFieldDefinitions pfdDefinitions = report.DataDefinition.ParameterFields;

            ParameterFieldDefinition prdDefinition = pfdDefinitions["textThing"];

            prdDefinition.ApplyCurrentValues(pvValues);
            /*var data =
                Database.Row("learner_details a, enrollments b, enrollmentscourses c, courses d",
                             "a.Division = '" + clsGlobal.loggedOnUserDivison + "' AND a.LearnerNumber = '" +
                             number.Selection +
                             "' AND b.LearnerKey = a.LearnerKey AND c.idEnrollments = b.idEnrollments AND" +
                             " d.idCourses = c.idCourses");*/
            report.DataDefinition.FormulaFields["mainText"].Text = "\"" + textBox1.Text + "\"";
            report.DataDefinition.FormulaFields["principle"].Text = "\"" + GlobalProperties.DivisionPrinciple + "\"";
            report.DataDefinition.FormulaFields["name"].Text = "\"" +  learner["Surname"] + ", " + learner["name"]+ "\"";
            report.DataDefinition.FormulaFields["learnerNumber"].Text = "\"" + number + "\"";
            //report.DataDefinition.FormulaFields["respParty"].Text = "\"" + clsGlobal.loggedOnUser + "\"";
            //report.DataDefinition.FormulaFields["course"].Text = "\"" + Convert.ToString(data["Name1"]) + "\"";

            //logs.WriteXml(@"C:\tmpXml.xml");
            var frmReport = new frmReport(report) { Text = "Testimonial" };
            frmReport.ShowDialog();
        }
Ejemplo n.º 2
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     rptTestimonial rpt = new rptTestimonial();
     rpt.Site = this.Site;
     return rpt;
 }