Exemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            BSTotalX rpt = new BSTotalX();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemplo n.º 2
0
        private void Report()
        {
            ParameterField parameterField1 = new ParameterField();

            ParameterFields parameterFields1 = new ParameterFields();

            ParameterDiscreteValue parameterDiscreteValue1 = new ParameterDiscreteValue();

            parameterField1.Name = "id";

            parameterDiscreteValue1.Value = BId;

            parameterField1.CurrentValues.Add(parameterDiscreteValue1);

            parameterFields1.Add(parameterField1);

            ReportViewer    f1 = new ReportViewer();
            TableLogOnInfos reportLogonInfos = new TableLogOnInfos();
            TableLogOnInfo  reportLogonInfo  = new TableLogOnInfo();
            ConnectionInfo  reportConInfo    = new ConnectionInfo();
            Tables          tables           = default(Tables);

            var with1 = reportConInfo;

            with1.ServerName   = "tcp:KyotoServer,49172";
            with1.DatabaseName = "AccountDb_new";
            with1.UserID       = "sa";
            with1.Password     = "******";

            BSTotalX cr = new BSTotalX();

            tables = cr.Database.Tables;
            foreach (Table table in tables)
            {
                reportLogonInfo = table.LogOnInfo;
                reportLogonInfo.ConnectionInfo = reportConInfo;
                table.ApplyLogOnInfo(reportLogonInfo);
            }

            f1.crystalReportViewer1.ParameterFieldInfo = parameterFields1;
            f1.crystalReportViewer1.ReportSource       = cr;

            this.Visible = false;

            f1.ShowDialog();
            this.Visible = true;
        }