com.crystaldecisions.report.web.viewer
Class ReportServerControl

java.lang.Object
  extended bycom.crystaldecisions.report.web.ServerControl
      extended bycom.crystaldecisions.report.web.viewer.ReportServerControl
Direct Known Subclasses:
CrystalReportViewerBase, ReportExportControl

public class ReportServerControl
extends ServerControl

This class allows you to manage how reports interact with the server. There are methods for manipulating the logon, parameters, and selection formulas for a report.


Constructor Summary
ReportServerControl()
           
 
Method Summary
 void addReportPartBookmarkNavigationEventListener(IReportPartBookmarkNavigationEventListener listener)
          Adds a listener for ReportPartBookmarkNavigationEventArgs.
 void addReportSourceChangeEventListener(ReportSourceChangeEventListener listener)
          Adds a listener for report source changes.
 void dispose()
          Disposes of the ReportServerControl.
 ConnectionInfos getDatabaseLogonInfos()
          Returns the information required to log on to the database.
 java.lang.Object getEnterpriseLogon()
          Deprecated. As of Version 10.
 Fields getParameterFields()
          Returns the parameter fields for the report.
 int getRenderingDPI()
          Gets the screen DPI for rendering the viewer and the report.
 IReportSource getReportSource()
          Returns the report source object.
 java.lang.String getReportSourceClassFactoryName()
          Deprecated. As of Version 10.
 java.lang.String getSelectionFormula()
          Returns the selection formula value for the report (Note: not supported by the Java Reporting Component).
 java.lang.String getStyleSheetFileName()
          Returns the file name of the cascading style sheet applied to the report.
 java.lang.String getViewTimeSelectionFormula()
          Note: This method is not supported by the Java Reporting Component.
 boolean isEnableLogonPrompt()
          Returns whether or not logon prompting for the report is enabled.
 boolean isEnableParameterPrompt()
          Returns whether or not parameter prompting for the report is enabled.
 boolean isReuseParameterValuesOnRefresh()
          Gets whether the current parameter values will be used when the viewer is refreshed.
 void navigateTo(java.lang.String sDataContext, java.lang.String sObjectName)
          Navigates to a particular report object in the current report (note: not supported by the Java Reporting Component).
 void refresh()
          Refreshes the report.
 void removeReportPartBookmarkNavigationEventListener()
          Removes a DrillDownSubreportEventListener (note: not supported by the Java Reporting Component).
 void removeReportPartBookmarkNavigationEventListenerr()
          Deprecated.  
 void removeReportSourceChangeEventListener()
          Removes a report source change event listener.
 void setDatabaseLogonInfos(ConnectionInfos newDatabaseLogonInfos)
          Sets the information required to log on to the database.
 void setEnableLogonPrompt(boolean newEnableLogonPrompt)
          Sets whether or not the logon prompt is enabled for the report.
 void setEnableParameterPrompt(boolean newEnableParameterPrompt)
          Sets whether or not the parameter prompt is enabled for the report.
 void setEnterpriseLogon(java.lang.Object newEnterpriseLogon)
          Deprecated. As of Version 10.
 void setParameterFields(Fields newParameterFields)
          Sets the parameter fields for the report.
 void setRenderingDPI(int i)
          Sets the screen resolution (in dots per inch) for rendering the viewer and the report.
 void setReportSource(java.lang.Object reportSource)
          Sets the report instance that the viewer will render in HTML.
 void setReportSourceClassFactoryName(java.lang.String newReportClassFactoryName)
          Deprecated. As of Version 10.
 void setReuseParameterValuesOnRefresh(boolean newReuseParameterValuesOnRefresh)
          Sets whether or not to re-prompt parameters on refresh.
 void setSelectionFormula(java.lang.String newSelectionFormula)
          Sets the selection formula that will be used when the report is displayed (note: not supported by the Java Reporting Component).
 void setStyleSheetFileName(java.lang.String newStyleSheetFileName)
          Sets the style sheet that will be used to display the report content.
 void setViewTimeSelectionFormula(java.lang.String newSelectionFormula)
          Note: This method is not supported by the Java Reporting Component.
 
Methods inherited from class com.crystaldecisions.report.web.ServerControl
getHeight, getHtmlContent, getLeft, getName, getProductLocale, getTop, getURI, getViewState, getWidth, isIgnoreViewStateOnLoad, isOwnForm, isOwnPage, processHttpRequest, setHeight, setIgnoreViewStateOnLoad, setLeft, setName, setOwnForm, setOwnPage, setProductLocale, setTop, setURI, setViewState, setWidth
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportServerControl

public ReportServerControl()
Method Detail

addReportPartBookmarkNavigationEventListener

public void addReportPartBookmarkNavigationEventListener(IReportPartBookmarkNavigationEventListener listener)
                                                  throws java.util.TooManyListenersException

Adds a listener for ReportPartBookmarkNavigationEventArgs. Please note that report parts are not available without the advanced viewers provided with the Report Application Server.

Parameters:
listener - The DrillDownSubreportEventListener.
Throws:
TooManyListenersException - This is thrown if you attempt to add more than one listener on a particular listener source concurrently.

addReportSourceChangeEventListener

public void addReportSourceChangeEventListener(ReportSourceChangeEventListener listener)

Adds a listener for report source changes.

Parameters:
listener - The listener for report source changes.

dispose

public void dispose()

Disposes of the ReportServerControl.


getDatabaseLogonInfos

public ConnectionInfos getDatabaseLogonInfos()
                                      throws ReportSDKExceptionBase

Returns the information required to log on to the database.

Returns:
The information required to log on to the database as a com.crystaldecisions.sdk.occa.report.data.ConnectionInfo object.
Throws:
ReportSDKExceptionBase - This exception is thrown if the process is unsuccessful.
See Also:
setDatabaseLogonInfos, setEnableLogonPrompt

getEnterpriseLogon

public java.lang.Object getEnterpriseLogon()
Deprecated. As of Version 10.


getParameterFields

public Fields getParameterFields()
                          throws ReportSDKExceptionBase

Returns the parameter fields for the report.

Returns:
The parameter fields for the report as a com.crystaldecisions.sdk.occa.report.data.Fields object.
Throws:
ReportSDKExceptionBase - This exception is thrown if the process is unsuccessful.
See Also:
isEnableParameterPrompt, setEnableParameterPrompt, setParameterFields

getReportSource

public IReportSource getReportSource()
                              throws ReportSDKExceptionBase

Returns the report source object.

Returns:
The report source object.
Throws:
ReportSDKExceptionBase - This exception is thrown if the process is unsuccessful.
See Also:
setReportSource

getReportSourceClassFactoryName

public java.lang.String getReportSourceClassFactoryName()
Deprecated. As of Version 10.


getSelectionFormula

public java.lang.String getSelectionFormula()
                                     throws ReportSDKExceptionBase

Returns the selection formula value for the report (Note: not supported by the Java Reporting Component).

Note: This method is only available after the processHttpRequest method or getHtmlContent method has been called.

Returns:
The selection formula value for the report as a String.
Throws:
ReportSDKExceptionBase - This exception is thrown if the process is unsuccessful.
See Also:
setSelectionFormula

getViewTimeSelectionFormula

public java.lang.String getViewTimeSelectionFormula()

Note: This method is not supported by the Java Reporting Component.


getStyleSheetFileName

public java.lang.String getStyleSheetFileName()

Returns the file name of the cascading style sheet applied to the report.

Returns:
The file name of the cascading style sheet applied to the report as a String.
See Also:
setStyleSheetFileName

isEnableLogonPrompt

public boolean isEnableLogonPrompt()

Returns whether or not logon prompting for the report is enabled.

Returns:
true if logon prompting is enabled, otherwise false.
See Also:
getDatabaseLogonInfos, setDatabaseLogonInfos, setEnableLogonPrompt

isEnableParameterPrompt

public boolean isEnableParameterPrompt()

Returns whether or not parameter prompting for the report is enabled.

Returns:
true if parameter prompting is enabled, otherwise false.
See Also:
getParameterFields, setEnableParameterPrompt, setParameterFields

isReuseParameterValuesOnRefresh

public boolean isReuseParameterValuesOnRefresh()

Gets whether the current parameter values will be used when the viewer is refreshed.

Returns:
true if the current parameter values will be used when the viewer is refreshed and false otherwise.
See Also:
getParameterFields, isEnableParameterPrompt, setEnableParameterPrompt, setParameterFields, setReuseParameterValuesOnRefresh

navigateTo

public void navigateTo(java.lang.String sDataContext,
                       java.lang.String sObjectName)

Navigates to a particular report object in the current report (note: not supported by the Java Reporting Component).

Note: The sDataContext parameter specifies the group within the report where the report object specified by sObjectName is located. The sObjectName is the name specified for the report object in the Crystal Reports designer.

Note: The wild card (*) can only be set for the last level.

Parameters:
sDataContext - A String that specifies the data subtree of the report.
sObjectName - A String that specifies the name of the report object.

refresh

public void refresh()

Refreshes the report.


removeReportPartBookmarkNavigationEventListener

public void removeReportPartBookmarkNavigationEventListener()

Removes a DrillDownSubreportEventListener (note: not supported by the Java Reporting Component).


removeReportPartBookmarkNavigationEventListenerr

public void removeReportPartBookmarkNavigationEventListenerr()
Deprecated.  

Removes a DrillDownSubreportEventListener.


removeReportSourceChangeEventListener

public void removeReportSourceChangeEventListener()

Removes a report source change event listener.


setDatabaseLogonInfos

public void setDatabaseLogonInfos(ConnectionInfos newDatabaseLogonInfos)

Sets the information required to log on to the database. Once this information has been set, it cannot be changed. Refreshing the report will resubmit the originally set logon values.

Note: If the value of the DatabaseLogonInfos property is not set at design time, you can prompt the user for logon information before the report is run by setting the setEnableLogonPrompt method to true.

Parameters:
newDatabaseLogonInfos - A com.crystaldecisions.sdk.occa.report.data.ConnectionInfo object that specifies the information required to log on to the database.
See Also:
getDatabaseLogonInfos

setEnableLogonPrompt

public void setEnableLogonPrompt(boolean newEnableLogonPrompt)

Sets whether or not the logon prompt is enabled for the report.

Note: If this property is set to false and a database logon is needed, and is not supplied programmatically through the setDatabaseLogonInfos method, viewing the report fails.

Parameters:
newEnableLogonPrompt - true to enable logon prompt for the report, if a database logon is needed.
See Also:
isEnableLogonPrompt, getDatabaseLogonInfos, setDatabaseLogonInfos

setEnableParameterPrompt

public void setEnableParameterPrompt(boolean newEnableParameterPrompt)

Sets whether or not the parameter prompt is enabled for the report.

Note: If this property is set to false and parameter field information is needed, and is not supplied programmatically through the setParameterFields method, viewing the report fails.

Parameters:
newEnableParameterPrompt - true to enable parameter prompt for this report, if parameter field information is required.

setEnterpriseLogon

public void setEnterpriseLogon(java.lang.Object newEnterpriseLogon)
Deprecated. As of Version 10.


setParameterFields

public void setParameterFields(Fields newParameterFields)

Sets the parameter fields for the report.

Note: If the value of the ParameterFields property is not set at design time, you can prompt the user for parameter fields before the report is run by setting the setEnableParameterPrompt method to true. You can also programmatically set the parameter fields and then set ParameterEnableParameterPrompt to False. To update the parameter fields once they've been set (either by prompting the user or programmatically), you must set the setReuseParametersOnRefresh property to False and call the Refresh method after setting the new parameters in.

The viewer sets the value of this property after you set the report source for the report.

Parameters:
newParameterFields - A com.crystaldecisions.sdk.occa.report.data.Fields object that specifies the new parameter fields for the report.
See Also:
getParameterFields, isEnableParameterPrompt, setEnableParameterPrompt

setReportSource

public void setReportSource(java.lang.Object reportSource)
                     throws ReportSDKExceptionBase

Sets the report instance that the viewer will render in HTML.

Note: The setReportSource property must be set in order for the viewer to work correctly.

Parameters:
reportSource - An Object representing the report instance that the viewer will render in HTML.
Throws:
ReportSDKExceptionBase - This exception is thrown if the process is unsuccessful.
See Also:
getReportSource

setReportSourceClassFactoryName

public void setReportSourceClassFactoryName(java.lang.String newReportClassFactoryName)
Deprecated. As of Version 10.


setReuseParameterValuesOnRefresh

public void setReuseParameterValuesOnRefresh(boolean newReuseParameterValuesOnRefresh)

Sets whether or not to re-prompt parameters on refresh.

Note: This property only applies to parameters fields that have been set through the viewers (either programmatically through the setParameterFields method, or by prompting the user for parameter field information).

Parameters:
newReuseParameterValuesOnRefresh - true to not prompt for parameters when refreshing a report that already has parameter values set.
See Also:
isReuseParameterValuesOnRefresh

setSelectionFormula

public void setSelectionFormula(java.lang.String newSelectionFormula)

Sets the selection formula that will be used when the report is displayed (note: not supported by the Java Reporting Component).

Note: In a managed environment, you must have the appropriate permissions to set the setSelectionFormula property. Alternatively, you can use the setViewTimeSelectionFormula method. The setViewTimeSelectionFormula method can be set regardless of which permissions you have. This is because setting the setSelectionFormula method replaces the existing selection formula, while setting the setViewTimeSelectionFormula method leaves the existing selection formula intact and then applies the view time selection formula overtop.

The default value is an empty string.

Parameters:
newSelectionFormula - A String that specifies the selection formula to use when the report is displayed.
See Also:
getSelectionFormula

setStyleSheetFileName

public void setStyleSheetFileName(java.lang.String newStyleSheetFileName)

Sets the style sheet that will be used to display the report content. The file should be located in the directory crystalreportviewers11\css on the machine where the Java web application server is running. The cascading style sheet that you use needs to contain the same classes as the default style sheet.

Parameters:
newStyleSheetFileName - A String that specifies the file name for the style sheet (for example stylesheet.css).

setViewTimeSelectionFormula

public void setViewTimeSelectionFormula(java.lang.String newSelectionFormula)

Note: This method is not supported by the Java Reporting Component.


getRenderingDPI

public int getRenderingDPI()

Gets the screen DPI for rendering the viewer and the report.

Returns:
the rendering DPI as an integer

setRenderingDPI

public void setRenderingDPI(int i)

Sets the screen resolution (in dots per inch) for rendering the viewer and the report. The recommended values for this property are 96 and 120.

Parameters:
i - the rendering DPI as an integer