.Net程序在98下打印有很多BUG,把错误贴上来

解决方案 »

  1.   

    下载SP2等等try{
    }
    catch(Exception e)
    {
       错误信息 = e.ToString();
    }
      

  2.   

    它是在报表内的错误,我生成完报表后,点击打印的时候它出错的。w98有SP2吗?
      

  3.   

    http://groups.google.com/groups?hl=zh-CN&lr=&ie=UTF-8&oe=UTF-8&threadm=o5gUSqEjCHA.2312%40cpmsftngxa08&rnum=1&prev=/groups%3Fq%3DOnQueryPageSettings%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Dzh-CN%26btnG%3DGoogle%25E6%2590%259C%25E7%25B4%25A2
      

  4.   

    If you haven't applied the latest .NET Framework service pack yet, you can 
    download and apply it from the following location and see if it can resolve 
    the problem.
    http://msdn.microsoft.com/netframework/downloads/updates/sp/default.asp If the problem still occurs and it only occurs in Win9x machines, you can 
    try the following code:
    1. Create a class that inherits from PrintDocument as below:
          Public Class MyDocument
        Inherits System.Drawing.Printing.PrintDocument    Private Wait As Boolean = True
        Private Reset As Boolean    Private priority As System.Threading.ThreadPriority    Protected Overrides Sub OnBeginPrint(ByVal e As 
    System.Drawing.Printing.PrintEventArgs)
        Wait = True
            MyBase.OnBeginPrint(e)    End Sub    Protected Overrides Sub OnQueryPageSettings(ByVal e As 
    System.Drawing.Printing.QueryPageSettingsEventArgs)
            If (Wait) Then
                priority = System.Threading.Thread.CurrentThread.Priority
                System.Threading.Thread.CurrentThread.Priority = 
    Threading.ThreadPriority.Lowest
                System.Threading.Thread.Sleep(0)
                Wait = False
                Reset = True
            Else
                If (Reset) Then
                    System.Threading.Thread.CurrentThread.Priority = priority
                    Reset = False
                End If
            End If
            MyBase.OnQueryPageSettings(e)
        End Sub
    End Class2. In your application, use the code similar to the following to print 
    preview:
            Dim pd As New MyDocument()
            PrintPreviewDialog1.Document = pd
        PrintPreviewDialog1.ShowDialog()
      

  5.   

    报表打印没做过,但是C#打印在98下有BUG我倒是经历过,是微软的错!
    我有微软专家提供的弥补BUG的程序。不过个别的打印机还是要发生异常,如惠普。
      

  6.   

    看看这两个。
    http://expert.csdn.net/Expert/topic/1788/1788577.xml?temp=.8955042
    http://expert.csdn.net/Expert/topic/1643/1643345.xml?temp=4.383487E-02
    然后就是经过其它途径了解到对特殊的打印机,有异常。
      

  7.   

    没办法了,幸好我是用报表打印的,报表有一个导出报表,我导成doc打印了,总算交差了,谢谢各位了。