Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. RLDC Report error : An error occurred during report processing.

RLDC Report error : An error occurred during report processing.

Scheduled Pinned Locked Moved C#
databasehtmlasp-netcomsysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jasonalien
    wrote on last edited by
    #1

    I'm trying to generate a simple report based on this article : www.dotnetawesome.blogspot.com/2013/09/microsoft-report-in-mvc-4.html[^] Here is my controller

    public ActionResult Report(string id)
    {
    LocalReport lr = new LocalReport();
    string path = Path.Combine(Server.MapPath("~/Report"), "Person.rdlc");
    if (System.IO.File.Exists(path))
    {
    lr.ReportPath = path;
    }
    else
    {
    return View("Index");
    }
    List cm = new List();

            var viewModel = new PersonIndexData();
    
            viewModel.People= db.Person
            .Include(k => k.Groups)
            .OrderBy(k => k.Name);
    
            cm = viewModel.People.ToList();
    
            ReportDataSource rd = new ReportDataSource("PersonDataSet", cm);
            lr.DataSources.Add(rd);
            string reportType = id;
            string mimeType;
            string encoding;
            string fileNameExtension;
    
    
            string deviceInfo =
    
            "" +
            "  " + id + "" +
            "  8.5in" +
            "  11in" +
            "  0.5in" +
            "  1in" +
            "  1in" +
            "  0.5in" +
            "";
    
            Warning\[\] warnings;
            string\[\] streams;
            byte\[\] renderedBytes;
    
            renderedBytes = lr.Render(
                reportType,
                deviceInfo,
                out mimeType,
                out encoding,
                out fileNameExtension,
                out streams,
                out warnings);
    
    
            return File(renderedBytes, mimeType);
        }
    

    When I type (mysite/person/report/pdf), I get this exception : An error occurred during report processing. At this part :

        renderedBytes = lr.Render(
            reportType,
            deviceInfo,
            out mimeType,
            out encoding,
            out fileNameExtension,
            out streams,
            out wa
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups