当前位置: 首页>>代码示例>>C#>>正文


C# ILocalizationManager.GetReport方法代码示例

本文整理汇总了C#中ILocalizationManager.GetReport方法的典型用法代码示例。如果您正苦于以下问题:C# ILocalizationManager.GetReport方法的具体用法?C# ILocalizationManager.GetReport怎么用?C# ILocalizationManager.GetReport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILocalizationManager的用法示例。


在下文中一共展示了ILocalizationManager.GetReport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        l10nManager = ObjectFactory.GetLocalizationManager(contAPI.RequestInformationRef);
        IsExcelExport = Request.QueryString["out"] == "xls";
        IncludeFolderPath = Request.QueryString.AllKeys.Contains("fp") ?
            (Request.QueryString["fp"] == "1") : IsExcelExport;

        NameValueCollection filters = HttpUtility.ParseQueryString(Request.QueryString["f"]);
        foreach (string f in filters.Keys)
            SetFilterValue(f, filters[f]);

        ReportingCriteria criteria2 = new ReportingCriteria();
        criteria2.FolderRecursive = true;
        criteria2.AddFilter(ReportingProperty.FolderId, CriteriaFilterOperator.EqualTo, FilterFolderId < 0 ? 0 : FilterFolderId);
        if (!string.IsNullOrEmpty(FilterTitle))
            criteria2.AddFilter(ReportingProperty.Title, CriteriaFilterOperator.Contains, FilterTitle.Replace("&", "&amp;").Replace("'", "&#39;"));

        if (FilterLocale > 0)
        {
            if (!FilterLocaleNotIn)
                criteria2.AddFilter(ReportingProperty.Locale, CriteriaFilterOperator.Contains, "," + FilterLocale.ToString() + ",");
            else
                criteria2.AddFilter(ReportingProperty.Locale, CriteriaFilterOperator.DoesNotContain, "," + FilterLocale.ToString() + ",");
        }
        else if (FilterLocale == -1)
        {
            criteria2.AddFilter(ReportingProperty.Locale, CriteriaFilterOperator.EqualTo, string.Format(",{0},", CurrentLanguageId));
        }
        if (FilterLocStatus != Ektron.Cms.Localization.LocalizationState.Undefined)
            criteria2.AddFilter(ReportingProperty.TranslationStatus, CriteriaFilterOperator.EqualTo, (byte)FilterLocStatus);
        if (!string.IsNullOrEmpty(FilterContentStatus))
            criteria2.AddFilter(ReportingProperty.ContentStatus, CriteriaFilterOperator.EqualTo, FilterContentStatus);
        if (FilterLastModifiedStart != DateTime.MinValue)
            criteria2.AddFilter(ReportingProperty.LastModified, CriteriaFilterOperator.GreaterThanOrEqualTo, FilterLastModifiedStart);
        if (FilterLastModifiedEnd != DateTime.MinValue)
            criteria2.AddFilter(ReportingProperty.LastModified, CriteriaFilterOperator.LessThanOrEqualTo, FilterLastModifiedEnd);
        if (FilterDateCreatedStart != DateTime.MinValue)
            criteria2.AddFilter(ReportingProperty.DateCreated, CriteriaFilterOperator.GreaterThanOrEqualTo, FilterDateCreatedStart);
        if (FilterDateCreatedEnd != DateTime.MinValue)
            criteria2.AddFilter(ReportingProperty.DateCreated, CriteriaFilterOperator.LessThanOrEqualTo, FilterDateCreatedEnd);
        if (FilterContentId > 0)
            criteria2.AddFilter(ReportingProperty.ContentId, CriteriaFilterOperator.EqualTo, FilterContentId);
        if (FilterAuthorId > 0)
            criteria2.AddFilter(ReportingProperty.AuthorId, CriteriaFilterOperator.EqualTo, FilterAuthorId);
        if (FilterLanguageId > 0)
            criteria2.AddFilter(ReportingProperty.LanguageId, CriteriaFilterOperator.EqualTo, FilterLanguageId);

        criteria2.GetMetadata = true;
        criteria2.PagingInfo.CurrentPage = 0;
        criteria2.PagingInfo.RecordsPerPage = int.MaxValue;
        Pair sort = GetSort(Request.QueryString["s"]);
        criteria2.OrderByField = (ReportingProperty)sort.First;
        criteria2.OrderByDirection = (EkEnumeration.OrderByDirection)sort.Second;

        List<ReportingData> contentlist2 = l10nManager.GetReport(criteria2);

        int pageCount = 0;
        int totalCount = criteria2.PagingInfo.TotalRecords;
        int totalPages = criteria2.PagingInfo.TotalPages;
        int currentPage = criteria2.PagingInfo.CurrentPage;

        if (IsExcelExport)
        {
            pnlPrint.Visible = false;
            pnlExcel.Visible = true;
            rptExcel.DataSource = contentlist2;
            rptExcel.DataBind();

            Response.Clear();
            Response.ContentType = "application/ms-excel";
            Response.AppendHeader("content-disposition", "attachment; filename=LocReport_" + DateTime.Now.Ticks.ToString() + ".xls");
            Response.Write(RenderControl(plcExcel));
            Response.End();
        }
        else
        {
            pnlPrint.Visible = true;
            pnlExcel.Visible = false;
            rptPrint.DataSource = contentlist2;
            rptPrint.DataBind();

            lResultCount.Text = totalCount.ToString() + " row" + (totalCount == 1 ? string.Empty : "s");
        }
    }
开发者ID:jaytem,项目名称:minGit,代码行数:84,代码来源:Report.aspx.cs


注:本文中的ILocalizationManager.GetReport方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。