PDF report related question

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

ambrein2 wrote at 2014-01-16 04:37:

Hi,

I an new to OxyPlot and had a question regarding creating report. I checked some of the sample code and using that wrote my report generation code, the code creates PDF report file but there are two files created one is filename.pdf and other is filename_Plot1.pdf. Any idea why there are two pdf's created? I just want one report file. I am using following code to generate report from a PlotModel:

private void CreateReport(string fileName)
    {
        string ext = System.IO.Path.GetExtension(fileName);
        ext = ext.ToLower();

        var r = new Report();
        r.Title = "Waveform Report";

        var main = new ReportSection();          

        r.Add(main);

        main.AddPlot(this.Model, string.Empty, this.Plot.ActualWidth, this.Plot.ActualHeight);

        var reportStyle = new ReportStyle();

        using (var w = new PdfReportWriter(fileName))
        {
            w.WriteReport(r, reportStyle);
        }
    }
Any help is appreciated

everytimer wrote at 2014-01-16 23:02:

I think the additional .pdf is created when you add the model view to the report. I remember having a similar problem, in my case I had to do a lot of screens, and that generated a lot of files. I had to remove them, in the same method, near the end. Good luck

objo wrote at 2014-01-17 07:49:

I think this was a limitation in MigraDoc - images could only be added to a Paragraph by filename, not stream...