Displaying Regular Report Document Action View

Operating system requirements: iOS 5.0 or later.

Mobile device: iPad.

Description

This example implements displaying of a regular report document action view.

Source Code

Executing the example requires to place the following code in the body of the executeExample method of the ViewController class (see the Displaying of Regular Report section):

// Get view displaying regular report
MAProceduralReportViewController *proceduralReportController = (MAProceduralReportViewController *)m_controller;
// Get array of regular report views
NSArray *dataViewControllers = [proceduralReportController dataViewControllers];
// Parse regular report views in cycle
for( UIViewController *controller in dataViewControllers)
{
    // Check if the current view is a regular report sheet viewer
    if([controller isMemberOfClass:[MAProceduralReportDataViewController class]])
    {
        // Get sheet viewer view
        MAProceduralReportDataViewController *dataViewController =(MAProceduralReportDataViewController *)controller;
        // Create a regular report document action view
        ProceduralOptionsViewController *optionsController = [[ProceduralOptionsViewController alloc] init];
        [optionsController setContentSizeForViewInPopover:CGSizeMake(300.0, 200.0)];
        // Set report viewer delegate in created view
        [optionsController setDelegate: dataViewController];
        // Create a popup window
        UINavigationController *navController =[[[UINavigationController alloc] initWithRootViewController: optionsController] autorelease];
        UIPopoverController *popoverController = [[UIPopoverController alloc] initWithContentViewController:navController];
        popoverController.delegate = dataViewController;
        // Display popup window
        [popoverController presentPopoverFromRect:CGRectMake(100, 100, 1, 1) inView:[dataViewController pdfView].scrollView permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO];
    }
}

After executing the example the mobile device screen displays the regular report, for which a popup window is displayed that contains the regular report document action view.

See also:

Examples of Component Use