Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formatting Q

Status
Not open for further replies.

unknownly

Programmer
Jul 7, 2003
181
US
Hi All,

There is this report where my user enters a value for the Parameter1(Say: blah001)
then in the Page header(subheader) in the report should print the description for the value 'blah001'

For this Iam using a formula of IF-THEN-ELSE condition.

@subheader

If parameter1 = 'xxxx' then 'XXXXXXXXX report'
else
if parameter1 = 'yyyy' then 'YYYYYYYYY report'
else
if parameter1 = 'zzzz' then 'ZZZZZZZZZ report'

But when there a 3-4 parameters the report is based on and if there is no data for the given values.

Then the subheader doesn't print.

Is there any way that I can still print the subheader even there is no data.

I have tried to do a subreport too. But even the subreport works only when the report has data else it's blank.


Thanks,

Sweetie

 
If you are using crystal v8 or better use the join() function on your multi-value parameter:

Join({?Parameter}, ",")

This iwll return all the members of the parameter, separated by a comma.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Give your formula a default value

(I hate "blah" data...BTW)

@subheader

If parameter1 = 'xxxx' then 'XXXXXXXXX report'
else
if parameter1 = 'yyyy' then 'YYYYYYYYY report'
else
if parameter1 = 'zzzz' then 'ZZZZZZZZZ report'
else
'Give your message here'

THere can never be an instance where the parameter will have NO Value...the report will not proceed if the parameter is NULL. But the user may enter a bad value and you should have a default to take care of this situation.

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Ok, Iam sorry!
@subheader

If ?type = 'icbs00' then 'balance report'
else
if ?type = 'icis00' then 'income report'
else
if ?type = 'ictp00' then 'third party report'

So, base on the user input value for ?type the subheading should change.(I placed this @subheader in Page header section).
say the report header should be printed as if ?type = icbs00
Main report heading
balance report


and if ?period is enterd as Jan2003 and there is no data for that period.
my Query doesn't return any data. So the report heading is printed as
Main report heading


Iam using a peoplesoft query and the parameters doesn't exactly work as they do in CR. Input values entered by the user is stored in a peoplesoft table this where the trouble is. I know Iam not very clear but hope you guys understand.
Iam using CR v8.

Thanks,

Sweetie








 
Well it is getting clearer, Sweetie :)

I don't understand this statement in your first post...

But when there a 3-4 parameters the report is based on and if there is no data for the given values

You have given me only 2 parameters here {?type} and {?Period}...is there more to this story, Yet.

And yes you will not get this header if there is no data...this is because there is no Page Header generated. If it was in the Report Header I think it would be printed though.

I don't really understand the urgency to modify this formula if there is no data....there must be more than you are showing. Does a report return ANYTHING if there is nothing for a given period??? Is this a multi-valued parameter?

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
The other Parameter I missed was ?Unit. ?type,?Unit,?Period

I have suppressed the report header section.

If there is no data is returned when the report is ran for a given input values. It still prints the Text box fields and column headings. right!
and even he Main Title for the report Which I placed in the Page Header and under that Iam placing a subheading(@subheader). So, why doesn't it print the Subheading because in the subheading Iam checking for the ?Type value which is entered by the user. Though it doesn't have any data to display in the report. It should be printing the subheading since Iam hardcoding it. Isn't it?

I would like to Thank you for your time

Thanks,

Sweetie
 
Are you sure you have no conditional suppression on the page header section? If you have something like "OnLastRecord" as a conditional suppression and your report pulls no records, the page header will be suppressed since it is located "after the last record".

-LB
 
I have no conditional suppress in any section.

Thanks,

Sweetie
 
Sorry I was wrong about the Page Header....yes...the text boxes and your formula Should appear if there is no data returned.

This is what you want, yes?...but it isn't in your case...hmmmm...this must be because of the way parameters are stored in PeopleSoft, I suppose

SO In order for it to do this the parameter "Type" must be returning as a NULL hence crashing the formula

So then your formula won't evaluate with the user input.

the best I can see happening is to display a "Default" subheading...which you should have anyway to protect against bad user input....something like this

If isnull(?type) then 'No Data Found'
else
If ?type = 'icbs00' then 'balance report'
else
if ?type = 'icis00' then 'income report'
else
if ?type = 'ictp00' then 'third party report';

this will confirm perhaps my thinking.






Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Yeah! You got my point. I guess there is no work around.

Can I ask a Question.. I didn't know about this until I tried it and I was surprise.

when I using a subreport. This is what Iam doing.
The input values user enters is stored in Peoplesoft table(special table)so I created a subreport and placed it in the place of the @subheading. In subreport I call only that special table and using the @subheading to hardcode the headings and i link the main report to subreport by user id and a control id. Doesn't the subreport work when the main report doesn't return any data.

Subreport works fine otherwise but doesn't work when no data is returned.

I just wanted to whether this is true.

Thank you,

Sweetie
 
this may be a work-around.

Place this subreport in the page header based "ONLY" on the special table assigned by PeopleSoft...have no links to the report at all. Thus it will run independant of the main report...whenever the Page Header is run. This should work.



Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Jim Broadbent,


Special tab has the following field where the user input is stored in these fields

Special //customzied special table created in PeopleSoft

userid,
processid,
param1,
param2,
param3,
param4,
param5


Iam call a query in the CR report

This is how the query look(ex: only)


select
tab1.field1,
tab1.field2,
tab1.field3,
tab2.field1,
tab2.field2,
tab2.field3,
special.userid,
special.processid,
special.param1,
special.param2
from
tab1,tab2,special
where
tab1.field1 = tab2.field1 and
tab1.field2 = special.param1 and
tab1.field3 = special.param2 and
special.userid = ?userid and
special.processid = ?processid

Iam using the following Formula in order to display subheading for the report as well as to display
the user input values in the header section(as to the user knows what values he has ran the report for)

@subheading: // Placed in the Page header section

if
special.param1 = 'icbs000' then 'Balance Report'
else if
special.param1 = 'icis000' then 'Income Report'
else if
special.param1 = 'ictp000' then 'Third party Report'


Issue with the report is:: When the Query doesn't return any rows or data. These headings are not printed.
So, to workaround with this issue Iam using a subreport where Iam call just the specail table and Iam linking the subreport and main report based on the following


?userid = userid //(field in the subreport)
and
?processid = processid //(field in the subreport)

Subreport works fine when I run only the subreport. But when I run the main report i doesn't print anything.
I can't figure out where Iam doing wrong.

// Placed the subreport in the Page header section and I have also tried placing it in the report header section.



Please Help!!!

Thank you,

Sweetie





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top