Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
755
Field Layout in report
posted

Hi, 

In my application, I have a large grid that shoes many columns.  There is to many columns to fit on one paper page event in landscape.  I can make it fit by changing the column setup.  Putting 3 rows in 1 record (FieldMoving) so the data is "wraped" to fit on the page.  The result on paper is fine, but I dont want to use the same fieldLayout on paper and on screen.  Is it possible to change it only for reporting and not on screen?

 Thanks

Karine.

  • 4850
    Offline posted

    Hi Karine,

    Yes, you can wire up the events on the cloned datapresenter used inside the print by listening for the PaginationStaring event of the EmbedddVisualReportSection, e.g.:

    EmbeddedVisualReportSection evrs = new EmbeddedVisualReportSection(this.xamGrid);

    evrs.PaginationStarting += new EventHandler<EmbeddedVisualPaginationEventArgs>(evrs_PaginationStarting);

    void evrs_PaginationStarting(object sender, EmbeddedVisualPaginationEventArgs e)

    {

    DataPresenterBase reportDataPresenter = e.VisualPaginator as DataPresenterBase;

     

    if ( reportDataPresenter != null )reportDataPresenter.FieldLayoutInitialized += new EventHandler<FieldLayoutInitializedEventArgs>(clonedGrid_FieldLayoutInitialized);

    }

    void clonedGrid_FieldLayoutInitialized(object sender, FieldLayoutInitializedEventArgs e)

    {

    FieldLayout fl = e.FieldLayout;

    // do stuff

    }

    Joe