Skip to content

Commit

Permalink
Fixed JanKallman#9 and JanKallman#75. Added properties to ExcelPivotT…
Browse files Browse the repository at this point in the history
…ableField: MultipleItemSelectionAllowed, ShowDropDowns, ShowInFieldList, ShowAsCaption, ShowMemberPropertyInCell and ShowMemberPropertyToolTip. Added Properties to OfficeProperties: LinksUpToDate, HyperlinksChanged, ScaleCrop and SharedDoc
  • Loading branch information
JanKallman committed Jan 12, 2018
1 parent 8975e60 commit 2973b84
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 1 deletion.
38 changes: 38 additions & 0 deletions EPPlus/OfficeProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,44 @@ public DateTime Modified
_coreHelper.SetXmlNodeString(ModifiedPath + "/@xsi:type", "dcterms:W3CDTF");
}
}
const string LinksUpToDatePath = "xp:Properties/xp:LinksUpToDate";
/// <summary>
/// Indicates whether hyperlinks in a document are up-to-date
/// < /summary>
public bool LinksUpToDate
{
get { return _extendedHelper.GetXmlNodeBool(LinksUpToDatePath); }
set { _extendedHelper.SetXmlNodeBool(LinksUpToDatePath, value); }
}
const string HyperlinksChangedPath = "xp:Properties/xp:HyperlinksChanged";
/// <summary>
/// Hyperlinks need update
/// </summary>
public bool HyperlinksChanged
{
get { return _extendedHelper.GetXmlNodeBool(HyperlinksChangedPath); }
set { _extendedHelper.SetXmlNodeBool(HyperlinksChangedPath, value); }
}
const string ScaleCropPath = "xp:Properties/xp:ScaleCrop";
/// <summary>
/// Display mode of the document thumbnail. True to enable scaling. False to enable cropping.
/// </summary>
public bool ScaleCrop
{
get { return _extendedHelper.GetXmlNodeBool(ScaleCropPath); }
set { _extendedHelper.SetXmlNodeBool(ScaleCropPath, value); }
}


const string SharedDocPath = "xp:Properties/xp:SharedDoc";
/// <summary>
/// If true, document is shared between multiple producers.
/// </summary>
public bool SharedDoc
{
get { return _extendedHelper.GetXmlNodeBool(SharedDocPath); }
set { _extendedHelper.SetXmlNodeBool(SharedDocPath, value); }
}

#region Get and Set Extended Properties
/// <summary>
Expand Down
88 changes: 87 additions & 1 deletion EPPlus/Table/PivotTable/ExcelPivotTableField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,22 @@ public bool SubtotalTop
}
}
/// <summary>
/// A boolean that indicates whether to show all items for this field
/// Indicates whether the field can have multiple items selected in the page field
/// </summary>
public bool MultipleItemSelectionAllowed
{
get
{
return GetXmlNodeBool("@multipleItemSelectionAllowed");
}
set
{
SetXmlNodeBool("@multipleItemSelectionAllowed", value);
}
}
#region Show properties
/// <summary>
/// Indicates whether to show all items for this field
/// </summary>
public bool ShowAll
{
Expand All @@ -270,6 +285,77 @@ public bool ShowAll
}
}
/// <summary>
/// Indicates whether to hide drop down buttons on PivotField headers
/// </summary>
public bool ShowDropDowns
{
get
{
return GetXmlNodeBool("@showDropDowns");
}
set
{
SetXmlNodeBool("@showDropDowns", value);
}
}
/// <summary>
/// Indicates whether this hierarchy is omitted from the field list
/// </summary>
public bool ShowInFieldList
{
get
{
return GetXmlNodeBool("@showInFieldList");
}
set
{
SetXmlNodeBool("@showInFieldList", value);
}
}
/// <summary>
/// Indicates whether to show the property as a member caption
/// </summary>
public bool ShowAsCaption
{
get
{
return GetXmlNodeBool("@showPropAsCaption");
}
set
{
SetXmlNodeBool("@showPropAsCaption", value);
}
}
/// <summary>
/// Indicates whether to show the member property value in a PivotTable cell
/// </summary>
public bool ShowMemberPropertyInCell
{
get
{
return GetXmlNodeBool("@showPropCell");
}
set
{
SetXmlNodeBool("@showPropCell", value);
}
}
/// <summary>
/// Indicates whether to show the member property value in a tooltip on the appropriate PivotTable cells
/// </summary>
public bool ShowMemberPropertyToolTip
{
get
{
return GetXmlNodeBool("@showPropTip");
}
set
{
SetXmlNodeBool("@showPropTip", value);
}
}
#endregion
/// <summary>
/// The type of sort that is applied to this field
/// </summary>
public eSortType Sort
Expand Down
6 changes: 6 additions & 0 deletions EPPlusTest/WorkSheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,12 @@ public void LoadData()
_pck.Workbook.Properties.Status = "Status";
_pck.Workbook.Properties.HyperlinkBase = new Uri("http://serversideexcel.com", UriKind.Absolute);
_pck.Workbook.Properties.Manager = "Manager";
_pck.Workbook.Properties.AppVersion="4.5.0.1";
_pck.Workbook.Properties.LinksUpToDate = false;
_pck.Workbook.Properties.HyperlinksChanged = false;
_pck.Workbook.Properties.SharedDoc = false;
_pck.Workbook.Properties.ScaleCrop = false;


_pck.Workbook.Properties.SetCustomPropertyValue("DateTest", new DateTime(2008, 12, 31));
Console.WriteLine(_pck.Workbook.Properties.GetCustomPropertyValue("DateTest").ToString());
Expand Down

0 comments on commit 2973b84

Please sign in to comment.