on 07-22-2015 6:44 AM
Dear Experts,
I'm using Crystal report 13.0.7 with wpf application and I want to control page length by vb.net code and printer independent, i have write some logic but not fount result as i wish.
Please guide me what is missing......
-------------------------------------------------------------------------------------
Dim report As New ReportDocument
Dim billrpt As String = "\print\blkprt.rpt"
report = New CrystalDecisions.CrystalReports.Engine.ReportDocument ' ReportDocument
report.Load(billrpt)
report.SetParameterValue(0, Ser) 'Bill Serial
report.SetParameterValue(1, Invno) ' Bill No
report.SetParameterValue(2, Invnodt) ' Bill Date
Dim PkSize As New System.Drawing.Printing.PaperSize
Dim wd As Integer = 8.50
Dim hd As Integer = 6.00
report.PrintOptions.DissociatePageSizeAndPrinterPaperSize = False
PkSize = New Printing.PaperSize("manoj", wd, hd)
report.PrintOptions.PaperSize = CType(PkSize.RawKind, CrystalDecisions.Shared.PaperSize)
report.PrintOptions.PaperOrientation = IIf(report.PrintOptions.PaperOrientation = PaperOrientation.Portrait, CrystalDecisions.Shared.PaperOrientation.Portrait, CrystalDecisions.Shared.PaperOrientation.Landscape)
report.PrintToPrinter(1, False, 0, 0)
report.Close()
report.Dispose()
-------------------------------------------------------------------------------------
Thanks
Manoj Patel
Hi Manoj,
Download SP 14 and test again, we have updated the WPF viewer a few times since SP 7.
Also, change this line to True:
report.PrintOptions.DissociatePageSizeAndPrinterPaperSize = False
That way it does not rely on your default printer
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.