1
votes

I've inherited an ASP.NET web application which displays reports using Crystal Reports. I wanted to add some new fields to one .rpt, but noticed that my changes were not being displayed when the report was called.

Thinking that maybe my changes were to blame, I merely changed some label text on the original; yet my changes were still not reflected in the report displayed by the site.

I have tried:

  • Resetting IIS

    Moving/Renaming the .RPT file (and the site is still able to load the old report) This is mainly what leads me to think I'm confused here.

    Starting/Stopping the site

    Recycling the App Pool

    Deleting ASP.net temp files

    Setting Content Expiry on the rpt in IIS

I've only found one (unanswered) similar question here.

I don't know if maybe I'm just not understanding how the report is called, so here is the relevent portion of the code calling BookstoreReport.rpt.

            else if (print=="bookstorereport")
            {
                BookstoreReport Report = new BookstoreReport();
                foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in Report.Database.Tables) 
                {   //connect to local db
                    myLogin = myTable.LogOnInfo; 
                    myLogin.ConnectionInfo.DatabaseName="abc";
                    myLogin.ConnectionInfo.UserID="def";
                    myLogin.ConnectionInfo.Password="ghi";
                    myTable.ApplyLogOnInfo(myLogin); 
                }
                CrystalReportViewer1.ReportSource=Report;
            }
            else if (print=="bookstorereceipt") *etc*
3

3 Answers

1
votes

Is the site compiled? If you don't have an App_Code folder or if there is a dll in the bin folder with the name of the site, then the site is compiled and the changes you are making to the .rpt file aren't making it into the dll.

1
votes

I have also faced similar kind of problem. I changed the font in the crystal report and it was showing from the report. But when I tried to show the report from the browser it was not showing. Then I found that there was no tool to view pdf(like adobe/foxit reader etc. installed in that server pc.) I installed foxit reader and then it worked. The changes started to reflect when I view that report from browser.

0
votes

Just Make CrystalReportFile (.rpt) "Exclude from Project" and "Include In Project" .

If You are using Visual Studio - Just Right Click on the Crystal Report File(.rpt) and click "Exclude from Project" then Build and Again Right Click on the Crystal Report File and click "Include In Project"