java.lang.Objectcom.crystaldecisions.report.web.ServerControl
com.crystaldecisions.report.web.viewer.ReportServerControl
This class allows you to manage how reports interact with the server. There are methods for manipulating the report's logons, parameters, and selection formulas.
The following example includes methods from the
ReportServerControl
class, the com.crystaldecisions.sdk.occa.report.data.Fields
class, the com.crystaldecisions.sdk.occa.report.data.ParameterField
class,
the com.crystaldecisions.sdk.occa.report.data.ParameterFieldDiscreteValue
class,
the com.crystaldecisions.sdk.occa.report.data.Values
class, and the
CrystalReportViewer
class.
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()
Returns the information required to log on to Crystal Enterprise. |
Fields |
getParameterFields()
Returns the parameter fields for the report. |
IReportSource |
getReportSource()
Returns the report source object. |
java.lang.String |
getReportSourceClassFactoryName()
Returns the name of the report source class factory for the report. |
java.lang.String |
getSelectionFormula()
Returns the selection formula value for the report. |
java.lang.String |
getStyleSheetFileName()
Returns the file name of the cascading style sheet applied to the report. |
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. |
void |
refresh()
Refreshes the ReportServerControl object. |
void |
removeReportPartBookmarkNavigationEventListener()
Removes a DrillDownSubreportEventListener . |
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)
Sets the information required to log on to Crystal Enterprise. |
void |
setParameterFields(Fields newParameterFields)
Sets the parameter fields for 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)
Sets the report source class factory name. |
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. |
void |
setStyleSheetFileName(java.lang.String newStyleSheetFileName)
Sets the style sheet that will be used to display the report content. |
void |
setURI(java.lang.String newURI)
Sets the Universal Resource Identifier for the report. |
void |
setViewTimeSelectionFormula(java.lang.String newSelectionFormula)
Reserved for future use. |
Methods inherited from class com.crystaldecisions.report.web.ServerControl |
deserializeBase64ToObject, getHeight, getHtmlContent, getLeft, getName, getTop, getURI, getViewState, getWidth, isIgnoreViewStateOnLoad, isOwnForm, isOwnPage, processHttpRequest, setHeight, setIgnoreViewStateOnLoad, setLeft, setName, setOwnForm, setOwnPage, setTop, setViewState, setWidth |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ReportServerControl()
Method Detail |
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 available with the Report Application Server. For more information,
see the Crystal Reports for BEA WebLogic Workshop Developer's Guide.
listener
- The DrillDownSubreportEventListener
.
TooManyListenersException
- This is thrown if you attempt to add more than
one listener on a particular listener source concurrently.public void addReportSourceChangeEventListener(ReportSourceChangeEventListener listener)
Adds a listener for report source changes.
listener
- The listener for report source changes.public void dispose()
Disposes of the ReportServerControl
.
public ConnectionInfos getDatabaseLogonInfos() throws ReportSDKExceptionBase
Returns the information required to log on to the database.
Note: The viewer sets the value of this property after you set the report source for the report.
Note: This method is only available after the
processHttpRequest
method or
getHtmlContent
method has been called.
com.crystaldecisions.sdk.occa.report.data.ConnectionInfo
object.
ReportSDKExceptionBase
- This exception is thrown if the process is unsuccessful..setDatabaseLogonInfos
,
setEnableLogonPrompt
public java.lang.Object getEnterpriseLogon()
Returns the information required to log on to Crystal Enterprise.
Note: This can be a Crystal Enterprise session or a Crystal Enterprise Token.
Object
.setEnterpriseLogon
public Fields getParameterFields() throws ReportSDKExceptionBase
Returns the parameter fields for the report.
Note: This method is only available after the
processHttpRequest
method or
getHtmlContent
method has been called.
com.crystaldecisions.sdk.occa.report.data.Fields
object.
ReportSDKExceptionBase
- This exception is thrown if the process is unsuccessful..isEnableParameterPrompt
,
setEnableParameterPrompt
,
setParameterFields
public IReportSource getReportSource() throws ReportSDKExceptionBase
Returns the report source object.
ReportSDKExceptionBase
- This exception is thrown if the process is unsuccessful..setReportSource
public java.lang.String getReportSourceClassFactoryName()
Returns the name of the report source class factory for the report.
String
.public java.lang.String getSelectionFormula() throws ReportSDKExceptionBase
Returns the selection formula value for the report.
Note: This method is only available after the
processHttpRequest
method or
getHtmlContent
method has been called.
String
.
ReportSDKExceptionBase
- This exception is thrown if the process is unsuccessful..setSelectionFormula
public java.lang.String getStyleSheetFileName()
Returns the file name of the cascading style sheet applied to the report.
String
.setStyleSheetFileName
public boolean isEnableLogonPrompt()
Returns whether or not logon prompting for the report is enabled.
true
if logon prompting is enabled, otherwise false
.getDatabaseLogonInfos
,
setDatabaseLogonInfos
,
setEnableLogonPrompt
public boolean isEnableParameterPrompt()
Returns whether or not parameter prompting for the report is enabled.
true
if parameter prompting is enabled,
otherwise false
.getParameterFields
,
setEnableParameterPrompt
,
setParameterFields
public boolean isReuseParameterValuesOnRefresh()
Gets whether the current parameter values will be used when the viewer is refreshed.
true
if the current parameter values will be
used when the viewer is refreshed and false
otherwise.getParameterFields
,
isEnableParameterPrompt
,
setEnableParameterPrompt
,
setParameterFields
,
setReuseParameterValuesOnRefresh
public void navigateTo(java.lang.String sDataContext, java.lang.String sObjectName)
Navigates to a particular report object in the current report.
Note: The data context represents the whole group tree or a sub tree in the group tree. DataContext can be specified using either strings or integers to narrow down the search for the report object.
Note: The wild card (*) can only be set for the last level.
sDataContext
- A String
that specifies the data
subtree of the report.sObjectName
- A String
that specifies the name
of the report object.public void refresh()
Refreshes the ReportServerControl
object.
public void removeReportPartBookmarkNavigationEventListener()
Removes a DrillDownSubreportEventListener
.
public void removeReportPartBookmarkNavigationEventListenerr()
Removes a DrillDownSubreportEventListener
.
public void removeReportSourceChangeEventListener()
Removes a report source change event listener.
public void setDatabaseLogonInfos(ConnectionInfos newDatabaseLogonInfos)
Sets the information required to log on to the database.
newDatabaseLogonInfos
- A
com.crystaldecisions.sdk.occa.report.data.ConnectionInfo
object that specifies the information required to log on to the database.getDatabaseLogonInfos
public void setEnableLogonPrompt(boolean newEnableLogonPrompt)
Sets whether or not the logon prompt is enabled for the report.
newEnableLogonPrompt
- true
to
enable logon prompt for the report.isEnableLogonPrompt
,
getDatabaseLogonInfos
,
setDatabaseLogonInfos
public void setEnableParameterPrompt(boolean newEnableParameterPrompt)
Sets whether or not the parameter prompt is enabled for the report.
newEnableParameterPrompt
- true
to enable parameter prompt
for this report.public void setEnterpriseLogon(java.lang.Object newEnterpriseLogon)
Sets the information required to log on to Crystal Enterprise.
Note: This can be a Crystal Enterprise session or a Crystal Enterprise Token.
newEnterpriseLogon
- An Object that specifies the information required to
log on to Crystal Enterprise.getEnterpriseLogon
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
.
The viewer sets the value of this property after you set the report source for the report.
newParameterFields
- A com.crystaldecisions.sdk.occa.report.data.Fields
object that specifies the new parameter fields for the report.getParameterFields
,
isEnableParameterPrompt
,
setEnableParameterPrompt
public void setReportSource(java.lang.Object reportSource) throws ReportSDKExceptionBase
Sets the report instance that the viewer will render in HTML.
CrystalReportViewer viewer = new CrystalReportViewer();
IReportSourceFactory reportSourceFactory = (IReportSourceFactory) enterpriseSession.getService("PSReportFactory");
Object reportSource = reportSourceFactory.openReportSource(report,Locale.ENGLISH);
viewer.setOwnForm(true);
viewer.setOwnPage(true);
viewer.setName("Viewer1");
viewer.setReportSource(reportSource);
CrystalReportViewer viewer = new CrystalReportViewer();
IReportAppFactory reportAppFactory = (IReportAppFactory) enterpriseSession.getService("RASReportFactory");
ReportClientDocument clientDoc = reportAppFactory.openDocument(report,0,Locale.ENGLISH);
viewer.setOwnForm(true);
viewer.setOwnPage(true);
viewer.setName("Viewer2");
viewer.setReportSource(clientDoc.getReportSource());
reportSource
- An Object
representing the
report instance that the viewer will render in HTML.
ReportSDKExceptionBase
- This exception is thrown if the process is unsuccessful.getReportSource
public void setReportSourceClassFactoryName(java.lang.String newReportClassFactoryName)
Sets the report source class factory name.
newReportClassFactoryName
- A String
that specifies the report class factory name.public void setReuseParameterValuesOnRefresh(boolean newReuseParameterValuesOnRefresh)
Sets whether or not to re-prompt parameters on refresh.
newReuseParameterValuesOnRefresh
- true
to
re-prompt parameters on refresh.isReuseParameterValuesOnRefresh
public void setSelectionFormula(java.lang.String newSelectionFormula)
Sets the selection formula that will be used when the report is displayed.
Note:The default value is an empty string.
newSelectionFormula
- A String
that specifies the
selection formula to use when the report is displayed.getSelectionFormula
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
crystalreportviewers\css
on the machine where the RAS server is running. The cascading style sheet that
you use needs to contain the same classes as the default style sheet.
newStyleSheetFileName
- A String
that specifies the
file name for the style sheet (for example stylesheet.css).public void setURI(java.lang.String newURI)
ServerControl
Sets the Universal Resource Identifier for the report.
setURI
in class ServerControl
newURI
- A String
that specifies the Universal Resource
Identifier for the report.getURI
public void setViewTimeSelectionFormula(java.lang.String newSelectionFormula)
Reserved for future use.