Click here to Skip to main content
15,505,126 members
Home / Discussions / C#
   

C#

 
GeneralRe: Question regarding C# Pin
Pete O'Hanlon17-Mar-15 22:34
mvaPete O'Hanlon17-Mar-15 22:34 
GeneralMessage Closed Pin
17-Mar-15 23:24
Abdulnazark17-Mar-15 23:24 
GeneralRe: Question regarding C# Pin
Pete O'Hanlon18-Mar-15 1:03
mvaPete O'Hanlon18-Mar-15 1:03 
GeneralRe: Question regarding C# Pin
Abdulnazark18-Mar-15 3:16
Abdulnazark18-Mar-15 3:16 
GeneralRe: Question regarding C# Pin
Richard Deeming18-Mar-15 4:00
mveRichard Deeming18-Mar-15 4:00 
GeneralRe: Question regarding C# Pin
Abdulnazark18-Mar-15 4:25
Abdulnazark18-Mar-15 4:25 
GeneralRe: Question regarding C# Pin
Abdulnazark18-Mar-15 0:04
Abdulnazark18-Mar-15 0:04 
QuestionRLDC Report error : An error occurred during report processing. Pin
jasonalien17-Mar-15 1:13
jasonalien17-Mar-15 1:13 
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
C#
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<Person> cm = new List<Person>();

            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 =

            "<DeviceInfo>" +
            "  <OutputFormat>" + id + "</OutputFormat>" +
            "  <PageWidth>8.5in</PageWidth>" +
            "  <PageHeight>11in</PageHeight>" +
            "  <MarginTop>0.5in</MarginTop>" +
            "  <MarginLeft>1in</MarginLeft>" +
            "  <MarginRight>1in</MarginRight>" +
            "  <MarginBottom>0.5in</MarginBottom>" +
            "</DeviceInfo>";

            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 :
C#
renderedBytes = lr.Render(
    reportType,
    deviceInfo,
    out mimeType,
    out encoding,
    out fileNameExtension,
    out streams,
    out warnings);

Can you tell me how I can get rid of the error? Thanks.
QuestionC# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
Member 1153148717-Mar-15 0:04
Member 1153148717-Mar-15 0:04 
AnswerRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
OriginalGriff17-Mar-15 1:01
mveOriginalGriff17-Mar-15 1:01 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
Member 1153148717-Mar-15 1:24
Member 1153148717-Mar-15 1:24 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
Freak3017-Mar-15 3:03
Freak3017-Mar-15 3:03 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
OriginalGriff17-Mar-15 3:36
mveOriginalGriff17-Mar-15 3:36 
AnswerRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
BillWoodruff17-Mar-15 5:56
mveBillWoodruff17-Mar-15 5:56 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
Member 1153148717-Mar-15 6:24
Member 1153148717-Mar-15 6:24 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
Member 1153148717-Mar-15 6:38
Member 1153148717-Mar-15 6:38 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
BillWoodruff17-Mar-15 8:46
mveBillWoodruff17-Mar-15 8:46 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
BillWoodruff17-Mar-15 23:11
mveBillWoodruff17-Mar-15 23:11 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
Member 1153148718-Mar-15 0:49
Member 1153148718-Mar-15 0:49 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
BillWoodruff18-Mar-15 18:01
mveBillWoodruff18-Mar-15 18:01 
Questionhow to send any file from server to client in c# Pin
Member 1149066016-Mar-15 22:32
Member 1149066016-Mar-15 22:32 
AnswerRe: how to send any file from server to client in c# Pin
Eddy Vluggen17-Mar-15 0:27
professionalEddy Vluggen17-Mar-15 0:27 
AnswerRe: how to send any file from server to client in c# Pin
F-ES Sitecore17-Mar-15 0:40
professionalF-ES Sitecore17-Mar-15 0:40 
QuestionProblem parsing rss feed Pin
Member 1022623016-Mar-15 20:25
Member 1022623016-Mar-15 20:25 
AnswerRe: Problem parsing rss feed Pin
Pete O'Hanlon16-Mar-15 23:19
mvaPete O'Hanlon16-Mar-15 23:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.