Possble to have embedded resource as a report source?

1 Answer 46 Views
General Discussions Programming
Neil N
Top achievements
Rank 1
Veteran
Iron
Neil N asked on 11 Jun 2021, 04:51 AM | edited on 11 Jun 2021, 04:51 AM

Goal: I want to create a .NET Standard class library with trdx reports so that I can deploy it with projects on various platforms.

I added a trdx file to the new library and made it an embedded resource but could not access it. I then stepped back, simplified, and added the report to a .NET Framework 4.7 Windows Forms app, again as an embedded resource.

        public Form1()
        {
            InitializeComponent();

            var a = System.Reflection.Assembly
                .GetExecutingAssembly()
                .GetManifestResourceStream("Reports.Report1.trdx");

            TypeReportSource reportSource = new TypeReportSource();
            reportSource.TypeName = "Reports.Report1.trdx";

            var reportProcessor = new ReportProcessor();
            RenderingResult result = reportProcessor.RenderReport("PDF", reportSource, null);
        }

a is populated (as a check) but rendering results in: {"Invalid report type"}

1 Answer, 1 is accepted

Sort by
0
Neil N
Top achievements
Rank 1
Veteran
Iron
answered on 11 Jun 2021, 01:20 PM
Figured it out. Use XmlReportSource.
Tags
General Discussions Programming
Asked by
Neil N
Top achievements
Rank 1
Veteran
Iron
Answers by
Neil N
Top achievements
Rank 1
Veteran
Iron
Share this question
or