Introduce DataBase,Asp.net,JavaScript,Xml,Html,Css,Sql,Php,ASP.NET Controls,AJAX,Tools,HTML,CSS,JavaScript,Open Source Project,WPF,.Net Framework,Linq
Top Recommended Hosting

Crystal report with Asp.net - newbie

by the3factory 5/10/2008 8:03:00 PM
Question:

Hi All

I'm newbie to crystal reports, i would like to run crystal report on the web form asp.net.

I have created a new crystal report file as reconrpt.rpt, i was to load the report on the webform.

The report make use of a stored procedure and with two parameter which i would like user pass that from webform and onsubmit button it pass that fields.

After few hours of research on internet i managed to write small to load the report and parameter. The report request for database login and then it goes blank once enter credential and click logon.

 

        Dim rpt As ReportDocument
        rpt = New ReportDocument
        CrystalReportViewer1.DataBind()
        rpt.Load(Server.MapPath("reconrpt.rpt"), CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault)
        rpt.SetDatabaseLogon("xuser", "xpassword", "localhost", "northwind")

        rpt.SetParameterValue("@sbatch", "1")
        rpt.SetParameterValue("@ebatch", "10")


        CrystalReportViewer1.ReportSource = rpt
        CrystalReportViewer1.ShowFirstPage()

 

Related posts

Sign up for PayPal and start accepting credit card payments instantly.


Powered by BlogEngine.NET 1.2.0.0