You must Sign In to post a response.
  • Category: LINQ

    Generate rdlc report using linq data source

    hi, may i know how to generate rdlc report based on year and month using linq datasource. have any sample?
  • #758992
    Hi Sim

    Refer below links for generating rdlc with linq.


    DNS Member.
    "Hope for the best.. prepare for the worst.."

    Sridhar Thota.
    Editor: DNS Forum.

  • #758993
    Hello Sim,

    Refer the below links to generate RDLC reports using Linq as data source:

    Hope this will help you.

    Nirav Lalan
    DNS Gold Member
    "If you can dream it, you can do it."

  • #759014
    You need to first design rdlc report, then as data source you can use either SQL or LINQ
    first you need to Create a blank report and use Report Dataset Designer to add items to the dataset. and you need to Use Visual Studio Report Designer to design the layout of the report.
    here is sample code for LINQ query
    private void fnBuildDataSource(string v_strCountry)
    NorthwindDataContext ctx = new NorthwindDataContext();
    var datasource = from c in ctx.sp_LinqTest(v_strCountry)
    orderby c.CustomerID
    select c;

    ReportParameter rpCountry = new ReportParameter("p_Country", v_strCountry);
    this.rvNorthwind.LocalReport.SetParameters(new ReportParameter[] { rpCountry });
    this.rvNorthwind.LocalReport.DataSources.Add(new ReportDataSource("sp_LinqTestResult", datasource.ToList()));

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #759146
    hi, i mean generate report based on year and month that user key in inside the text box using linq to sql datasource, i currently is using, C# to develop the website.

  • Sign In to post your comments