Alvin,
I cannot force a click on it?
document.all.PivotTable1.Toolbar.Buttons("owc1004").Click();
I know I can hide it - frm1.PivotTable1.Toolbar.Buttons.Remove
("owc1004")
Seems like you should be able to automate the clicking step.
Best,
Doug
"Alvin Bruney [MVP]" <
www.lulu.com/owc> wrote in message
javascript to press the 'Export to Microsoft Excel' button on the
toolbar?
I don't think script exists to "press" a button, however, there is an
export method available on the owc object that you can use as a
workaround and that would export the data for the owc object.
If this was a typo and you meant suppress or hide as opposed to
'press'
you'd first need a reference to the toolbar button. with the reference,
you can simply call the hide method to hide that particular button.
document.all.<owc object>.Toolbar.Buttons.Remove(2)
--
________________________
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
-------------------------------------------------------
Alvin,
While I've got you in a good mood, what is the javascript to press the
'Export to Microsoft Excel' button on the toolbar?
Have a great weekend,
Doug
"Alvin Bruney [MVP]" <
www.lulu.com/owc> wrote in message
Alvin - doesn't anyone else other than you know this? I bought your
book - you would think Microsoft would give this a bit of publicity
and support,
rolling on the floor laughing at this. seriously, there used to be a
few good guys in here but they vanished. If i were you, i'd open a
support incident with MS. You have 3 free incidents. Usually they
direct it (after a lot of running around) to the people who actually
wrote the stuff and they help you. That's how i got most of my
questions answered. I believe the chart object has a print function
if memory serves me correctly you should be able to do chart.Print()
--
________________________
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
-------------------------------------------------------
Alvin,
I have 2 objects in the browser, a Pivot Table object and a Chart
Space Object.
I can render the Print and Print preview buttons for both objects,
but only the Excel Pivot table will actually respond to the Print
and Print Preview clicks - I think this has to do with the fact that
the variable in the accompanying JS file sets
printing = new ExcelPrinting();
So that would be exclusive for the Pivot table - is there specific
code to call to print a Chart object?
Alvin - doesn't anyone else other than you know this? I bought your
book - you would think Microsoft would give this a bit of publicity
and support,
Best,
Doug
"Alvin Bruney [MVP]" <
www.lulu.com/owc> wrote in message
by default, the print functionality should print the object in the
browser. Do you just want to print the chart by itself and not the
pivot table?
--
________________________
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
-------------------------------------------------------
Alvin,
I got the printing button up and running on my pivot table -
thanks for your help.
I tried to extend that to my chart, I got so far as to add the
buttons to the toolbar for the chart, but it does not want to
print - is there anything I specifically need to tweak?
document.all.PivotTable1.Printing.Print(); -- works
document.all.ChartSpace1.Printing.Print(); -- does not work
I can see in PivotPrint.htc they are tied right to Excel -
printing = new ExcelPrinting(); Can I set this to print a chart?
if so, does anyone have an example?
Doug
"Alvin Bruney" <
www.lulu.com/owc> wrote in message
what errors are you seeing?
--
________________________
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
-------------------------------------------------------
"Douglas Osborne" <dougdotosborneatcardionetdotcom> wrote in
message I had found some code on MSDN and in Alvin's book for these - but
they no longer seem to work - at least in OWC11.
Is there a workaround?
function init()
{
document.all.pt.PrintCodeBase = "./otphelp.cab";
function onPrint()
{
document.all.pt.Printing.Print();
}
function onPrintPreview()
{
document.all.pt.Printing.PrintPreview();
}
}
TIA,
Doug