com.businessobjects.dsws.reportengine
Interface ViewSupport


public interface ViewSupport

ViewSupport objects are used to control the format in which a document is retrieved from the Web Services Server.
By default, when a DocumentInformation object is returned with data included, it is as a report page in character HTML format.
To retrieve a document view in another format such as PDF, the ViewSupport must be set explicitly.

Example: Retrieve a document's contents in binary PDF format

        ViewSupport pdfViewSupport = ViewSupport.Factory.newInstance();
        pdfViewSupport.setOutputFormat(OutputFormatType.PDF);
        pdfViewSupport.setViewType(ViewType.BINARY);
        pdfViewSupport.setViewMode(ViewModeType.DOCUMENT);
 RetrieveBinaryView retBinView = RetrieveBinaryView.Factory.newInstance();
        retBinView.setViewSupport(pdfViewSupport);
        RetrieveData retBOData = RetrieveData.Factory.newInstance();
        retBOData.setRetrieveView(retBinView);
        DocumentInformation docInfo = boRepEng.getDocumentInformation(strDocid,null,null,null,retBOData);
 BinaryView myBinView = (BinaryView) docInfo.getView();
        OutputStream outputStream = response.getOutputStream();
        response.setContentType("application/pdf");
        response.setHeader("Content-Type","application/pdf");
        response.setDateHeader("expires", 0);
        byte[] abyBinaryContent = myBinView.getContent();
        //output the binary stream via the response object
        outputStream.write(abyBinaryContent);
 

Note: When using a ViewSupport object, OutputFormatType, ViewType and ViewMode have to be set to ensure the document is retrieved correctly.

See Also:
ReportEngine, BinaryView, CharacterView, XMLView, ViewModeType, RetrieveData, RetrieveView, OutputFormatType, DocumentInformation

Nested Class Summary
static class ViewSupport.Factory
          A class with methods for creating instances of the ViewSupport type.
 
Field Summary
static org.apache.xmlbeans.SchemaType type
          Internal Use Only.
 
Method Summary
 OutputFormatType.Enum getOutputFormat()
          Returns the OutputFormatType assigned to this object.
 ViewModeType.Enum getViewMode()
          Returns the ViewModeType assigned to this object.
 ViewType.Enum getViewType()
          Returns the ViewType assigned to this object.
 void setOutputFormat(OutputFormatType.Enum outputFormat)
          Sets the OutputFormatType of the document to be retrieved from the server.
 void setViewMode(ViewModeType.Enum viewMode)
          Sets the ViewModeType of the document to be retrieved from the server.
 void setViewType(ViewType.Enum viewType)
          Sets the ViewType of the document to be retrieved from the server.
 OutputFormatType xgetOutputFormat()
          Internal Use Only.
 ViewModeType xgetViewMode()
          Internal Use Only.
 ViewType xgetViewType()
          Internal Use Only.
 void xsetOutputFormat(OutputFormatType outputFormat)
          Internal Use Only.
 void xsetViewMode(ViewModeType viewMode)
          Internal Use Only.
 void xsetViewType(ViewType viewType)
          Internal Use Only.
 

Field Detail

type

static final org.apache.xmlbeans.SchemaType type

Internal Use Only.

Method Detail

getViewMode

ViewModeType.Enum getViewMode()
Returns the ViewModeType assigned to this object.
See ViewModeType for a list of possible document view modes.

Note: The following table shows the relationship between ViewModeType and OutputFormatType.

Crystal documents

OutputFormatType
ViewModeType
BINARY_CONTENT EXCEL PDF RTF XML HTML
DOCUMENT YYYY  
REPORT       
REPORT_PAGE  YYY Y
ALL_DATA_PROVIDERS       

Web Intelligence documents

OutputFormatType
ViewModeType
BINARY_CONTENT EXCEL PDF RTF XML HTML
DOCUMENT  YY   
REPORT  YY YY
REPORT_PAGE  YY YY
REPORT_PART  YY Y 
ALL_DATA_PROVIDERS     Y 
QUICK_REPORT_PAGE  YY YY

Returns:
The ViewModeType assigned to this object.
See Also:
ViewModeType

xgetViewMode

ViewModeType xgetViewMode()

Internal Use Only.


setViewMode

void setViewMode(ViewModeType.Enum viewMode)
Sets the ViewModeType of the document to be retrieved from the server.
See ViewModeType for a list of possible types.
An example of how to use this function can be found here.

Parameters:
viewMode - The ViewModeType to be assigned to the document.
See Also:
ViewModeType, ReportEngine.getDocumentInformation(String documentReference, RetrieveMustFillInfo retrieveMustFillInfo, Action[] actions, Navigate navigate, RetrieveData retrieveData)

xsetViewMode

void xsetViewMode(ViewModeType viewMode)

Internal Use Only.


getOutputFormat

OutputFormatType.Enum getOutputFormat()
Returns the OutputFormatType assigned to this object.
See OutputFormatType for a list of possible document output formats.

Returns:
The OutputFormatType assigned to this object.
See Also:
OutputFormatType

xgetOutputFormat

OutputFormatType xgetOutputFormat()

Internal Use Only.


setOutputFormat

void setOutputFormat(OutputFormatType.Enum outputFormat)
Sets the OutputFormatType of the document to be retrieved from the server.
See OutputFormatType for a list of possible document output formats.
An example of how to use this function can be found here.

Parameters:
outputFormat - The output format to be assigned to the document
See Also:
OutputFormatType

xsetOutputFormat

void xsetOutputFormat(OutputFormatType outputFormat)

Internal Use Only.


getViewType

ViewType.Enum getViewType()
Returns the ViewType assigned to this object.
See ViewType for a list of possible document view types.

Note: The following table shows the relationship between ViewType and OutputFormatType.

OutputFormatType
ViewType
BINARY_CONTENT EXCEL PDF RTF XML HTML
CHARACTER     YY
XML     Y 
BINARY YYYY  

Returns:
The ViewType assigned to this object.
See Also:
ViewType

xgetViewType

ViewType xgetViewType()

Internal Use Only.


setViewType

void setViewType(ViewType.Enum viewType)
Sets the ViewType of the document to be retrieved from the server.
See ViewType for a list of possible document view types.
An example of how to use this function can be found here.

Parameters:
viewType - the view type to be assigned to this object

xsetViewType

void xsetViewType(ViewType viewType)

Internal Use Only.