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!

how to create dynamic report in crystal report 8.0

Status
Not open for further replies.

pwsupport

Programmer
Dec 5, 2000
2
IN
User will be shown the field in li. He can selected
the field which he wants . so selected field only should be shown in crystal report with perfect alignment.

Ex
Employee Code
Name
Address
Salary Details
if Selected
Employee Code
Name
Address
Output : employee code Name Address
if Selected
Employee Code
Name
Salary Details
Output : employee code Name Salary Details

So Please Help Asap

Thanks in Advance
 
Here is the method I have used to do this.

1) Create a parameter field (for instance..call it
"Parameter1") and set default values of
"Employee Code","Name","Address","Salary Details"

Place this Parameter Field in Report Heading.

2) Create a formula field (for instance..call it Field1)
uses a formula like below:
if {?Parameter1} = "Employee Code" then {PersonInfo.Emp_Code} else
if {?Parameter1} = "Name" then
{PersonInfo.NAME} else
if {?Parameter1} = "Address" then
{PersonInfo.Address} else
if {?Parameter1} = "Salary Details" then
totext(({ANNUALSALARY.AnnualSalary}),"#,###.00",2) else
""

(Note that I have converted the Salary ( a number field) to
"Text" since all resulting fields in a formula must be same
type.

Place this formula in Detail Section.

When report is ran...User will be prompt for value of
parameter field...based on selection....the Parameter value
will show in "heading" and the appropriate field values
will show in detail.


Create additional parameter fields and formula fields as
you wish...just use the same parameter values and formula
as in the first one. Or, of course, you could change as needed also.


Good luck and let me know if you have any questions.

Ken Hardwick
KHardwick@kmg.com
Norman,Ok

Home of the Sooner !

 
The following is taken from the Seagate FAQ available at:


Q: Can I use Microsoft Visual Basic code to create reports on the fly in the
RDC 8?
Yes, you can use Visual Basic code to create reports on the fly at runtime using
our Report Creation API calls (RCAPI calls). This is a new feature with the RDC
8. In addition to creating reports programmatically, you can add objects
(Database objects, Field Objects, Subreport objects etc.) to existing reports at
runtime.
RCAPI calls are not part of the Free Runtime license Agreement. Before
distributing applications using RCAPI calls, you must purchase a license from
Seagate Software. For further information, contact Seagate Software or visit
Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top