http://blogs.infragistics.com/wpf/articles/printing-the-xamdatagrid-with-infragistics-reports.aspx
Using the above as a reference I've had great results printing my report. For some reason though the Print Preview window has everything in it except for the actual series items. Even though there are no series items if I hit the Print button from the print preview window it will print all the series objects just fine.
Public Shared Sub PrintPreview(ByVal V As Visual) Dim Report As New Report Dim Section1 As New EmbeddedVisualReportSection(V) Report.Sections.Add(Section1) Report.PageFooter = New TextBlock() With {.Text = My.Application.Info.Description & My.Application.Info.Version.ToString & " - CONFIDENTIAL INFORMATION - " & DateTime.Now.ToString, .VerticalAlignment = VerticalAlignment.Top} Report.ReportSettings.PageOrientation = PageOrientation.Landscape Report.ReportSettings.HorizontalPaginationMode = HorizontalPaginationMode.Scale Report.PageHeader = New TextBlock() With {.Text = My.Settings.TeamName, .VerticalAlignment = VerticalAlignment.Center, .TextAlignment = TextAlignment.Center, .FontWeight = FontWeights.Bold} Dim pp As New PrintPreview 'Method Signature GeneratePreview(Report, bool showPrintDialog, bool showReportProgressControl pp.xamReportPreview1.GeneratePreview(Report, False, True) pp.ShowDialog() End Sub
The 3rd line from the bottom is where the series items are actually added. What I mean is that if you look at the chart being passed into this subroutine it will have nothing in its series collection. Once the GeneratePreview method is called then the series items are added. I tried removing a series item from the Series collection and then adding it back to get it to 'redraw' but this made no difference. Any ideas?
Well it's certainly not elegant but I was able to get my PrintPreview series items to render by creating a 'DummyPrintPreview' routine which is identical to the above code except that pp.ShowDialog() is omitted. I made a call to my Dummy routine just before the Dim pp As New PrintPreview line.
Hi ,
I am facing same problem, can you please upload sample code.
Thanks in Advance,
Kiran
Hello Kiran,
As far as understood SESRuss was able to get his PrintPreview series items to render by creating a 'DummyPrintPreview' routine, which is identical to the above code except that pp.ShowDialog() is omitted. He also made a call to his Dummy routine just before the:
Dim pp As New PrintPreview
line. Did you try this workaround? If you did and you still have issues, could you please send an isolated sample project, where this is reproduced, so I can investigate it further for you.
Looking forward for your reply.