Mark,
I will try this one out. FYI, Rolf Niklasson displayed the following code and it worked out for me.
Dim ptView
Dim name
Dim size
Function Window_OnLoad()
name = "Verdana"
size = 8
set ptView = PivotTable1.ActiveView
ptView.FieldLabelFont.Name = name
ptView.FieldLabelFont.Size = size
ptView.TotalFont.Name = name
ptView.TotalFont.Size = size
ptView.HeaderFont.Name = name
ptView.HeaderFont.Size = size
For Each ttl In ptView.FieldSets
For Each ttl2 In ptView.FieldSets(ttl).Fields
ptView.FieldSets(ttl).Fields(ttl2).DetailFont.Name = name
ptView.FieldSets(ttl).Fields(ttl2).DetailFont.Size = size
ptView.FieldSets(ttl).Fields(ttl2).SubtotalFont.Name = name
ptView.FieldSets(ttl).Fields(ttl2).SubtotalFont.Size = size
ptView.FieldSets(ttl).Fields(ttl2).GroupedFont.Name = name
ptView.FieldSets(ttl).Fields(ttl2).GroupedFont.Size = size
ptView.FieldSets(ttl).Fields(ttl2).SubtotalLabelFont.Name = name
ptView.FieldSets(ttl).Fields(ttl2).SubtotalLabelFont.Size = size
Next
Next
Thanks for your help.
Raj More
Hi Raj,
I'm sorry to say I can't speak intelligently about using OWC in a Windows app. I doubt you have access to the Style object when developing a Windows app, so your best bet is to change the font programmatically in the application code. Here is a previous post from Keith Ammon that should probably do the trick for you:
----------
Try this after you load the pivot table:
function changeFont() {
var name = "Tahoma";
var size = 8;
var v = pivotTable.ActiveView;
v.FieldLabelFont.Name = name;
v.FieldLabelFont.Size = size + 2;
v.MemberFont.Name = name;
v.MemberFont.Size = size;
v.TotalFont.Name = name;
v.TotalFont.Size = size;
// set font name and size for all detail and subtotal fields.
for (var fs = 0; fs < v.FieldSets.Count; fs++) {
var fldSet = v.FieldSets(fs);
for (var f = 0; f < fldSet.Fields.Count; f++) {
var fld = fldSet.Fields(f);
fld.DetailFont.Name = name;
fld.DetailFont.Size = size;
fld.SubtotalFont.Name = name;
fld.SubtotalFont.Size = size;
}
}
}
-Keith Ammon
Mark,
I am using the OWC in a Windows application, not on a web site. Will what you are saying apply to WinApps also?
tia,
Raj More.
You can change the properties of the Pivot Table at design time. Just change the font in the Pivot Table object's style properties. This property will be stored in the XML definition of the Pivot Table object.
Hello!
How do I format my OWC PivotTable's data? It comes with a default font that is too large & ugly, and I want to change ALL cells to TAHOMA, SIZE 8.
Thanks,
Raj More