cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic page control?

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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

Former Member
0 Kudos

Hello Don,

Thanks for your suggestion i'll try it....

Manoj

Answers (0)