'Declaration
Public Event OnListLabelRequest As EventHandler(Of ListLabelRequestEventArgs)
public event EventHandler<ListLabelRequestEventArgs> OnListLabelRequest
public: event EventHandler<ListLabelRequestEventArgs^>^ OnListLabelRequest
Event Data
The event handler receives an argument of type ListLabelRequestEventArgs containing data related to this event. The following ListLabelRequestEventArgs properties provide information specific to this event.
Property | Description |
---|---|
CustomData | A custom object that was passed by the user when creating the viewer control. |
ExportPath | Sets the directory for temporary files that are generated while the report is created. |
Initializing | If true, the Html5Preview will use the LL instance created in this callback for its own settings (language etc.). |
Logger | Returns the logger of the Html5Viewer instance as defined in Html5ViewerOptions.SetLogger. It is recommended to pass this logger to the ListLabel constructor in your event handler. |
NewInstance | This property must be assigned to the created List & Label instance. |
ReportName | Contains the report name that was specified in the ReportName property (Html5ViewerControl) or the report name argument of @Html.Html5Viewer(). |
Example
string _reportsPath; protected void Application_Start(Object sender, EventArgs e) { Html5ViewerConfig.RegisterRoutes(RouteTable.Routes); Html5ViewerConfig.OnListLabelRequest += Services_OnListLabelRequest; _reportsPath = Server.MapPath("~/reports/"); } void Services_OnListLabelRequest(object sender, ListLabelRequestEventArgs e) { ListLabel ll = new ListLabel(); //Set datasource ll.DataSource = DataAccess.CreateProviderCollection(); ll.AutoProjectFile = _reportsPath + e.ReportName; //Set temp directory e.ExportPath = Path.GetTempPath(); e.NewInstance = ll; }
Requirements
Platforms: Windows 8.1, Windows 10 (Version 20H2 - 22H2), Windows 11 (21H2 - 22H2), Windows Server 2012 - 2022
See Also