开发者

Crystal report printing

I got a problem I want to print a report which is receipt having size 3 x 4 cm. i am unable to resize crystal report. i am using crystal report coming with visual studio.n开发者_如何学运维et 2008.

thank you


This happens sometimes with Crystal Reports. I have faced the same problem before, and tried this code successfully. You also try this and tell me what happened...

Dim doctoprint As New System.Drawing.Printing.PrintDocument()
doctoprint.PrinterSettings.PrinterName = "YourPrinterName" '(ex. "Epson SQ-1170 ESC/P 2")
For i = 0 To doctoprint.PrinterSettings.PaperSizes.Count - 1
    Dim rawKind As Integer
    If doctoprint.PrinterSettings.PaperSizes(i).PaperName = "MyCustomFormatName" Then
        rawKind = CInt(doctoprint.PrinterSettings.PaperSizes(i).GetType().GetField("kind", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic).GetValue(doctoprint.PrinterSettings.PaperSizes(i)))
        oRpt.PrintOptions.PaperSize = rawKind
        Exit For
    End If
Next
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜