Example #1
0
        public DialogResult Run()
        {
            if (this.Report == null)
            {
                return(DialogResult.Cancel);
            }

            XtraReportWizardForm form = new XtraReportWizardForm(Wizard.DesignerHost);

            form.Controls.AddRange(new Control[] {
                new WizPageWelcome(this),
                new WizPageDataset(this),
                new WizPageConnectionCustom(this),          // Custom
                new WizPageDataOption(this),                // New
                new WizPageTablesCustom(this),              // Custom
                new WizPageQuery(this),                     // New
                new WizPageChooseFieldsCustom(this),        // Custom
                new WizPageGrouping(this),
                new WizPageSummary(this),
                new WizPageGroupedLayout(this),
                new WizPageUngroupedLayout(this),
                new WizPageStyle(this),
                new WizPageReportTitle(this),
                new WizPageLabelType(this),
                new WizPageLabelOptions(this)               //, and so on...
            });

            DialogResult result = form.ShowDialog();

            if (result == DialogResult.OK)
            {
                Wizard.BuildReport();
            }

            return(result);
        }
Example #2
0
        public DialogResult Run()
        {
            if (this.Report == null)
            {
                return(DialogResult.Cancel);
            }

            XtraReportWizardForm form = new XtraReportWizardForm(Wizard.DesignerHost);

            form.Controls.AddRange(new Control[] {
                new WizPageWelcome(this),
                //new WizPageWelcomeCustom(this),
                //new WizPageDataset(this),
                //new WizPageConnectionCustom(this),          // Custom
                //new WizPageDataOption(this),                // New
                //new WizPageTablesCustom(this),              // Custom
                //new WizPageQuery(this),                     // New
                //new WizPageChooseFieldsCustom(this),        // Custom
                //new WizPageGrouping(this),
                //new WizPageSummary(this),
                ////new WizPageGroupedLayout(this),
                //new WizPageLayoutCustom(this),
                //new WizPageUngroupedLayout(this),
                ////new WizPageStyle(this),   //custom
                //new WizPageStylesCustom(this),
                //new WizPageReportTitle(this),
                //new WizPageLabelType(this),
                //new WizPageLabelOptions(this)               //, and so on...
            });



            DialogResult result = form.ShowDialog();

            if (result == DialogResult.OK)
            {
                Wizard.BuildReport();
                foreach (SqlParameter param in ((SqlDataAdapter)Report.DataAdapter).SelectCommand.Parameters)
                {
                    DevExpress.XtraReports.Parameters.Parameter xParam = new DevExpress.XtraReports.Parameters.Parameter();
                    xParam.Description = param.ParameterName.Replace('_', ' ');
                    xParam.Name        = param.ParameterName;
                    xParam.Visible     = true;
                    xParam.Value       = param.Value;
                    switch (param.SqlDbType.ToString())
                    {
                    case "BigInt":
                        xParam.Type = typeof(Int64);
                        break;

                    case "Bit":
                        xParam.Type = typeof(Boolean);
                        break;

                    case "DateTime":
                        xParam.Type = typeof(DateTime);
                        break;

                    case "Money":
                    case "Decimal":
                        xParam.Type = typeof(Decimal);
                        break;

                    case "Int":
                        xParam.Type = typeof(Int32);
                        break;

                    case "NVarChar":
                        xParam.Type = typeof(String);
                        break;
                    }

                    Report.Parameters.Add(xParam);
                }
            }

            return(result);
        }