com.businessobjects.crystalreports.designer.sdk.wizard
Class ReportWizard

java.lang.Object
  extended by Wizard
      extended by com.businessobjects.crystalreports.designer.sdk.wizard.ReportWizard

public class ReportWizard
extends Wizard

This class defines a wizard that creates Crystal reports. You can extend this class to implement a wizard that produces customized reports. To add custom pages to the wizard, override the addCustomPages method. To customize the report that is created by the wizard, override the doFinish method.


Constructor Summary
ReportWizard()
          Constructs a ReportWizard object and initializes it with a blank report.
 
Method Summary
 void addCustomPages()
          Adds custom pages to the report wizard.
 void addPages()
          Adds default pages to the report wizard and calls addCustomPages to add custom pages to the wizard.
 void doFinish()
           Performs report modification when the report wizard finishes.
 IWizardPage getMainWizardPage()
          Returns the main wizard page in the Eclipse IDE.
 ReportClientDocument getReport()
          Returns the report that is being created by the wizard.
 IStructuredSelection getSelection()
          Returns the workbench selection.
 IWorkbench getWorkbench()
          Returns the workbench that is running the wizard.
 void init(IWorkbench aWorkbench, IStructuredSelection currentSelection)
          Initializes the report wizard.
 boolean performFinish()
          Finishes the wizard and creates the report.
 void setReport(ReportClientDocument report)
          Sets a report into the wizard.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportWizard

public ReportWizard()
             throws ReportSDKException
Constructs a ReportWizard object and initializes it with a blank report. Note: To prevent the wizard dialog from being displayed, throw an exception from this constructor.

Throws:
ReportSDKException
Method Detail

getWorkbench

public IWorkbench getWorkbench()
Returns the workbench that is running the wizard.

Returns:
the workbench

getSelection

public IStructuredSelection getSelection()
Returns the workbench selection.

Returns:
the workbench selection

setReport

public void setReport(ReportClientDocument report)
Sets a report into the wizard. The wizard is initialized with a blank report that you can modify with the SDK. This method replaces the blank report with another report, typically a report template that has been loaded from disk. You can then modify the report template instead of the blank report.

Parameters:
report - the new report

init

public void init(IWorkbench aWorkbench,
                 IStructuredSelection currentSelection)
Initializes the report wizard.

Parameters:
aWorkbench - the workbench that is running the wizard
currentSelection - the current selection

addPages

public final void addPages()
Adds default pages to the report wizard and calls addCustomPages to add custom pages to the wizard.


addCustomPages

public void addCustomPages()
Adds custom pages to the report wizard. Implement this method to create custom pages and then add them to the wizard by calling the org.eclipse.jface.Wizard.addPage method.


performFinish

public final boolean performFinish()
Finishes the wizard and creates the report. This method calls the doFinish method to perform the final report modification tasks.

Returns:
true if the report was successfully created, false otherwise

doFinish

public void doFinish()

Performs report modification when the report wizard finishes. Typically, this method modifies the a blank report by using the SDK. To modify a report template, use thesetReport method to replace the blank report with a report template.

Report wizards that contain customized pages can modify the report directly from the pages.

Note: this method is not intended to be called directly by the client.


getReport

public final ReportClientDocument getReport()
Returns the report that is being created by the wizard.

Returns:
the ReportClientDocument object that this wizard is creating

getMainWizardPage

public final IWizardPage getMainWizardPage()
Returns the main wizard page in the Eclipse IDE. This can be used to hook up a help context for wizards.

For example:

 PlatformUI.getWorkbench ().getHelpSystem ().setHelp (getMainWizardPage ().getControl (), HELP_CONTEXT_ID);
 

Returns:
the main wizard page, or null if none exists.