LocalReport not rendering RRS feed

  • Question

  • hi,

    im facing a problem with LocalReport render in Excel or PDF format

    the rdlc has been generated with VS210 and is very simple, just a select * from a table with 2 lines

    i run into an error : Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: DataSet1

    where dataset1 is the name of the dataset in my rdlc file.

    My code is :

    Microsoft.Reporting.WebForms.LocalReport lr = new Microsoft.Reporting.WebForms.LocalReport();

    string deviceInfo =

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

    lr.ReportPath = Server.MapPath("report1.rdlc");
    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["fex"].ConnectionString);

    SqlDataAdapter adap = new SqlDataAdapter("select * from fex_user", conn);

    DataSet ds = new DataSet();

    lr.DataSources.Add(new ReportDataSource("FEXDataSet", ds.Tables[0]));
    Warning[] warnings;
    string mimeType;
    string encoding;
    string[] streamids;
    string fne;

    byte[] bytes = lr.Render("PDF", deviceInfo, out mimeType,out encoding, out fne, out streamids, out warnings); 

    I even removed all the controls from my rdlc file and the result is the same.

    Thx for your help 

    Thursday, January 27, 2011 10:57 AM