Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
Thread Tools Display Modes
  #1 (permalink)  
Old July 10th, 2003, 09:27 PM
Registered User
Join Date: Jul 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Refresh causing Query Engine Error

Dear folks,

I was trying to write a .Net web application (using C#) that loads a Crystal
Report on server side, export the report in PDF format as a file in the web
server, and then serves up the file for clients to download. My code was
working so far so good until I added ONE line.

Here's my working code so far:

---------------- (code start) -------------------------
System.Diagnostics.EventLog EventLog1 = new System.Diagnostics.EventLog();

      DiskFileDestinationOptions dFileDOpts = new DiskFileDestinationOptions();

      //string sSrcPath = this.MapPath("./BigReportTest.rpt");
      string sSrcPath = this.MapPath("./2003_07_08_DLOTable.rpt");
      //string sSrcPath = this.MapPath("./Sample_Report.rpt");

      // Generate unique name for output file
      StringBuilder sFileName = new StringBuilder(DateTime.Now.ToShortDateString() + "_" +
          DateTime.Now.ToShortTimeString() + "_" +

      sFileName.Replace(" ", "_");
      sFileName.Replace(":", "_");
      sFileName.Replace("/", "_");

      string sResultFileName = sFileName.ToString();

      string sDesPath = this.MapPath("./CRResult/" + sResultFileName + "_BigFile.pdf");
      ReportDocument oRD = new ReportDocument();

      dFileDOpts.DiskFileName = sDesPath;

      ExportOptions eOpts = new ExportOptions();
      eOpts = oRD.ExportOptions;
      eOpts.ExportDestinationType = ExportDestinationType.DiskFile;
      eOpts.ExportFormatType = ExportFormatType.PortableDocFormat;
      eOpts.DestinationOptions = dFileDOpts;


      if (!System.Diagnostics.EventLog.SourceExists("MyApp1 "))
              "MyApp1", "Application");
      EventLog1.Source = "MyApp";
      EventLog1.WriteEntry ("Crystal Report pdf export success.");

catch(Exception fu)

      if (!System.Diagnostics.EventLog.SourceExists("MyApp1 "))
              "MyApp1", "Application");
      EventLog1.Source = "MyApp";
      EventLog1.WriteEntry ("Something wrong with Crystal Report Load Test!" + fu.Message);

---------------- (code end) -------------------------

After running, I got a pdf file in the CRResult folder. So far so good. But
the report was NOT UPDATED to the latest change in the database. So I added one
line to do REfresh:

oRD.Refresh(); // This is what I added

Well, I got an error on the "oRD.Export()" line after at:

"Query Engine Error on line xxxxx"

So what did I do wrong? Is there any other way to get the refresh view of the
report. And how come the data was not automatically pull form database?

BTW, the report contains simply the content of a database table in a Oracle 9i
Release 2 database. Maybe I don't need to a refresh if I reference to a Stored
Procedure instead of pointing to a database table directly?

Any suggestions are welcomed. Thanks!!


Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Query Engine Error jjshah Crystal Reports 5 December 8th, 2005 07:56 PM
Query Engine Error .... verdun Crystal Reports 6 February 7th, 2005 02:42 AM
Query Engine Error khanhpnd .NET Web Services 2 October 6th, 2004 05:29 AM
query engine error shanzhu Crystal Reports 1 September 30th, 2004 01:13 AM
Query Engine Error AniFu .NET Web Services 0 June 18th, 2004 02:53 AM

All times are GMT -4. The time now is 06:35 AM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.