Cannot create an object of type 'Telerik.Reporting.Report' from its
string representation 'MyNameSpace.MyClass, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' for the 'Report' property.
This error might occur if you are using website and you have the
report class in the website directly. This is due to the fact that when
using website, after rebuild the following would always be different
and it does not match with the originally assigned report:
App_Code.unch8s_n.
That is why we recommend following our best practices and have the report in a separate class library that
is referenced in the web app/site.
Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.
This exception might surface if you try to use objects which
do not implement ISerializable for Report Datasource. For example if
this is IList, you can try using List instead as we show in our
cars example.
You can also use the NeedDataSource event of the report and assign the datasource to the "processing report", thus avoiding any need for serialization/deserialization.
Another approach is to move on to DataSet or DataTable:
CopyC#
DataTable dt = new DataTable();
DataColumn col = new DataColumn("ColumnName", typeof(string));
dt.Columns.Add(col);
foreach (object Item in MyIList)
{
DataRow row = dt.NewRow();
row["ColumnName"] = Item;
dt.Rows.Add(row);
}
When deploying a project with Telerik Reporting on a server, you
get the following error: Could not load file or assembly
'Telerik.ReportViewer.WebForms, Version=x.x.x.x, Culture=neutral, PublicKeyToken=a9d7983dfcc261be'
or one of its dependencies. The system cannot find the file specified.
During the installation of Telerik Reporting on dev machine,
Telerik assemblies are added to GAC. When deploying a project
using Visual Studio's built-in functionality, the assemblies from the GAC
are not copied automatically, so you need to make sure the assemblies physically exist in the bin folder of your applicatio.
Full details are available in the Deploying Applications using Telerik Reporting section.
The expression contains undefined function call MyUserFunction()
There are three cases in which this error message occurs:
- The function is typed in manually without rebuilding the class library, thus it does not yet exist.
- Using the function with wrong number/type of parameters. The passed fields must match the function signature you've defined originally.
- The field specified in the function is null. Make sure such cases are handled in the user function.
My Web ReportViewer looks messed up - its styles and images are missing
- Check if runat="server" is present in your web page's head tag.
-
Check if the web report viewer's http handler is registered in the web.config file. If the app is deployed on IIS7 and setup to work in integrated mode, make sure preCondition attribute is present at the end of Telerik.ReportViewer handler:
CopyXML
<add
name="Telerik.ReportViewer.axd_*"
type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=x.x.x.x, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
path="Telerik.ReportViewer.axd" verb="*"
preCondition="integratedMode"
/>
- Check if the web report viewer's styles are registered on the page. This can be accomplished with http debugging proxy like Fiddler.
- If above steps are correct and problem persists, check for defined global styles on page that might mess up the viewer's styles. Remove any style declarations from page to make sure this is the culprit. If proves so, make sure global styles do not affect html elements directly, but are applied through the CssClass property.