예제 #1
0
        private void InformeUsuari_Load(object sender, EventArgs e)
        {
            UsuarisCrystal usuarisCrystal = new UsuarisCrystal();

            usuarisCrystal.SetDatabaseLogon("5GCoders", "12345aA!");

            usuarisCrystal.RecordSelectionFormula = "{Users.idUser} = " + IDUsuari;

            CRViewer.ReportSource = usuarisCrystal;
            CRViewer.Refresh();
            CRViewer.RefreshReport();
        }
예제 #2
0
    private void btnView_Click(object sender, EventArgs e)
    {
        try
        {
            ReportDocument document = new ReportDocument();
            string         path     = Application.StartupPath + "/rpt/Accounts/rptCOAList.rpt";
            document.Load(path);
            DataTable dtReport = new DataTable();
            dtReport = manageAccount.GetReportPriceList(Convert.ToInt32(cmbProductCatagory.SelectedValue), txtFromAccCode.Text, txtToAccCode.Text, ((rdCode.Checked) ? true : false));
            document.SetDataSource(dtReport);
            Utility.SetReportDefaultParameter(ref document);
            //if (document.ParameterFields["OrderByCode"] != null)
            //{
            //    document.SetParameterValue("OrderByCode", ((rdCode.Checked) ? true : false));
            //}

            CRViewer.ReportSource = document;
            CRViewer.Refresh();
        }
        catch (Exception ex)
        {
        }
    }