Hello Sasikumar,
Thank you for your post. I have been looking into it and I can suggest you use the classes Infragistics has for printing the XamDataGrid. You can see a sample showing how to use them in the Samples Browser under Reporting / Organization / xamDataGrid Reporting section. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Hi Stefan,
Thanks for the reply. In my previous post I mentioned that "I will not be able to use Infragistics reporting as my application contains a third party graphics as well and i will have to club both graphics component and grid component in printout".
Nope still no luck,when RecordContainerGenerationMode property is set to pre load only the contents visible in the view are getting loaded other rows are blank. I am not using any third party tool for exporting/printing. We are using other third party components in our application other than infragistcis grid. We are using the follwing code to print the infragistics grid
"Grid" in the following code is a content control that holds an infragistics grid.
FrameworkElement fe = (Grid.Content as FrameworkElement); System.Printing.PrintCapabilities capabilities = printDlg.PrintQueue.GetPrintCapabilities(printDlg.PrintTicket); fe.Measure(new Size(Int32.MaxValue, Int32.MaxValue)); Size visualSize = fe.DesiredSize; if (fe.DesiredSize.Width >= fe.ActualWidth || fe.DesiredSize.Height >= fe.ActualHeight) fe.Arrange(new Rect(new Point(0, 0), visualSize)); MemoryStream stream = new MemoryStream(); string pack = "pack://temp.xps"; Uri uri = new Uri(pack); DocumentPaginator paginator; XpsDocument xpsDoc; DocumentViewer doc = new DocumentViewer(); Window _window = new Window(); using (Package container = Package.Open(stream, FileMode.Create)) { PackageStore.AddPackage(uri, container); using (xpsDoc = new XpsDocument(container, CompressionOption.Fast, pack)) { XpsSerializationManager rsm = new XpsSerializationManager(new XpsPackagingPolicy(xpsDoc), false); rsm.SaveAsXaml(Grid.Content);
paginator = ((IDocumentPaginatorSource) xpsDoc.GetFixedDocumentSequence()).DocumentPaginator;
paginator.PageSize = visualSize;
paginator = new VisualDocumentPaginator(paginator, new Size(capabilities.PageImageableArea.ExtentWidth, capabilities.PageImageableArea.ExtentHeight), new Size(10, 10));
doc.Document = xpsDoc.GetFixedDocumentSequence();
_window.Content = doc; _window.ShowDialog();
printDlg.PrintDocument(paginator, "A Flow Document"); }
PackageStore.RemovePackage(uri); }
Regards,
Sasikumar
I created a sample project for you following your scenario and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Thanks for the sample application.The print priview works fine when the vertical scroll bar for the xamdatagrid is at the top. If you move the vertical scollbar to any other position (i.e either to the middle or to the bottom) print preview is a blank document viewer.
And we are using the following dll intsead of v13.1
infragisticswpf4.datapresenter.v12.2,InfragisticsWPF4.Editors.v12.2, InfragisticsWPF4.v12.2
Please check above mentioned scenario in the sample application attached by you in previous post.
I have tested the sample application using the RTM of NetAdvantage 12.2 and I was able to reproduce your issue. I also tested the sample against the latest service release (2269) and everything seems to work as expected there, so I believe there was an issue in the RTM which is now fixed, so I can suggest you download the latest service release of 12.2 by logging to our web site and going to Account \Keys & Downloads. Please let me know if this helps you or you need further assistance on this matter.
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
We have used latest service release of 12.2, and it is solved in this version. Thanks.
Since the issue you encounter was related to the Excel engine, you are not able to workaround it by using XAML or code behind. The fix is internal and this is why I suggested you to download the service release. The modifications should be made in the source code of the engine.