Print and PrintPreview

D

Douglas Osborne

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
 
D

Douglas Osborne

Alvin,

It is a bit weird ( well it is OWC ). If you look at the example from the
Office Component Toolpack under Pivotprint.htm, when you look at the
PivotTable 10 object that is displayed you can see that it has the printer
icon enabled as well as the find icon.

However, if I start a new ASPX page and drag on either a 10.0 or 11.0 Pivot
table, by default the Print and Find buttons are not there in the toolbar.

Then - if I change the CLSID of the example of PrintPivot in 10 to the one
for 11 - 2E55A - the Print and Find icons render in HTML.

So I would ask how do I enable them in code to show up in the .net
environment? Why are they not presented under .Net? ( 1.1 BTW )

TIA,
Doug


Alvin Bruney said:
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 said:
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
 
D

Douglas Osborne

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 said:
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 said:
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
 
A

Alvin Bruney [MVP]

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
-------------------------------------------------------


Douglas Osborne said:
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 said:
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 said:
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
 
D

Douglas Osborne

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 said:
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
-------------------------------------------------------


Douglas Osborne said:
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 said:
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
 
A

Alvin Bruney [MVP]

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
-------------------------------------------------------


Douglas Osborne said:
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 said:
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
-------------------------------------------------------


Douglas Osborne said:
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
 
D

Douglas Osborne

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 said:
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
-------------------------------------------------------


Douglas Osborne said:
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 said:
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
 
A

Alvin Bruney [MVP]

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
-------------------------------------------------------


Douglas Osborne said:
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 said:
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
-------------------------------------------------------


Douglas Osborne said:
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
 
D

Douglas Osborne

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 said:
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
-------------------------------------------------------


Douglas Osborne said:
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 said:
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
 
A

Alvin Bruney [MVP]

You'd have to give it a try, I simply don't know if that would work. For
security reasons, I'm sure it should not work but then again, you never
know.

--
________________________
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 said:
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 said:
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
-------------------------------------------------------


Douglas Osborne said:
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
 
D

Douglas Osborne

Yep - couldn't get it to work.

It has been pretty cool getting this to work correctly - quite a PITA, but
interesting.

I did get Pivot printing working - but it was a lot of crawling around in
JS, and installing and registering PivotPrint.dll on the client in
\Windows\System32.

I guess there is no other way to do it - since it is rendering off of the
client.

Does any of this work better in Office2007, or is it too early to tell?

Best,
Doug

Alvin Bruney said:
You'd have to give it a try, I simply don't know if that would work. For
security reasons, I'm sure it should not work but then again, you never
know.

--
________________________
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 said:
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 said:
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
 
A

Alvin Bruney [MVP]

I haven't dived into the printing portion in office 12, maybe i may get to
it by the weekend.

--
________________________
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 said:
Yep - couldn't get it to work.

It has been pretty cool getting this to work correctly - quite a PITA, but
interesting.

I did get Pivot printing working - but it was a lot of crawling around in
JS, and installing and registering PivotPrint.dll on the client in
\Windows\System32.

I guess there is no other way to do it - since it is rendering off of the
client.

Does any of this work better in Office2007, or is it too early to tell?

Best,
Doug

Alvin Bruney said:
You'd have to give it a try, I simply don't know if that would work. For
security reasons, I'm sure it should not work but then again, you never
know.

--
________________________
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 said:
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
 

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