How to set up going to hidden sheets by hyperlink?
A hyperlink can be set up to go from regular report sheets to a hidden sheet.
Create a regular report containing:
A sheet named Sheet1.
A hidden sheet named Sheet2.
To set up hyperlink execute the operations:
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;
Add the created unit to the report.
Add text with hyperlink to execute procedure or function. Select the unit previously connected to the report.
Create an event handler in the Fore unit.
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: