Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

3.10 Windows Viewer vs. Web Viewer

Table 3-5. Comparing the property names of the two viewer controls.

Windows Viewer Web Viewer
DisplayGroupTree DisplayGroupTree
N/A DisplayPage
DisplayToolbar DisplayToolbar
Dock BestFitPage
EnableDrillDown EnableDrillDown
N/A DrilldownTarget
N/A HasDrillUpButton
ReportSource (DataBindings) | ReportSource
SelectionFormula SelectionFormula
ShowCloseButton N/A
ShowExportButton N/A
ShowGotoPageButton HasGotoPageButton
ShowGroupTreeButton N/A
ShowPageNavigationButtons HasPageNavigationButtons
ShowPrintButton N/A
ShowRefreshButton HasRefreshButton
ShowTextSearchButton HasSearchButton
ShowZoomButton HasZoomFactorList
N/A HyperlinkTarget
N/A PageToTreeRatio
N/A SeparatePages

Both controls have properties for hiding the different buttons, but they use different names for them. For example, the properties of the Windows viewer that hides the toolbar buttons are prefixed with “Show”, but the web viewer properties are prefixed with “Has”. The Dock property of the Windows viewer is similar to the BestFitPage property in the Web viewer.

There are certain properties that only belong to the Windows viewer and not the web viewer. For example, there are more buttons in the Windows toolbar than the web toolbar. As a result, the properties to hide these buttons aren’t in the web viewer. The web toolbar is missing the buttons for Close, Export, GroupTree, and Print. The Close button is missing because there are no tabs displayed for drilling down into the report detail. The Export and Print button are missing because the web viewer can’t perform either function. The GroupTree button is missing because the user isn’t allowed to directly turn this off. If you want to give the user this ability, add a button to the web page that toggles the value of the DisplayGroupTree property.

The web viewer also has properties that aren’t in the Windows viewer. The DisplayPage property hides the report preview when it is set to False. The web viewer also has properties that are HTML target values. When initially opening the report’s web page or opening a sub-report, you can set whether the new page opens in the same browser window or in a new window. Table 3-6 shows the possible values. These values can be assigned to the HyperlinkTarget and DrilldownTarget properties.

Table 3-6. Hyperlink target values.

Target String Value Description
_blank Opens the page in a new, unframed window.
_parent Opens the page in the immediate frameset parent.
_self Opens the page in the current frame.
_top Opens the page in a full, unframed window.

The Windows viewer uses tabs along the top of the form to display different pages of data as the user drills down into the report for more information. As mentioned earlier, there are no tabs in the web viewer control. When a user drills down into group details and sub-reports, a new web page is generated to display the information. Rather than using tabs to look at the different pages, the user has to click on the Back and Forward buttons. To make this a little easier to navigate, the web viewer control has a button for moving up to the parent level. This is called the DrillUp button. When report is at the top-most level, this button is disabled.

The PageToTreeRatio property sets how wide the Group Tree control is. It represents the relationship between how wide the viewer is compared to how wide the Group Tree is. The number entered for this property tells how many units the report page is compared to one unit of the Group Tree control. For example, if the number is 1, then the two areas have a 1:1 ratio and they are equal sizes. Thus, the page is split in half. If the number is 4, the two areas will have a 4:1 ratio, which makes the width of the Group Tree control use 20% of the total browser width. A good number to start with is 4 or 5.

The SeparatePages property determines whether the report uses different pages or not. If the property is set to True, each web page displays a single report page. If the property is False, the entire report is displayed on a single web page and the user has to scroll up and down.

Setting the SeparatePages property to True is the most efficient because Crystal Reports only has to process enough information to display one page at a time. Setting the SeparatePages property to False can cause a long delay to rendering the page. Crystal Reports has to process the entire report before it can display it.