Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Dynamic page control?

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

Former Member
replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question