The ASP.NET viewer control has some interesting differences between it and the Windows viewer. It doesn’t have any tabs that run along the top. This is because it always displays new information on a new page. For example, if you drill-down into a new group in Windows, it creates a new tab to display the group information in. But in ASP.NET it simply opens a new web page that only shows the group information. The ASP.NET viewer replaces Windows tabs with a drop-down box in the center of the toolbar. This drop-down box is called a ViewList. Click on it to navigate back to the Main Report area.
Printing has been improved with Visual Studio .NET 2005. In previous versions, you had to use the browser’s print button to print the report. This gave you a very poor quality report and everyone complained about it. With the latest releases, there is now a print button on the toolbar and it opens a custom print dialog box (shown in Figure 3-7) and sends a formatted report to your printer.
Figure 3-7. ASP.NET custom print dialog box..
The last thing you might notice is the “Business Objects” icon at the top right corner of the toolbar. Although this is totally harmless, many people don’t like it appearing on their reports. You can get rid of this logo by setting the propertyHasCrystalLogo to false.
The properties of the Web viewer control are similar to that of the Windows viewer control. It has properties for changing the look of the viewer by hiding the toolbar, hiding the toolbar buttons, and hiding the Group Tree window.
Although the Windows and Web viewer controls have properties that perform the same functionality, they often have different names. There are also certain properties that are unique to each control. Table 3-3 compares the common properties of each control so you can see the similarities and differences.
Table 3-3. Comparing the property names of the two viewer controls.
Windows Viewer | Web Viewer |
---|---|
DisplayGroupTree | DisplayGroupTree |
N/A | DisplayPage |
DisplayToolbar | DisplayToolba |
Dock | BestFitPag |
EnableDrillDown | EnableDrillDown |
N/A | DrilldownTarget |
N/A | HasCrystalLogo |
N/A | HasDrillUpButton |
N/A | HasViewList |
ReportSource | (DataBindings) | ReportSourc |
SelectionFormula | SelectionFormul |
ShowCloseButto | N/A |
ShowExportButto | HasExportButton |
ShowGotoPageButton | HasGotoPageButton |
ShowGroupTreeButton | HasToggleGroupTreeButton |
ShowPageNavigationButtons | HasPageNavigationButtons |
ShowPrintButton | HasPrintButton |
ShowRefreshButton | HasRefreshButton |
ShowTextSearchButton | HasSearchButton |
ShowZoomButton | HasZoomFactorList |
N/A | HyperlinkTarge |
N/A | PageToTreeRati |
N/A | SeparatePage |
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”. TheDock property of the Windows viewer is similar to the BestFitPage property in the Web viewer.
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-4 shows the possible values. These values can be assigned to the HyperlinkTarget property.
Table 3-4. HyperlinkTarget values.
Target String Value | Description |
---|---|
_blan | Opens the page in a new, unframed window. |
_paren | Opens the page in the immediate frameset parent. |
_sel | Opens the page in the current frame. |
_to | 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 can click on the drop-down box or use the Back and Forward buttons. If you have multiple groups on a report, the user can click on the DrillUp button to immediately navigate to the main report. Both navigation options can be turned on or off. The property HasViewList toggles the drop-down box which displays the different groups the user has visited. The property HasDrillUpButton toggles the visibility of the DrillUp button. When the report is at the top-most level, this button is automatically 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.
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.