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!

Auto fit fields in the crystal

Status
Not open for further replies.

nag999

Programmer
Apr 16, 2003
33
IN
Hi there,

I have a report that takes "Number of days" as a user-parameter that is displayed as a column. the user can slect any number from 1 to 20.
Since i do not have control to dynamically display the columns, my idea is to fetch all the columns upfront and suppress them accordingly.

The problem is if the user selects 5 days then after i suppress the remaining 15 columns the report layout goes haywire as expected...

what i wanted to do is the display the user specified number columns that auto-fit the report. i.e. if the user selects 5, then the report should display these 5 columns not to one end but auto-fit so that it does not give an impression that we have suppressed other columns.

Can we control the positioning of the fields in the crystal using formulas.

Can anyone give some ideas

Thanking in antcipation.
Nag.
 
Thsi depends on what is meant by dynamically suppressing the columns.

You can construct the Mother if statement which will dynamically determine what is to be in each column, as in:

@col1
If {?parm1}[1] = "Name" then
{table.name}
else If {?parm1}[1] = "Company" then
{table.company}
else If {?parm1}[1] = "City" then
{table.city}

Now you would suppress all other fields based on the number of parameters selected.

The downside is data types, which you can address by either converting them to text, or by using multiple formulas per column, and suppressing them based on the data types.

As you can see, this is not easily done, but it is doable.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top