Going to Hidden Sheet by Hyperlink

Question

How to set up going to hidden sheets by hyperlink?

Application Area

A hyperlink can be set up to go from regular report sheets to a hidden sheet.

Source Data

Create a regular report containing:

Solution

To set up hyperlink execute the operations:

  1. Create a unit with the HIDING_SHEET identifier to display a hidden sheet. Add a link to the Report system assembly:

Sub UserProc;
Var Rep: IPrxReport;
   Sheet: IPrxSheet;
    Name: String;
Begin
    Rep := PrxReport.ActiveReport;
    Sheet := Rep.Sheets.FindByName("Sheet2");
    Sheet.Visible := True;
    Rep.ActiveSheet := Sheet;
End Sub UserProc;

  1. Add a created unit to report.

  2. Add text with hyperlink to execute procedure or function. Select the unit previously connected to the report.

  3. Create an event handler in the Fore unit.

  4. Set hiding of the displayed sheet for the OnBeforeActivateSheet event:

Public Sub OnBeforeActivateSheet(OldSheet: IPrxSheet; NewSheet: IPrxSheet; Var Cancel: Boolean);
Var Rep: IPrxReport;
    Sheet: IPrxSheet;
   Name: String;
Begin
    Rep := PrxReport.ActiveReport;
    If Rep.ActiveSheet.Name = "Sheet2" Then
       Sheet := Rep.Sheets.FindByName("Sheet2");
       Sheet.Visible := False;
    End If;
End Sub OnBeforeActivateSheet;

The regular report will allow for going to the hidden sheet by hyperlink without the ability to display the sheet when sheets are changed.

NOTE. In the web application, hyperlink settings are passed from the desktop application.

See also:

Questions and Answers | Hiding Sheet