Troubleshooting


Report Viewing Performance Is Slow

What efficiencies can I add to increase the performance of my application?

Caching a report source in the session variable allows it to be used multiple times efficiently. When a report source is not cached, the process of creating a new report source multiple times becomes fairly expensive. Furthermore, caching a report source allows reports with or without saved data to be refreshed.

Listing 33.11 shows how to store and retrieve the report source object from session state.

Listing 33.11. Caching a Report Source Object

//To store the report source in a session variable request.getSession().settAttribute("RptSrc",reportSource); //To retrieve the report source from a session variable rptSrc = request.getSession().getAttribute("RptSrc");

The Viewer Needs to Work in a Page Without a Form Element

How can I control how the viewer interacts with a surrounding form?

If your web page contains only the viewer and nothing else, several things can be done that can simplify the report viewing implementation. The viewer is capable of generating complete HTML pages and can set the appropriate page properties depending on the viewing context. Setting the setOwnPage property to true provides several benefits. Allowing the viewer to handle the surrounding HTML content reduces the amount of code you need to add to your web page and allows the viewer to automatically determine certain settings. It correctly sets the content-type and charset information for the page. This ensures that pages containing international characters will be displayed correctly. When setOwnPage is set to true, you must use the processHttpRequest method to display the report instead of getHtmlContent. The processHttpRequest method must be used because using getHtmlContent has the same effect as setting setOwnPage to false, negating any of the benefits gained from setting setOwnPage to true. If your web page does not contain any controls that require post back, you should set the setOwnForm method to true. Doing so allows the viewer to handle the view state information automatically. The view state is used to perform client-side caching of information about the current state of the report. If you have other controls on the page, you must set setOwnForm to false and handle the view state information manually.

The Character Set Is Displaying Incorrectly

How can I indicate which unicode character to set should be used for the report viewing session?

To send characters from a web page to a web browser, you must use the correct encoding. Always specify the correct content-type and character set for all your web pages. If your web page returns content to a standard HTML browser, the following lines will ensure that the correct character set is defined. The contentType and charset directives let the browser know how the returned HTML page is encoded. UTF-8 is the recommended standard character set if it is available for your target client browser. For more information, consult the Release Notes or the vendor for your target client browser.




Crystal Reports XI(c) Official Guide
Crystal Reports XI Official Guide
ISBN: 0672329174
EAN: 2147483647
Year: N/A
Pages: 365

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net