Print Page | Close Window

Formula Workshop

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4088
Printed Date: 16 May 2024 at 9:43pm


Topic: Formula Workshop
Posted By: yuritemp
Subject: Formula Workshop
Date 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.



Replies:
Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: yuritemp
Date Posted: 26 Aug 2008 at 8:11pm
Thank you for your reply Hilfy, really appreciate it ..




Print Page | Close Window