Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ErrorLabel.Visible = false;

            if (ReportId != PrimaryKeyId.Empty)
            {
                rvMain.Visible           = true;
                NoReportsLiteral.Visible = false;

                try
                {
                    ReportEntity re = (ReportEntity)BusinessManager.Load(ReportEntity.GetAssignedMetaClassName(), ReportId);
                    ReportLabel.Text = re.Title;

                    string sql = BindFilterControl(re);

                    if (!Page.IsPostBack)
                    {
                        BindReport(re, sql);
                    }
                }
                catch (Exception)
                {
                    rvMain.Visible     = false;
                    FilterRow.Visible  = false;
                    TitleRow.Visible   = false;
                    ErrorLabel.Visible = true;
                }
            }
            else
            {
                rvMain.Visible           = false;
                NoReportsLiteral.Visible = true;
            }
        }
Example #2
0
        //private void BindValues()
        //{
        //    string id = Request["ReportId"];
        //    Guid uid = new Guid(id);
        //    PrimaryKeyId pkId = new PrimaryKeyId(uid);
        //    EntityObject eo = BusinessManager.Load(ReportEntity.GetAssignedMetaClassName(), pkId);
        //    ReportEntity re = eo as ReportEntity;
        //    //...
        //}

        void btnSave_ServerClick(object sender, EventArgs e)
        {
            if (fSourceFile.PostedFile != null && fSourceFile.PostedFile.ContentLength > 0)
            {
                StringBuilder sb = new StringBuilder();
                using (StringWriter sw = new StringWriter(sb))
                {
                    fSourceFile.PostedFile.InputStream.Seek(0, SeekOrigin.Begin);
                    StreamReader sr = new StreamReader(fSourceFile.PostedFile.InputStream);
                    sw.Write(sr.ReadToEnd());
                    sr.Close();
                }

                ReportEntity re = BusinessManager.InitializeEntity <ReportEntity>(ReportEntity.GetAssignedMetaClassName());
                re.Title       = txtTitle.Text;
                re.Description = txtDescription.Text;
                re.TimeZoneId  = Mediachase.IBN.Business.Security.CurrentUser.TimeZoneId;
                if (ddFilters.SelectedValue != "-1")
                {
                    re.FilterControl = ddFilters.SelectedValue;
                }
                re.RdlText  = sb.ToString();
                re.IsCustom = true;
                BusinessManager.Create(re);
                CommandParameters cp = new CommandParameters("MC_RM_Import");
                Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ReportEntity re = (ReportEntity)BusinessManager.Load(ReportEntity.GetAssignedMetaClassName(), PrimaryKeyId.Parse(Request["ReportId"]));

            string sql = BindFilterControl(re);

            if (!Page.IsPostBack)
            {
                BindReport(re, sql);
                BindToolbar();
            }
        }
Example #4
0
        private void BindValues()
        {
            EntityObject[] reports = BusinessManager.List(ReportEntity.GetAssignedMetaClassName(), new FilterElementCollection().ToArray());
            if (reports != null && reports.Length > 0)
            {
                ReportList.DataSource = reports;
                ReportList.DataBind();

                ControlPropertiesBase properties = ControlProperties.Provider;
                if (properties.GetValue(this.ID, keyReport) != null)
                {
                    CommonHelper.SafeSelect(ReportList, (string)properties.GetValue(this.ID, keyReport));
                }

                ReportsRow.Visible   = true;
                NoReportsRow.Visible = false;
            }
            else
            {
                ReportsRow.Visible   = false;
                NoReportsRow.Visible = true;
            }
        }
Example #5
0
 private void BindToolbar()
 {
     BlockHeaderMain.Title = GetGlobalResourceObject("IbnFramework.Report", "ReportView").ToString();
     BlockHeaderMain.AddLink(String.Format("<img src='{0}' border='0' width='16' height='16' align='absmiddle' /> {1}",
                                           ResolveClientUrl("~/layouts/images/cancel.gif"),
                                           GetGlobalResourceObject("IbnFramework.Report", "ReportList").ToString()),
                             ResolveUrl("~/Apps/MetaUIEntity/Pages/EntityList.aspx?ClassName=" + ReportEntity.GetAssignedMetaClassName()));
 }
Example #6
0
        void ReportView_FilterChanged(object sender, FilterEventArgs e)
        {
            ReportEntity re = (ReportEntity)BusinessManager.Load(ReportEntity.GetAssignedMetaClassName(), PrimaryKeyId.Parse(Request["ReportId"]));

            BindReport(re, e.FilterSql);
        }
Example #7
0
        void ReportView_FilterChanged(object sender, FilterEventArgs e)
        {
            ReportEntity re = (ReportEntity)BusinessManager.Load(ReportEntity.GetAssignedMetaClassName(), ReportId);

            BindReport(re, e.FilterSql);
        }