Working with Regular Report Documents

Operating system requirements: iOS 5.0 or later.

Mobile device: iPad.

Description

This example describes some methods of working with regular report documents. Regular report consists of the sheets that are PDF documents, including tables, charts, maps. After starting the example the following operations are executed:

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 regular report object
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;
        // Get number of regular report documents
        int documentsCount = [dataViewController documentsCount];
        // Get current document index in regular report
        int currentDocumentIndex = [dataViewController currentDocumentIndex];
        // Check if the next document exists
        if(currentDocumentIndex + 1 < documentsCount)
        {
            // Display next document name in the development environment consloe
            NSLog(@"Document name: %@",[dataViewController documentNameAtIndex:currentDocumentIndex + 1]);
            // Open document
            [dataViewController openDocumentAtIndex:currentDocumentIndex + 1];
        }
    }
}

After executing the example the mobile device screen displays a regular report. This report contains a document, which name is displayed in the development environment console: 

Document name: Profile

See also:

Examples of Component Use