private void Report_ParametersRequestBeforeShow(object sender, DevExpress.XtraReports.Parameters.ParametersRequestEventArgs e)
        {
            if (!(sender is XtraReport report))
            {
                return;
            }

            var parameterDictionary = e.ParametersInformation.ToDictionary(x => x.Parameter.Name, x => x.Parameter.Value);

            report.DataSource = DataSourceHelper.GetDataSource(_dataSource, parameterDictionary);
        }
Beispiel #2
0
 private void XtraRepDetails_ParametersRequestBeforeShow(object sender, DevExpress.XtraReports.Parameters.ParametersRequestEventArgs e)
 {
     foreach (ParameterInfo info in e.ParametersInformation)
     {
         if (info.Parameter.Name == paramDate.Name)
         {
             var editor = info.Editor as DateEdit;
             if (editor != null)
             {
                 editor.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.DateTime;
                 editor.Properties.DisplayFormat.FormatString = "dd/MM/yyyy";
             }
         }
     }
 }
Beispiel #3
0
        private void Rpt_Tranfer_ParametersRequestBeforeShow(object sender, DevExpress.XtraReports.Parameters.ParametersRequestEventArgs e)
        {
            Date1.Value = DateTime.Now.Date;
            Date2.Value = DateTime.Now.Date;

            foreach (ParameterInfo info in e.ParametersInformation)
            {
                if (info.Parameter.Type == typeof(DateTime))
                {
                    //Show a DateTime edit including the time portion for datetime parameters
                    DateEdit deParameter = info.Editor as DateEdit;
                    deParameter.EditValue = DateTime.Now.Date;
                    deParameter.Properties.Mask.EditMask = "dd/MM/yyyy";
                    deParameter.Properties.Mask.UseMaskAsDisplayFormat = true;
                }
            }
        }
Beispiel #4
0
        private void XRepGlobalManifest_ParametersRequestSubmit(object sender, DevExpress.XtraReports.Parameters.ParametersRequestEventArgs e)
        {
            string   objDate = Convert.ToDateTime(paramDate.Value).Date.ToShortDateString() + " 00:00:00";
            DateTime dtDate  = DateTime.Parse(objDate);

            paramStartDate.Value = (object)dtDate;

            objDate            = Convert.ToDateTime(paramDate.Value).Date.ToShortDateString() + " 23:59:59";
            dtDate             = DateTime.Parse(objDate);
            paramEndDate.Value = (object)dtDate;

            if (!Convert.ToBoolean(paramMemo.Value))
            {
                parameter1.Value = (byte)0;
            }
            else
            {
                parameter1.Value = (byte)1;
            }
        }
        private void rptBaselineItem_ParametersRequestSubmit(object sender, DevExpress.XtraReports.Parameters.ParametersRequestEventArgs e)
        {
            bool showHours           = true;
            bool showCosts           = true;
            bool showType            = true;
            bool showDeliverableType = true;

            foreach (ParameterInfo info in e.ParametersInformation)
            {
                if (info.Parameter.Name == "showHours")
                {
                    showHours = (bool)info.Parameter.Value;
                }
                else if (info.Parameter.Name == "showCosts")
                {
                    showCosts = (bool)info.Parameter.Value;
                }

                if (info.Parameter.Name == "showType")
                {
                    showType = (bool)info.Parameter.Value;
                }

                if (info.Parameter.Name == "showDeliverableType")
                {
                    showDeliverableType = (bool)info.Parameter.Value;
                }
            }

            if (showType)
            {
                xrlblNumber.LocationF = new System.Drawing.PointF(356F, 0);

                if (showDeliverableType)
                {
                    xrlblDeliverableType.Visible     = true;
                    xrlblDataDeliverableType.Visible = true;

                    xrlblDeliverableType.LocationF     = new System.Drawing.PointF(506F, 0);
                    xrlblDataDeliverableType.LocationF = new System.Drawing.PointF(506F, 0);

                    xrlblTitle.LocationF     = new System.Drawing.PointF(606F, 0);
                    xrlblDataTitle.LocationF = new System.Drawing.PointF(606F, 0);
                }
                else
                {
                    xrlblDeliverableType.Visible     = false;
                    xrlblDataDeliverableType.Visible = false;

                    xrlblTitle.LocationF     = new System.Drawing.PointF(506F, 0);
                    xrlblDataTitle.LocationF = new System.Drawing.PointF(506F, 0);
                }

                xrlblNumber.LocationF     = new System.Drawing.PointF(356F, 0);
                xrlblDataNumber.LocationF = new System.Drawing.PointF(356F, 0);

                xrlblType.Visible     = true;
                xrlblDataType.Visible = true;
            }
            else
            {
                if (showDeliverableType)
                {
                    xrlblDeliverableType.Visible     = true;
                    xrlblDataDeliverableType.Visible = true;

                    xrlblDeliverableType.LocationF = new System.Drawing.PointF(410F, 0);
                    xrlblTitle.LocationF           = new System.Drawing.PointF(510F, 0);

                    xrlblDataDeliverableType.LocationF = new System.Drawing.PointF(410F, 0);
                    xrlblDataTitle.LocationF           = new System.Drawing.PointF(510F, 0);
                }
                else
                {
                    xrlblDeliverableType.Visible     = false;
                    xrlblDataDeliverableType.Visible = false;

                    xrlblDeliverableType.LocationF     = new System.Drawing.PointF(410F, 0);
                    xrlblDataDeliverableType.LocationF = new System.Drawing.PointF(410F, 0);

                    xrlblTitle.LocationF     = new System.Drawing.PointF(410F, 0);
                    xrlblDataTitle.LocationF = new System.Drawing.PointF(410F, 0);
                }

                xrlblNumber.LocationF     = new System.Drawing.PointF(260F, 0);
                xrlblDataNumber.LocationF = new System.Drawing.PointF(260F, 0);
                xrlblType.Visible         = false;
                xrlblDataType.Visible     = false;
            }

            if (showHours && showCosts)
            {
                xrlblTitle.WidthF         = showType ? 199.06F : 295.06F;
                xrlblDataTitle.WidthF     = showType ? 199.06F : 295.06F;
                xrlblHours.LocationF      = new System.Drawing.PointF(805.06F, 0);
                xrlblDataHours.LocationF  = new System.Drawing.PointF(805.06F, 0);
                xrlblTotalHours.LocationF = new System.Drawing.PointF(804.06F, 0);
                xrlblHours.Visible        = true;
                xrlblDataHours.Visible    = true;
                xrlblTotalHours.Visible   = true;
                xrlblCosts.Visible        = true;
                xrlblDataCosts.Visible    = true;
                xrlblTotalCosts.Visible   = true;
                xrlblTotalCosts.WidthF    = 133.9366F;
                xrlblTotalCosts.LocationF = new System.Drawing.PointF(905.06F, 0);
                xrlblTotalCosts.Borders   = DevExpress.XtraPrinting.BorderSide.Right | DevExpress.XtraPrinting.BorderSide.Bottom;
            }
            else if (showHours)
            {
                xrlblTitle.WidthF     = showType ? 332.1F : 428.1F;
                xrlblDataTitle.WidthF = showType ? 332.1F : 428.1F;

                xrlblHours.Visible        = true;
                xrlblDataHours.Visible    = true;
                xrlblTotalHours.Visible   = true;
                xrlblHours.LocationF      = new System.Drawing.PointF(939.06F, 0);
                xrlblDataHours.LocationF  = new System.Drawing.PointF(939.06F, 0);
                xrlblTotalHours.LocationF = new System.Drawing.PointF(938.06F, 0);

                xrlblCosts.Visible      = false;
                xrlblDataCosts.Visible  = false;
                xrlblTotalCosts.Visible = false;
            }
            else if (showCosts)
            {
                xrlblTitle.WidthF     = showType ? 299.06F : 395.06F;
                xrlblDataTitle.WidthF = showType ? 299.06F : 395.06F;

                xrlblHours.Visible      = false;
                xrlblDataHours.Visible  = false;
                xrlblTotalHours.Visible = false;
                xrlblCosts.Visible      = true;
                xrlblDataCosts.Visible  = true;
                xrlblTotalCosts.Visible = true;

                xrlblTotalCosts.LocationF = new System.Drawing.PointF(904.06F, 0);
                xrlblTotalCosts.WidthF    = 134.9366F;
                xrlblTotalCosts.Borders   = DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right | DevExpress.XtraPrinting.BorderSide.Bottom;
            }
            else
            {
                xrlblTitle.WidthF        = showType ? 432.1F : 528.1F;
                xrlblDataTitle.WidthF    = showType ? 432.1F : 528.1F;
                xrlblHours.LocationF     = new System.Drawing.PointF(805.06F, 0);
                xrlblDataHours.LocationF = new System.Drawing.PointF(805.06F, 0);
                xrlblHours.Visible       = false;
                xrlblDataHours.Visible   = false;
                xrlblTotalHours.Visible  = false;
                xrlblCosts.Visible       = false;
                xrlblDataCosts.Visible   = false;
                xrlblTotalCosts.Visible  = false;
            }

            if (!showDeliverableType)
            {
                xrlblTitle.WidthF     += 100F;
                xrlblDataTitle.WidthF += 100F;
            }
        }