Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report requested requires further information...

Status
Not open for further replies.

JCruz063

Programmer
Feb 21, 2003
716
US
Hi All,

I have a website (created using C# with Visual Studio .NET 2002) which, among other things, allows users to print reports. The available reports were created using Crystal Reports 10.

This is what I'm doing to display the reports:
Code:
[green]// C# code[/green]
Report1 rpt = new Report1();
rpt.RecordSelectionFormula = "table1.id=" [criteira];

reportViewer1.ReportSource = rpt;
- Report1 is the class created by Visual Studio and a given report (in this case Report1) is added to the project.

- reportViewer1 is the name of the CrystalReportsViewer object that is used to view the reports online.

- "table1.id=" [criteria] is the selection formula of the report. table1 is a table on the database and criteria is the id that correspond to the record of this table that the user is iterested in.

The problem with the code above is that the report being displayed by the viewer contains either no data, or the data that was saved with the report. I thought that this had to do with the fact that the option "Save Data with Report" is selected on for the report, thus when the report is saved, the data that I'm viewing is also saved with it. So I opened the report and deselected that option so that no data would be saved with the report. When I run the site, and I try to view the report, I get a page that says "The Report you requested requires further information" and it contains the following fields:

Server Name: MySQLODBC
Database Name: [blank]
UserName: Jose
Password: [blank]

After these fields, I the page contains LogOn button. I mean, what is going on here?

Oh and one more thing: Of all 4 fields, I can only edit the Password one, so I entered a password in and clicked LogOn but the page is simply refreshed.

The data the report is supposed to display is stored on a MySQL Server database.

Does anyone have any idea what the problem is?

Thanks!

JC

_________________________________________________
To get the best response to a question, read faq222-2244.
 
JCruz063,

Does the report run in Crystal 10 using the MySQLODBC connection? If so, then the next place to look at is the web.config file.

What's getting passed in the debugger.
 
Thanks ronbowen!

hmmm, the report is using the MySQLODBC connection, but i'm not sure I understand what you mean when you say "what's getting passed in the debugger?".

The stack trace for the error is this one:
[COMException (0x8004100f):
Error in File C:\DOCUME~1\JOSE\ASPNET\LOCALS~1\Temp\{00E4FADE-298E-4966-954D-A265D46A9137}.rpt:
Unable to connect: incorrect log on parameters.]
CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.GetLastPageNumber(RequestContext pRequestContext) +0
CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext)

[LogOnException:
Error in File C:\DOCUME~1\JOSE\ASPNET\LOCALS~1\Temp\{00E4FADE-298E-4966-954D-A265D46A9137}.rpt:
Unable to connect: incorrect log on parameters.]
CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext)
CrystalDecisions.CrystalReports.Engine.FormatEngine.GetLastPageNumber(ReportPageRequestContext reqContext)
CrystalDecisions.ReportSource.LocalReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext)
CrystalDecisions.Web.ReportAgent.get_LastPageNumber()
CrystalDecisions.Web..ShowLastPage()
CrystalDecisions.Web.CrystalReportViewer.ShowLastPage()
KMWebSite.Reports3.Page_Load(Object sender, EventArgs e) in c:\inetpub\ System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

Any clue what's going on?

Thanks!

JC


_________________________________________________
To get the best response to a question, read faq222-2244.
 
By the way... the error message on my last post is generated when I try to do the following:

reportViewer.ShowLastPage();

If I comment out this line, I get the LogOn screen that I mention in my first thread.

Thanks again!

JC

_________________________________________________
To get the best response to a question, read faq222-2244.
 
Hello,
Here's what I'm using in my web config file. Line 3 is the name of the ODBC connection used by Crystal. The ODBC connection must be a system dsn not user dsn. Replace the sqlbox_name, database_name, system_dsn with your info and insert into the web config.

1 <appSettings>
2 <add key="dsn" value="Data Source=SQLBOX_NAME;Initial catalog=DATABASE_NAME;"/>
3 <add key="server" value="SYSTEM_DSN"/>
4 <add key="db" value="DATABASE_NAME"/>
5 </appSettings>

Let me know if it work.
 
JCruz063,

Using the web config, ODBC (SQL Server)setting mentioned before in an existing C# web app, I currently have a aspx page as reportSelector which retrieves from the db a list of the existing reports. Based on the selection in this page I pass the info to a reportViewer aspx page that contains the CrystalReportViewer1.

Here's a sample of the cs script used in the reportSelector page.

**********************************

else if (rptselect.SelectedItem.Value == "SLA_Removal.rpt")
{
rpt = new SLA_Removal();
//test
//connection
String userid;
String password;

userid = (string)Session["userid"];
password = (string) Session["password"];
Session["server"] = ConfigurationSettings.AppSettings["server"];
string serverid = (string) Session["server"];
Session["db"] = ConfigurationSettings.AppSettings["db"];
string dbid = (string) Session["db"];

crConnectionInfo.ServerName = serverid; //physical server name
crConnectionInfo.DatabaseName = dbid; //need to assign from var
crConnectionInfo.UserID = userid;
crConnectionInfo.Password = password; //Get the table information from the report

crDatabase = rpt.Database;
crTables = crDatabase.Tables;

for (int i = 0; i < crTables.Count; i++)
{
crTable = crTables ;
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
crTable.Location = crTable.Location.Substring(crTable.Location.LastIndexOf(".") + 1);
}

Session["report_name"]= rptselect.SelectedItem.Value;
Session.Add ("displayRPT", rpt);
Response.Redirect("reportViewer.aspxrptName="+rptselect.SelectedItem.Value);
}

*****************************

Running through the debugger I can watch the values to see just where the failure takes place.

Hope this is helpful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top