hi..

im using VS 2008 to build my app. i need to generate a report for a specific user. i have a SQl database which contains all my tables & Stored Proc's.. i have created a proc to retrieve data for tht specific user & used the same to bind to the reports. now when i click my generate report button, a prompt appears askin the value for the parameter (the usr id param used in stored proc)...i just wanted to know how i can pass this user id through code so that the prompt will not appear whenever i click the button?

Please let me know if any1 knows the solution..its bit urgent..

Thanks in advance..

i bet you dont need to include all this reference but i need it because i made like a report builder anyway. maybe this can help you. oh this is c# but you should be able to translate that to vb.net

using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportSource;
using CrystalDecisions.Web;

// now under your method

ReportDocument rpt = new ReportDocument();
rpt.Load(Server.MapPath("~/reports/reportname.rpt"));
rpt.SetDatabaseLogon("user", "pass");
rpt.SetParameterValue("ParamName", "ParamValue");
CrystalReportViewer1.ReportSource = rpt;

here is a converter tool

Good luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.