Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have added crystal report in asp.net web application and it works perfectly in localhost. but after publishing it in server machine it shows "The report you requested requires further information"

but after i put password also report is not displaying the report.
Please help me on this..
Posted
Updated 27-Jul-17 6:17am

HI,
I think you fill crystal report through wizard.
try to fill crystal report with c# code.
it does not given this prompt.
Like this:-
ReportDocument rpdoc = new ReportDocument();
        rpdoc.Load(Server.MapPath("~/reports/crystalreportname.rpt"));
        DataSet ds = {Your dataset/datasourse}
        rpdoc.SetDataSource(ds.Tables[0].DefaultView);
        CrystalReportViewer1.ReportSource = rpdoc;


i hope it worked.Remember marked answer as correct if right!!..
thanks
 
Share this answer
 
Comments
SukirtiShetty 8-Nov-14 0:41am    
Hi, It worked fine. thank you for the solution.
But now the problem is in crystal report graph image is not displaying in client machine after published in server.
Thanks
// Add this to Default.aspx.cs or your choice of .aspx.cs file where you have CrystalReportViewer added

protected void Page_Init()
{
    if (!IsPostBack)
    {
        var dt = RetrieveTable("SELECT * FROM MyTable");
        ReportDocument rpDoc = new ReportDocument();
        rpDoc.Load("CrystalReport1.rpt");                
        rpDoc.SetDataSource(dt);
        Session["myReport"] = rpDoc;
        CrystalReportViewer1.ReportSource = rpDoc;
        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.RefreshReport();
    }
    else
    {
        ReportDocument doc = (ReportDocument)Session["myReport"];
        CrystalReportViewer1.ReportSource = doc;
    } // End if
}// End Page_Init()
 
Share this answer
 
v2
Comments
CHill60 28-Jul-17 11:36am    
I doubt the OP has waited all this time, the question is over 2.5 years old!
ShahzadMian 1-Aug-17 13:36pm    
Just for new C# and crystal reports bees. :)
Member 14852970 4-Jun-20 2:50am    
hiii thanks, that code worked for mee :) have a nice day!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900