本文整理汇总了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("&", "&").Replace("'", "'"));
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");
}
}