Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Creating a Report Post Reply Post New Topic
Author Message
toby007
Newbie
Newbie
Avatar

Joined: 02 Dec 2008
Location: Australia
Online Status: Offline
Posts: 3
Quote toby007 Replybullet Topic: Creating a Report
     Posted: 02 Dec 2008 at 11:47pm
Hi there
 
I have created a report using Crystal Reports 10.
 
I want to improve the reporting or rather the data that is reported on.
 
I have created a query to select the data to use in the report.
 
I further want to refine the data which is selected.  I cant see how I can edit the query so as to do this.
 
 
Also is there a way that I can allow a user to enter a start and end date to report on so that I can limit the data that is displayed in the report.
 
Thanks in advance for any assistance given.
 
Regards
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Dec 2008 at 6:26am
right click on parameters, add a new parameter, then you can use this value in the report/selection formulas/record to limit the data.
 
You could also create a stored procedure and use that as your datasource which would give you greater flexibility in the data selection/manipulation.
 
Hope this helps
IP IP Logged
toby007
Newbie
Newbie
Avatar

Joined: 02 Dec 2008
Location: Australia
Online Status: Offline
Posts: 3
Quote toby007 Replybullet Posted: 03 Dec 2008 at 8:49am
OK - that helps a little
 
Just to clarrify things a little further.
 
The database that I am using is MySQL.  Basically I want to be able to give a user an option to create a weekly report of sales made during for a selected week.
 
So basically they will be required to enter the start date and the end date for the week/period that they wish to report on.
 
I tried the previous suggestion and it sort of worked but didnt quite give me the results I was expecting.
 
Any further ideas would be appreciated.
 
Regards
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Dec 2008 at 8:54am
How were they unexpected?
Parameters are how you would limit a report's data, either connecting straight to the database or through a stored proc.
 
As to looking at the Query that Crystal is using to select data.
Database/Show SQL Query...
 
IP IP Logged
toby007
Newbie
Newbie
Avatar

Joined: 02 Dec 2008
Location: Australia
Online Status: Offline
Posts: 3
Quote toby007 Replybullet Posted: 03 Dec 2008 at 8:59am

even though i had created and set up the parameters the reports still appeared to have data displayed from a different period ? not sure why this would be happening

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Dec 2008 at 9:03am
did you filter the data by adding it to Report/Selection Formulas/Record?
 
The report needs to know how to apply the the parameters.
 
Usually something like:
{start param} <= {date field} and {date field}<={end param}
 
A true implies to use the data, and a false excludes it from the report.
 
Hope this helps
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum