locked
Pass parameter to crystal report through code RRS feed

  • Question

  • User-673128616 posted

    Hi,

    I want pass parameter to crystal report through my code

    How can i do that, Here is my code

      ReportClass rptH = new ReportClass();
                rptH.FileName = Server.MapPath("~\\Reports\\MerchandiserReport.rpt");
                rptH.Load();
                rptH.SetDataSource(GetHouseRentals());
                Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                return File(stream, "application/pdf");   



    Sunday, April 15, 2012 8:21 AM

Answers

  • User-781631963 posted

    You must use a function to call throght the report like :

    suppose Dal is a class : 

    dal objdal = new  dal();

    objdal.function(parameter1,parameter2);

    try this out and the bind the function to the report 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 18, 2012 4:18 AM

All replies