[]
Represents settings related to the document preview functionality, allowing configuration of the preview button visibility and integration of a viewer component.
public class PreviewSettings
private PreviewSettings _preview;
public Index()
{
_preview = new PreviewSettings()
{
CanPreview = true,
OpenViewer = OpenViewer
};
}
private async void OpenViewer(ViewerSettings settings)
{
if (_viewer != null)
{
await _viewer.OpenReport(settings.DocumentInfo.Id);
return;
}
_viewer = new ReportViewer();
var initOptions = new InitializationOptions();
initOptions.ReportID = settings.DocumentInfo.Id;
await _viewer.Render(JSRuntime, settings.Element, initOptions);
}
Name | Description |
---|---|
PreviewSettings() |
Name | Description |
---|---|
CanPreview | Gets or sets a value indicating whether the Preview button should be shown. |
OpenViewer | Gets or sets a function to plug in a viewer component, which will be called when the preview is opened. |