Exemple #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            or rpt = new or();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemple #2
0
        private void OrReport_Load(object sender, EventArgs e)
        {
            DateTime aDate = DateTime.Now;
            int      _;

            if (int.TryParse(tot + "", out _))
            {
                numWord = NumberToWords(int.Parse(tot + ""));
            }
            else
            {
                double newTot    = Math.Floor(tot);
                int    decplaces = (int)(((decimal)tot % 1) * 100);

                numWord = NumberToWords(int.Parse(newTot + ""));
                numWord = decplaces > 0 ? numWord + getDecPlacesWord(decplaces) : numWord;
            }



            or rep = new or();

            rep.SetParameterValue("orNoParam", orno.ToString());
            rep.SetParameterValue("wordNumberparam", numWord);
            rep.SetParameterValue("totalParam", tot);
            rep.SetParameterValue("studentName", name);
            rep.SetParameterValue("DateNow", aDate.ToString("MM/dd/yyyy"));
            rep.SetParameterValue("cashierName", UserLog.getFullName());

            if (misc == "" || misc == null && part == "enrollment")
            {
                rep.SetParameterValue("part1", "Tuition Payment:");
                rep.SetParameterValue("part2", "");
            }
            else
            {
                rep.SetParameterValue("part1", "Tuition");
                rep.SetParameterValue("part2", "Misc");
            }

            if (part == "balance")
            {
                rep.SetParameterValue("part1", "Balance Payment:");
                rep.SetParameterValue("part2", "");
            }

            if (part == "reservation")
            {
                rep.SetParameterValue("part1", "Reservation Payment:");
                rep.SetParameterValue("part2", "");
            }

            if (reservation > 0)
            {
                rep.SetParameterValue("part4", "Reservation");
                string reserveString = "PHP " + reservation;
                rep.SetParameterValue("part4value", reserveString);
            }

            if (disc > 0)
            {
                rep.SetParameterValue("part3", "Discount");
                string discString = "PHP " + disc;
                rep.SetParameterValue("part3value", discString);
            }

            rep.SetParameterValue("partvalue1", tuition);
            rep.SetParameterValue("partvalue2", misc);


            rep.SetParameterValue("totalpart", total);
            crystalReportViewer1.ReportSource = rep;
        }