You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can change ReportViewer control settings in OnLoad method of your form and/or when you populate the datasource and parameters. As for error messages - those are (or at least should be) exactly the same as in original ReportViewer for compatibility reasons.
Need to change the default export options like:
protected void repViewer_PreRender(object sender, EventArgs e)
{
try
{
FieldInfo info;
foreach (RenderingExtension extension in repViewer.LocalReport.ListRenderingExtensions())
{
if ((fldExportPDF.Value == "0" && extension.Name.Trim().ToUpper() == "PDF")
|| (fldExportXLS.Value == "0" && extension.Name.Trim().ToUpper().StartsWith("EXCEL"))
|| (fldExportDoc.Value == "0" && extension.Name.Trim().ToUpper().StartsWith("WORD")))
{
info = extension.GetType().GetField("m_isVisible", BindingFlags.Instance | BindingFlags.NonPublic);
info.SetValue(extension, false);
}
}
}
catch (Exception err)
{ ShowError(err.Message); }
}
And i have an error for missing parameters, but the regular exception does not show the error detail
protected void repViewer_ReportError(object sender, ReportErrorEventArgs e)
{
string strMensaje = e.Exception.Message;
if (e.Exception.InnerException != null)
{ strMensaje += ". " + e.Exception.InnerException.Message; }
ShowError(strMensaje);
}
The text was updated successfully, but these errors were encountered: