I am trying to give a user the option to print a graph on a web page, and I get a 'No Printers are installed' error, my pc does have printers installed though?
Load graph
Dim ch1 As Steema.TeeChart.Chart = WebChart1.Chart
Dim tmpChart As New MemoryStream()
Print Graph Button
Dim tmpChart As New MemoryStream()
If IsNothing(Session("ch1")) Then
Else
'retrieve the session stored Chart
tmpChart = DirectCast(Session("ch1"), MemoryStream)
'set the Stream position to 0 as the last read/write
'will have moved the position to the end of the stream
tmpChart.Position = 0
'import saved Chart
WebChart1.Chart.Import.Template.Load(tmpChart)
WebChart1.Chart.Printer.Landscape = True
WebChart1.Chart.Printer.Grayscale = True
WebChart1.Chart.Printer.BeginPrint()
WebChart1.Chart.Printer.Print(WebChart1.Chart, New Rectangle(50, 10, 1100, 800))
WebChart1.Chart.Printer.EndPrint()
End If
Above is my code snippet from my Print Graph button - Any ideas would be appreciated
Printing Graph from a Web Project
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Printing Graph from a Web Project
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Printing Graph from a Web Project
Thanks for advice, I am new to this, I have added Javascript at the beginning of my Source, but when I add printpage() to my button click I get the error 'printpage' is not a member of 'ASP.webiss_graph_history_aspx'.
This is my button code
<td style="width: 445px; height: 8px; text-align: center">
<asp:Button ID="btnPrint" runat="server" BackColor="#C0FFC0" Height="32px" OnClick="printpage()"
Text="Print Graph" ToolTip="Print Graph" /></td>
This is what I added at the top
<script language="Javascript1.2">
function printpage() {
window.print();
}
</script>
This is my button code
<td style="width: 445px; height: 8px; text-align: center">
<asp:Button ID="btnPrint" runat="server" BackColor="#C0FFC0" Height="32px" OnClick="printpage()"
Text="Print Graph" ToolTip="Print Graph" /></td>
This is what I added at the top
<script language="Javascript1.2">
function printpage() {
window.print();
}
</script>
Re: Printing Graph from a Web Project
OK, I managed to print using the onClientClick from your example.
The problem I have is - I only want the graph to print - not the whole screen
Please help
The problem I have is - I only want the graph to print - not the whole screen
Please help
Re: Printing Graph from a Web Project
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |