When we try to process a report from a .NET 6 application, there is an exception
"BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information."
Version used: Telerik R1 2023 SP1
On Telerik forums, there is a workaround to suppress this error, see below:
https://www.telerik.com/forums/aspnetcore-5-support
https://docs.telerik.com/reporting/knowledge-base/binaryformatter-exception-after-upgrade-to-net5
However, based on this post the BinaryFormatter is necessary for serialization and not having it will cause issues with image generation.
Please advise if there is a way to generate reports with images from a .NET 6 app without using EnableUnsafeBinaryFormatterSerialization.
While developing an endpoint (.NET 6 API) to export a PDF from a TRDX file ( no problems here ) I decided to publish to the test environment.
I keep getting this error :
2024-02-19T06:04:14.564687177Z at Telerik.Reporting.XmlSerialization.ReportXmlSerializer.Deserialize(Stream stream)
Is this error related to the Trial version or is there anything else?
ReportXmlSerializer().Serialize() throws unexpected System.ArgumentException:
'Invalid name character in 'MyData[]'. The '[' character, hexadecimal value 0x5B, cannot be included in a name.'
private void CreateReport() {
var report = new Telerik.Reporting.Report();
report.Name = "MyReport";
var detail = new Telerik.Reporting.DetailSection();
report.Items.Add(detail);
var textBox = new Telerik.Reporting.TextBox();
textBox.Value = "Hello World!";
detail.Items.Add(textBox);
var dataSource = new ObjectDataSource();
dataSource.Name = "MyData";
dataSource.DataSource = MyData.Sample;
report.DataSource = dataSource;
var reportPath = @"C:\develop\Temp\MyReport.trdp";
new ReportXmlSerializer().Serialize(reportPath, report);
}
public class MyData {
public static readonly MyData[] Sample = { new() { Text = "Foo", Number = 42 }, new() { Text = "Bar", Number = 21 } };
public string Text { get; set; }
public int Number { get; set; }
}
I'm using a HTML5 Web Forms Report Viewer
Here is my code:
var reportPackager = new ReportPackager();
var reportInstance = new Report();
using (var sourceStream = System.IO.File.OpenRead("PathToTRDPFile"))
{
reportInstance = (Report)reportPackager.UnpackageDocument(sourceStream);
}
var table3 = reportInstance.Items.Find("table3", true)[0] as Telerik.Reporting.Table;
table3.DataSource = CreateDataTable(); //A function that returns a datatable
var instanceReportSource = new InstanceReportSource { ReportDocument = reportInstance };
this.reportViewer1.ReportSource = instanceReportSource;
The error that I got:
Error CS0029 Cannot implicitly convert type 'Telerik.Reporting.InstanceReportSource' to 'Telerik.ReportViewer.Html5.WebForms.ReportSource'
Any idea on how to resolve this?
When I start the telerik report designer I get this error message:
Clicking ok opens the designer but in the main screen I see:
Telerik.Reporting.Xml.XmlSerializerExcepion: An error has occurred during xml serialization. The xml serializer cannot resolve type with name: Report
at Telerik.Reporting.Xml.ObjectXmlReader.ReadXmlElement(String name)
at Telerik.Reporting.Xml.ObjectXmlReader.Deserialize()
at Telerik.ReportDesigner.Packages.ReportDesigner.Serialization.ReportDesignerLoader.ReadReport()
at Telerik.ReportDesigner.Packages.ReportDesigner.Serialization.ReportDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
I don't think this error is related with a particular report because it shows every time I open the software.
I used the designer just few days ago and worked perfectly, what can I do? Thanks
Hi
I'm developing an WPF app that imports trdx file, serializes to a report object, set an ObjectDataSource and generate (using RenderReport method) to pptx file.
The trdx file contains a subreport with the same DataSource but different DataMember. The DataMember of the subreport get an input from the a report parameter (=Parameters.Param1.Value). The subreport parameter filled by the main report (Param1 =Fields.Id).
For example, for each order in the report, the subreport get its ID as parameter and returns all its order details.
In the generated report (pptx) I see all the reports data but the subreport data is empty. How should I set the DataSource, DataMember and Paramerters of the subreport correctly?
Thanks
Michal
Has anyone figured out how to provide an incremental build version of a report (report definition file) that can be read by the web app? I would like to display this version for tech support so they can see if the client has the latest version of that particular report.
I'm NOT talking about the Telerik version the report was created in. I'm talking about versioning the report itself