public final class SaveReportUtilities extends Object
Modifier and Type | Method and Description |
---|---|
static File |
getCurrentFile(org.pentaho.reporting.libraries.resourceloader.ResourceKey definitionSource)
Extracts the current definition source (if any) from the current report
|
static File |
promptReportFilename(Component parent,
File defaultFile)
Prompts the user for the name of the report file which should be created
|
static boolean |
saveReport(ReportDesignerContext context,
ReportDocumentContext activeContext,
File target)
Performs the action of saving the report to the specified target file
|
static File |
validateFileExtension(File proposedFile,
Component parent)
Validates that the extension of the filename is prpt, and prompts the user if it is not.
|
public static File promptReportFilename(Component parent, File defaultFile)
parent
- the parent component of which the file chooser dialog will be a childdefaultFile
- the initially selected file.File
which the report should be saved into, or null
if the user does not want
to continue with the save operationpublic static File validateFileExtension(File proposedFile, Component parent)
proposedFile
- the target file to validateparent
- the parent component in case we need to display a dialognull
if the user decided to
cancel the operaionpublic static boolean saveReport(ReportDesignerContext context, ReportDocumentContext activeContext, File target)
context
- the report designer contextactiveContext
- the active render contexttarget
- the target file to which the report will be savedpublic static File getCurrentFile(org.pentaho.reporting.libraries.resourceloader.ResourceKey definitionSource)
definitionSource
- the resource key used to determine the current filenamenull
if there is none setCopyright © 2017 Hitachi Vantara. All rights reserved.