Report errors: Unknown query engine errors and query engine errors

Source: Internet
Author: User
Because the report is complex and involves data from multiple tables, and the report format is complex, all the data required for the report is calculated during design and then saved to dataset, dataset contains six tables, and then writes dataset to the XML file. Then, the XML file is used as the design basis for the report data fields.

// Display the report. Click ()
Reportquery RQ = new reportquery ();
Dataset DS = new dataset ();
DS = RQ. getreportdata (jyjxsbm_list, sfzh_list); // obtain report data
DS. writexml (@ "C: \ report. xml"); // write report data to the XML file
Fmreportforms fm = new fmreportforms ();
FM. Show ();
// Report load ()
Samspoint. Report. SDAS. crystalreport4 Cr = new samspoint. Report. SDAS. crystalreport4 ();
Dataset DS = new dataset ();
DS. readxml (@ "C: \ report. xml ");
Cr. setdatasource (DS );
This. crystalreportviewer1.reportsource = CR;

Errors may occur when running: Unknown query engine errors and query engine errors. Note that not all situations will cause errors!

Later I thought about why I had to write the XML file and then read the XML file to the dataset. Isn't that the case? In fact, the original idea was that since XML was the data source, we had to read the XML file and then use the read data as the data source! A big mistake !! When designing a report, the report field designed from the XML file is actually just a template, as long as the report data source (Cr. setdatasource (DS);) is consistent with the data source in the design phase.

Why is an error reported? Because some fields are empty when writing an XML file, they are not in the XML file. As a result, errors are inevitable!

// Display the report. Click ()
Reportquery RQ = new reportquery ();
Dataset DS = new dataset ();
DS = RQ. getreportdata (jyjxsbm_list, sfzh_list); // obtain report data

Fmreportforms fm = new fmreportforms ();
FM. reportdata = Ds;
FM. Show ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.