Advertisement
Advertisement
| 05.13.2008 at 02:23PM PDT, ID: 23399520 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: |
Imports System.IO
Imports System.Data
Imports System.Text
Imports System.Drawing.Imaging
Imports System.Drawing.Printing
Imports System.Collections.Generic
Imports Microsoft.Reporting.WinForms
Public Class Reporting
Implements IDisposable
Public m_currentPageIndex As Integer
Public m_streams As IList(Of Stream)
Public Function CreateStream(ByVal name As String, _
ByVal fileNameExtension As String, _
ByVal encoding As Encoding, ByVal mimeType As String, _
ByVal willSeek As Boolean) As Stream
Dim stream As Stream = _
New FileStream("C:\" + name + "." + fileNameExtension, FileMode.Create)
m_streams.Add(stream)
Return stream
End Function
Public Sub Export(ByVal report As LocalReport)
Dim deviceInfo As String = _
"<DeviceInfo>" + _
" <OutputFormat>EMF</OutputFormat>" + _
" <PageWidth>6in</PageWidth>" + _
" <PageHeight>3.5in</PageHeight>" + _
" <MarginTop>0.2in</MarginTop>" + _
" <MarginLeft>0.2in</MarginLeft>" + _
" <MarginRight>0.2in</MarginRight>" + _
" <MarginBottom>0.2in</MarginBottom>" + _
"</DeviceInfo>"
Dim warnings() As Warning = Nothing
m_streams = New List(Of Stream)()
Try
report.Render("Image", deviceInfo, AddressOf CreateStream, warnings)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Dim stream As Stream
For Each stream In m_streams
stream.Position = 0
Next
End Sub
Public Sub PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
Dim pageImage As New Metafile(m_streams(m_currentPageIndex))
ev.Graphics.DrawImage(pageImage, ev.PageBounds)
m_currentPageIndex += 1
ev.HasMorePages = (m_currentPageIndex < m_streams.Count)
End Sub
Public Sub Print()
Const printerName As String = "Microsoft Office Document Image Writer"
If m_streams Is Nothing OrElse m_streams.Count = 0 Then
Return
End If
Dim printDoc As New PrintDocument()
If Not printDoc.PrinterSettings.IsValid Then
Dim msg As String = String.Format( _
"Can't find printer ""{0}"".", printerName)
Console.WriteLine(msg)
Return
End If
AddHandler printDoc.PrintPage, AddressOf PrintPage
printDoc.PrinterSettings.PrinterName = "ZDesigner TLP 2844-Z" '--> DOES NOT WORK IF NETWORKED, WORKS FOR LOCAL PRINTER
If PrintAll = True Then
printDoc.PrinterSettings.Copies = 0
Else
printDoc.PrinterSettings.Copies = Qty
End If
printDoc.Print() '--> ERROR WITH EXCEPTION AT THIS SECTION
End Sub
Public Overloads Sub Dispose() Implements IDisposable.Dispose
If Not (m_streams Is Nothing) Then
Dim stream As Stream
For Each stream In m_streams
stream.Close()
Next
m_streams = Nothing
End If
End Sub
End Class
|
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 05.13.2008 at 03:53PM PDT, ID: 21559971 |
| 05.14.2008 at 08:58AM PDT, ID: 21565577 |
| 05.14.2008 at 10:56AM PDT, ID: 21566855 |
| 05.14.2008 at 11:09AM PDT, ID: 21567001 |