Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Display Report Header even no rows in Detail Secti Post Reply Post New Topic
Author Message
Bhanu Prakash T
Newbie
Newbie
Avatar

Joined: 09 Jan 2012
Online Status: Offline
Posts: 7
Quote Bhanu Prakash T Replybullet Topic: Display Report Header even no rows in Detail Secti
    Posted: 28 Nov 2012 at 12:16am
How to display values in Report Header even when there are no rows in Detail Section.

I have two different tables and they are not linked to each other. First table has few columns defined and used to display rows in Detail section and second table has only one column and one row and used to display the details of the Search Criteria in Report Header section. But when there are no rows returned from the database for the search parameters selected by the user, "Search Criteria" is also not displayed. I have verified that there are no rows being returned in the first table for the details section, but there is always a row returned in the second table for the Report Header section.


Can you help how to display the Search Criteria when there are no records to display in the details section ?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 28 Nov 2012 at 4:00am

What is your selection criteria (formula from the Select Expert)?  I would do something like the following:

 
(
<existing select formula>
)
or IsNull({FirstTable.SomeKeyField})
 
Note where I put the parentheses - this is important or else it won't work correctly.  Basically when you use a key field that always has data in the first table, by looking for it to be null, you should get the data from the second table even when nothing matches the regular selection criteria for the report.
 
-Dell
IP IP Logged
Bhanu Prakash T
Newbie
Newbie
Avatar

Joined: 09 Jan 2012
Online Status: Offline
Posts: 7
Quote Bhanu Prakash T Replybullet Posted: 28 Nov 2012 at 4:13am
The user selected search parameters are passed to a stored procedure and then the stored procedure returns two tables, first table data is directly attached to "Details" section and second table data (one column and one row) is also directly attached to SearchCriteria field in Report Header section. No other selection formula exist. Can you please explain now ?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 28 Nov 2012 at 6:04am
I didn't realize that you were using a stored procedure - things work a little differently there.  I would update the stored procedure so that it will return a table with a single blank row when there is no data.  I suspect that the fact that the table it returns is empty (or possibly null) is what is causing your issue.
 
-Dell
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.031 seconds.