private void buatLaporanByQuery(object laporan, DateTime startTime, DateTime endTime)
        {
            ReportForm reportForm = new ReportForm(main);

            reportForm.MdiParent   = main;
            reportForm.WindowState = FormWindowState.Maximized;

            reportForm.GetCrystalReportViewer().ReportSource = laporan;

            ParameterField         field1 = new ParameterField();
            ParameterDiscreteValue value1 = new ParameterDiscreteValue();

            field1.Name  = "startTime";
            value1.Value = startTime;
            field1.CurrentValues.Add(value1);

            ParameterField         field2 = new ParameterField();
            ParameterDiscreteValue value2 = new ParameterDiscreteValue();

            field2.Name  = "endTime";
            value2.Value = endTime;
            field2.CurrentValues.Add(value2);

            ParameterFields fields = new ParameterFields();

            fields.Add(field1);
            fields.Add(field2);

            reportForm.GetCrystalReportViewer().ParameterFieldInfo = fields;
            reportForm.GetCrystalReportViewer().Refresh();
            reportForm.Show();
        }
Пример #2
0
        private void buatLaporanByQueryStock(object laporan, Boolean blank)
        {
            ReportForm reportForm = new ReportForm(main);

            reportForm.MdiParent   = main;
            reportForm.WindowState = FormWindowState.Maximized;

            reportForm.GetCrystalReportViewer().ReportSource = laporan;

            ParameterField         field1 = new ParameterField();
            ParameterDiscreteValue value1 = new ParameterDiscreteValue();

            field1.Name  = "blank";
            value1.Value = blank;
            field1.CurrentValues.Add(value1);

            ParameterFields fields = new ParameterFields();

            fields.Add(field1);

            reportForm.GetCrystalReportViewer().ReportSource       = laporan;
            reportForm.GetCrystalReportViewer().ParameterFieldInfo = fields;
            reportForm.GetCrystalReportViewer().Refresh();
            reportForm.Show();
        }
        private void buatLaporanByQuery(object laporan)
        {
            ReportForm reportForm = new ReportForm(main);

            reportForm.MdiParent   = main;
            reportForm.WindowState = FormWindowState.Maximized;

            reportForm.GetCrystalReportViewer().ReportSource = laporan;
            reportForm.GetCrystalReportViewer().Refresh();
            reportForm.Show();
        }