I've been looking for a sample or reference implementation of IEmbeddedVisualPaginator, but no luck. Do you have one available somewhere?
Hello,
At this time the best "sample" implementation we have is the implementation of the DataPresenter which can be seen if you download our source code. This is obviously rather complex to use as a guide, so I am creating a case for you and will be logging a new feature request for a sample of the IEmbeddedVisualPaginator. I will provide the information about the feature request through the case that I create.
Jason,
Was it feature request completed ? Can I find a sample of IEmbeddedVisualPaginator somewhere ?
Thanks,
Ed
Hi Ed,
Unfortunately this feature request hasn't been fulfilled yet. Jason's suggestion about using the DataPresenter is still accurate as of this moment. I recommend that you submit this as a product idea here. We no longer use the feature request system we had back when Jason initially replied. We use a newer system that allows customers to vote on what features they want to see added. This newer system also allows more direct communication between customers and our product management.
Thanks for the answer, I will submit the product idea...But anyway, could anybody answer my questions about IEmbeddedVisualPaginator usage ? Now I'm trying to print WPF screen data - xamGrid or regular DataGrid using Report class and I would like to make custom page printing. For now when I create EmbeddedVisualReportSection with data grid as a single argument, report prints only displayed part of the grid with visible vertical scroll bar. I would like to print all data in several pages and I would prefer to add a header to each page. As far as I understand, I have to create a EmbeddedVisualReportSection object using 2 arguments constructor - grid as a first argument and a paginator as a second argument. Paginator should implement IEmbeddedVisualPaginator interface and it should set CurrentPageDataContext as a page content for each printed page. The question is - how can I set this page content ? I cannot just set it to (for example) specific grid line - something like _currentPageDataContext = grid.Items[i], in this case I receive 'Must disconnect specified child from current parent Visual before attaching to new parent visual' error.
1.) Correct. The XamGrid does not implement IEmbeddedVisualPaginator.
2.) Please see the following documentation: http://help.infragistics.com/doc/WPF/2014.1/CLR4.0/?page=xamDataPresenter_Repeat_Field_Headers_on_All_Pages.html
Hi Rob,
I tried to create XamDataGrid based on DataGrid data and print it instead...It works, but in practice if I have to create generic print procedure I have to generate XamDataGrid based on DataGrid with all formatting.
Also on one of the screens we have XamGrid and I tried to do the same, but I received strange PrintSystemException - 'Printing was cancelled. Win32 error: The parameter is incorrect'.
Thanks for the suggestion, I will try this approach. The only problem I see - XamDataGrid is much 'heavier' than DataGrid and I will probably have some speed issues. Currently we switched from XamDataGrid grid to DataGrid on some screens to make data refresh faster. I also have some other questions:
1. XamGrid does not implement IEmbeddedVisualPaginator, correct ?
2. When I try to print XamDataGrid (actually it was XamDataPresenter), it works fine, but only first printed page has grid header. Is it possible to print header on all pages ?
If you need to print a grid I would recommend using the XamDataGrid as it is already setup to work with the WPF Reporting api. XamDataGrid implements the necessary interfaces to work with EmbeddedVisualReportSection. http://help.infragistics.com/doc/WPF/2014.1/CLR4.0/?page=WPF_Reporting_Getting_Started_with_WPF_Reporting.html
You can have a hidden XamDataGrid in your application bound to the same data as the other grids and when you need to print your grid, you can use the XamDataGrid instead.
Adding any other control to the Report is going to cause it to only render what is actually visible inside the application. So if your control is really 100 pixels wide, but visibly it is only 50 pixels, only 50 pixels of the grid will be added to the report. If you wanted to display the entire control you would have to create a second instance of the control, bind it to whatever data the original control is bound to and then measure/arrange it manually providing the full size as arguments. You could then pass the control to the report and it should render the full control. You won't have control over how the control is paginated though. If you need custom pagination then you'll need to take a look at how the XamDataGrid does it and mimic that.