Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: How to do this ? Post Reply Post New Topic
Author Message
GowthamSen
Groupie
Groupie


Joined: 03 Jun 2009
Location: India
Online Status: Offline
Posts: 65
Quote GowthamSen Replybullet Topic: How to do this ?
     Posted: 22 Dec 2009 at 3:02pm
Hi,
 
I have two different queries in my crystal report.
 
Lets say Query1, Query2.
 
In Query1 , I have columns EmpId, EmpName, Sal.
 
In Query2, I have columns  Label, Actual Label, Language
 
I am displaying Query1 data in Details section. As of now I am displaying headings as Employee_Id, Emplyee_Name and Salary.
 
Now I want to display different labels as headings based on input parameter language.
 
So In Query 2, I have list of all labels and Actual Labels.
 
I created formulas for header labels as , EmpId_Lang, EmpName_Lang and Sal_Lang.
 
I created the forumla for EmpId as follows.
 
= If ( {Quer2.LABEL}="Employee Id" and {?Lang}='Chinese") Then {Query2.'Actual Label'} ELSE "Employee Id"
 
The problem is, its working only for first record. But if the conditioned label is after 1st record in Query2, its not working.
 
how can we do thi? Do we have this kind of functionality in Crystal?
 
Thanks in advance
 
Regards
Gowtham
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 Dec 2009 at 6:16am
where are the labels? If they are in the page header, they are only calculated once per page, if they are in same section as the detail, they should work.
IP IP Logged
GowthamSen
Groupie
Groupie


Joined: 03 Jun 2009
Location: India
Online Status: Offline
Posts: 65
Quote GowthamSen Replybullet Posted: 23 Dec 2009 at 7:43am
Thank you lockwelle for your reply.
 
Actually my requirement is that, the labels should be changed dynamically based on input parameters passed to the report.
 
so, I am bringing two dataproviders (2 queries) into report.
 
One query contains data that we will be displayingin report. And the other contains list of parameter values and the corresponding label value.
 
So based on parameter, the report headings (labels) should be updated.
 
Any ideas please?
 
Thanks in advance
 
Regards
 
Gowtham
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 24 Dec 2009 at 6:32am
hmm...
 
just to refresh, the labels only display for the first record in parameter/label table, right?
 
If so, then, I have this same issue with another reporting tool, and looking back on CR it might be similar.
 
CR steps through the primary data related table, but not the secondary tables attached, and since I haven't needed to do this, I don't know how to off-hand, perhaps someone else does.
 
What you might try, is a subreport that returns the labels based some criteria, which is already defined. The subreport could either a) just display the labels as its output or b) pass the values to shared variables to be displayed on the main report.
 
Hopefully this is helpful
IP IP Logged
GowthamSen
Groupie
Groupie


Joined: 03 Jun 2009
Location: India
Online Status: Offline
Posts: 65
Quote GowthamSen Replybullet Posted: 24 Dec 2009 at 8:58am
Thanks Lockwelle.
 
The idea of using Subreport as header is good. I will try this out and will update this.
 
Thank you
Regards
 
Gowtham
 
Wish you Merry Christmas and New Year!!
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