471,599 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,599 software developers and data experts.

Crystal Reports Query Engine Error

I have a crystal report that works fine when run through Crystal, which
I am triying to incorporate into a crystal report viewer. The report
takes 1 parameter, which is either 0 or 1. If the paremeter is 1 then a
filter is placed onto the data by the database server (Oracle PL/SQL
procedure in a package), parameter is 0 then it doesn't use the filter.
When I run this with the filter on the program works fine and the
report is displayed, but when I run it with the parameter of 0 it fails
with a query engine error. I originally used crystal 9 to write the
report, and then incorporated it into C# by adding it to the project
and doing a verify database, followed by a save. Below is the code that
I am using for the report, although I'm not sure how it could be wrong
since it works for one parameter??

private void ShowReport(String reportName , Int32 numParam)
CrystalDecisions.CrystalReports.Engine.ReportDocum ent reportDoc =
new CrystalDecisions.CrystalReports.Engine.ReportDocum ent() ;
CrystalDecisions.Shared.ParameterValues pv = new
CrystalDecisions.Shared.ParameterValues() ;
CrystalDecisions.Shared.ParameterDiscreteValue pdv = new
CrystalDecisions.Shared.ParameterDiscreteValue() ;
reportDoc.Load (reportName);

CrystalDecisions.CrystalReports.Engine.Table tblCurrent;
CrystalDecisions.Shared.TableLogOnInfo tliCurrent ;

for (int i = 0; i < reportDoc.Database.Tables.Count ; i++)
tblCurrent = reportDoc.Database.Tables [i];
tliCurrent = tblCurrent.LogOnInfo ;
tliCurrent.ConnectionInfo.ServerName = "cfsprod";
tliCurrent.ConnectionInfo.UserID = "infolease";
tliCurrent.ConnectionInfo.Password = "infolease";

//pdv.Value = numParam;
pdv.Value = 0;
pv.Add (pdv);
reportDoc.DataDefinition.ParameterFields[0].ApplyCurrentValues (pv);
crViewer.ReportSource = reportDoc;
crViewer.Update ();

Nov 17 '05 #1
0 1641

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Winston | last post: by
2 posts views Thread by airkart | last post: by
7 posts views Thread by p | last post: by
3 posts views Thread by Deasun | last post: by
3 posts views Thread by Agnes | last post: by
1 post views Thread by Hardy Wang | last post: by
2 posts views Thread by XIAOLAOHU | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.