Crystal Reports XI Official Guide
BusinessObjects Enterprise solves three broad problem classes for Crystal Reports users: security, scalability, and distribution. The distribution capability includes the abilities to send a report once or on a recurring schedule, in any supported output format (there are deltas between Crystal Reports and Web Intelligence), and to a variety of destinations:
By default, these destinations are turned off in the CMC. After turning them on, it is a good idea to go into the job server configuration console and set system-wide default parameters. For instance, you could set the default SMTP server name, domain, and port number. You will find a very powerful function scheduleReportToEmail(IInfoStore iStore, int reportID, HttpServletRequest request, HashMap paramMap, String frequency, int periodDays, String destinationFormat, String dependentEventName, String fromEmailAddress, String toEmailAddresses, String emailSubject, String emailMessage, String emailAttachmentName) in the BOEUtil on www.usingcrystal.com. If a schedule includes a dependent event, it will wait until the event is fired before running the job. Additionally, scheduling and formatting can be controlled with far more granularity than what you will find in this function. In the product documentation and support site, you can find code samples that more fully exercise discrete pieces of the scheduling API. Capturing the New Scheduled Job Identifier
It is sometimes important to capture the identifier of the job as soon as it is created. This could be for status reporting or complex scheduling front-ends with their own persistence. Immediately after a job is created, its parent InfoObject will contain a property called SI_NEW_JOB_ID that disappears after the InfoObject falls out of scope. For a nonrecurring scheduled InfoObject, its value corresponds to the SI_ID of the new instance that is to be created. For a recurring, scheduled InfoObject, it refers to the SI_ID of the recurrence parent object. Capturing Parameters
Whenever most reports are displayed or scheduled, parameters need to be captured and supplied. When a report is viewed, it can be convenient to build a parameter fields collection and supply it to the viewer. Setting the parameters on the IInfoObject is the only viable approach when a report is scheduled. The getCrystalReportParameterFields(IReport report, HttpServletRequest request, HashMap paramMap, boolean bFailSilently) function captures parameter values from the request scope as well as a map object, and updates the InfoObject itself and a Fields collection. It supports multiple, range, and discrete values of any data type. The dummy function setCrystalReportParameters invokes the other and simply throws away the Fields collection. As these are quite long and complicated code listings, you will them online at www.usingcrystal.com. For information on how to fill prompt values for scheduling a Web Intelligence document, consult customizing_webintelligence.pdf which installs in the help/language directory of BusinessObjects Enterprise (and should also be available for download from www.usingcrystal.com). |
Категории