Preloading OWC 11 Spreadsheet class with an existing template

I

ion

A

Alvin Bruney

I gather you are trying to apply a stylesheet of sorts to the spreadsheet?
The spreadsheet does not support styles - that's a given I think. But how to
hack it is your question?

I think it is possibly with this approach. The spreadsheet supports styles
thru XML schemas; that is, if the XML tag indicates a certain family of font
with size and weight attributes, the spreadsheet will correctly load it and
apply it. Your approach should be to write a routine to embed the
appropriate attributes inside the XML document. Once this is done, you can
refresh the spreadsheet to see the changes.

Do I have code that does this? No. You are basically all on your own to try
this out.

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
R

RayTheOtherRay

When I first looked at the XML code generated from publishing an Excel
PivotChart, I was going to manipulate the XML code, as well. That
turned out not to be the answer for me, as the XML code gets
overwritten everytime the PivotChart is republished.

My solution to that is to use JavaScript to modify the properties of
the PivotChart object that the XML creates. In the following code, I
got the name of the desired object from the published XML listing in
the web page source code.

<script language="javascript">

// Initialize object variables
var cs = document.getElementById('My_Sheet_31935_Chart');
var pt = document.getElementById('My_Sheet_31935_PivotTable');
var pv = pt.Activeview;
var fa = pv.FilterAxis;
var ra = pv.RowAxis;

cs.width = '100%'; //make chart use entire width of screen
var pc = cs.Charts(0);
pc.ChartDepth = 20; //set the depth of 3D columns in chart

</script>

I got the objects to drill down to from OWCVBA11.CHM. The working
results have come from that and much trial and much error.

Hope this helps...or hacks!
RayTheOtherRay <><
 
I

ion

Thanks, Alvin and (the other) Ray. What I want to do is use my existing
application layer framework to generate data, which it does in an HTML
spreadsheet, then move it into a spreadsheet with Excelly things like
footers and print areas defined.
I already have a component that copies my HTML table to an OWC
spreadsheet. If I could have it adopt the template when _exporting the
spreadsheet to Excel, that'd work great, too.
But, I am going a little upstream and trying to get a spreadsheet
_instead of an HTML page using XSLT. I'll let you know if I learn
anything useful.
Thanks again for your help!
Ion
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top