Question

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.net 2008.

thank you

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top