Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Formula Workshop Post Reply Post New Topic
Author Message
yuritemp
Newbie
Newbie


Joined: 26 Aug 2008
Online Status: Offline
Posts: 3
Quote yuritemp Replybullet Topic: Formula Workshop
    Posted: 26 Aug 2008 at 3:06am
Dear All,

My Situation now is, i am using visual studio.NET 2005 to develop the application and crystal reports. I create system views to add in tables needed and use selection formula to filter out the data needed.

(a) How can i use two views for the same report?

(b) SELECT ( SELECT SUM(table_field) FROM table_A  **ps1**  ) AS Sum_A,
( SELECT SUM(table_field) FROM table_B  **ps2**) AS Sum_B
FROM table_A **ps3**

How can i insert a "WHERE" into the sql when there is a DateTimePicker for the user the select date. The "WHERE" is unable to place into **ps1** and **ps2**

How can i achieve this ?
SELECT ( SELECT SUM(table_field) FROM table_A  where date=DateTimePicker.value ) AS Sum_A,
( SELECT SUM(table_field) FROM table_B  where date=DateTimePicker.value ) AS Sum_B
FROM table_A where date=DateTimePicker.value

Wish to achieve it in the Record Selection Formula.

Thank you,
Regards,
Yuri.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 26 Aug 2008 at 2:06pm

Is this one DateTimePicker or two?

If it's one:
1.  Create a date parameter in your report. 
2.  In the Select Expert, set the date field in your tables "is equal to" the parameter you just created.
3.  In your code, set the value of the parameter to the value of the DateTimePicker prior to displaying the report.
 
If it's two parameter, repeat the steps above for the second date.
 
-Dell
IP IP Logged
yuritemp
Newbie
Newbie


Joined: 26 Aug 2008
Online Status: Offline
Posts: 3
Quote yuritemp Replybullet Posted: 26 Aug 2008 at 8:11pm
Thank you for your reply Hilfy, really appreciate it ..

IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.