Solved

Wrong data being displayed

Posted on 2008-10-24
4
602 Views
Last Modified: 2013-11-23
Hi,

I'm using Delphi 2007 using ReportBuilder.

I have a problem with wrong data being displayed in the report.
On the datamodule I have a few queriies, and matching datasources.
On the form with the report I have matching DataPipeLines.

The queries use parameters to narrow the records to a specific date of orders.
In the datamodule I have specified a certain date to see if it works.

When I walk through the resultset of the query of the datamodule, the application gives me the correct records. BUT .... the report is showing the records with the specific date mentioned above.

Can someone tell me what I'm doing wrong ???

Thanks in advance,
Benny.
0
Comment
Question by:tri_soft
  • 2
4 Comments
 
LVL 21

Expert Comment

by:developmentguru
Comment Utility
You will need to show the query that you are using, let us know which database you are using... just give a lot more detail.  Odds are good that the field you are looking at in the dataset is not the same one being referenced in the report.  Does the report show the correct number of records?  I will try to help more when I have more to go on.
0
 

Author Comment

by:tri_soft
Comment Utility
I'm using mySQL

The query on the datamodule shows 1 record, but the report prints 2 other records.
So no, the number of records is not correct.
AND ... the records displayed are also not correct.
The report prints the records found by the query with the default parameter (set in the datamodule)

Example : select * from orders where date_order=:date_selected
  In the datamodule "date_selected" = 20080205
  When executing the report the parameter "date_selected" is set to 20081023
  Showmessage of the details of the orders gives 1 record ==> 20081023
  The report prints 2 records ==> 20080205

DataPipeLine of the report is connected to the DataSource of the datamodule, DataSource is connected to the query above.

Thanks for looking into this strange behaviour.
0
 
LVL 21

Accepted Solution

by:
developmentguru earned 125 total points
Comment Utility
Unfortunately I am more familiar with Rave reports instead of Report Builder, but I will give this a try.  One thing you can do to help in testing your report is to put in events on your dataset to stop after the dataset is opened and after scroll.  This will give you places where you can stop in your code and check a few things...

1) Is the query what you think it is when the dataset is opened?
2) Is the report component actually linked to the dataset you think it is when you run the report?

  If you find that the query is wrong then you can follow from the AfterOpen event beck up the call stack to where it was opened.  It is possible that you need to set the parameter within the reporting software and it is using a parameter from when the report was designed.

  If you check and the report is using a different dataset then you can place a data breakpoint on the address of the dataset within the reporting software.  This will break at the moment that it is changed and show you where it changed.

Let me know how this testing goes.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now