views:

200

answers:

2

I have a serious issue with crystal reports.

when run in my development environment or debugged on my local machine it works fine.

but when the application is published to a windows server 2003 it has the dreaded "The report you requested requires further information" Message

I have had no luck trying to get rid of this message

Anybody know what I can try?

DC

Here is a bunch more info. I use a placeholder in the aspx page and then set the user/password and database in the codebehind I could not get it to work with a dataset and found that I had to assign odbc connection in the cr designer. and then in the code behind change the above details as required.

This is done because the same report can get the data from 3 different databases (live development and training)

 protected override void Page_Load(object sender, EventArgs e)
 {
    base.Page_Load(sender, e);

    CrystalReportSource1.ReportDocument.Load(Server.MapPath(@"~/Reports/Report5asp.rpt"));
    CrystalReportViewer1.ReportSource = ConfigureCrystalReports(CrystalReportSource1.ReportDocument,CrystalReportViewer1);

    // parameters
    CrystalReportViewer1.ParameterFieldInfo.Clear();
    AddParameter("DIid", _app.Data["DIid"], CrystalReportViewer1.ParameterFieldInfo);
    AddParameter("EEid", _app.Data["EEid"], CrystalReportViewer1.ParameterFieldInfo);
    AddParameter("CTid", _app.Data["CTid"], CrystalReportViewer1.ParameterFieldInfo);

 }


 public ReportDocument ConfigureCrystalReports(ReportDocument report, CrystalReportViewer viewer)
 {
    String _connectionString = _app.ConnectionString();
    String dsn = _app.DSN();
    SqlConnectionStringBuilder SConn = new SqlConnectionStringBuilder(_connectionString);


        TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
        TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
        ConnectionInfo crConnectionInfo = new ConnectionInfo();
        crConnectionInfo.ServerName = dsn;// SConn.DataSource;
        crConnectionInfo.DatabaseName = SConn.InitialCatalog;
        crConnectionInfo.UserID = SConn.UserID;
        crConnectionInfo.Password = SConn.Password;
        crConnectionInfo.Type = ConnectionInfoType.SQL;
        crConnectionInfo.IntegratedSecurity = false;

        foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in report.Database.Tables)
        {
            crtableLogoninfo = CrTable.LogOnInfo;
            crtableLogoninfo.ConnectionInfo = crConnectionInfo;
            CrTable.ApplyLogOnInfo(crtableLogoninfo);
        }

         return report;

  }

As stated this works fine on my XP machine used for development when deployed on winserver 2003 I get the error

DC

Some interesting additional information

I moved the development to my home machine so I could work on the problem this weekend.

So now I am developing debugging and testing on the same machine!

In VS2008 I can edit and preview the reports with no problems If I fire up the debugger I can view the reports in the browser with no problems

But if I publish the website to another folder on the same machine and fire up IIS and try to browse to a report I get the aforementioned error. All else works as expected.

IIS runs under different permissions than VS2008 so perhaps its something to do with that, but I have tried lots of different permissions and cannot get it to run.

DC

+1  A: 

Hi,

Is your crystal report viewer embeded on the aspx page and not in code behind? if so try to move the code on the code behind.

Also if you are binding dataset as your datasource try to bind the datatable inside the dataset instead.

Jojo Sardez
I have included some source code. hopefully that will lead to a solution. I have never used CR before and probably never will again
DeveloperChris
I have added some pertinent information. most importantly it fails when viewed using IIS on the development machine. but works in VS2008
DeveloperChris
Hi, Have you copied the rpt files also (or the whole "Report" folder) to the deployment location? The rpt files are needed for you to run the reports during runtime.
Jojo Sardez
A: 

The solution I found that worked was not to use ODBC at all. Instead I populated the the reports from a dataset. If I had known how easy it was to do that I would have done it from the beginning.

DeveloperChris