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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically Changing column width

Status
Not open for further replies.

ind123p

Programmer
Sep 28, 2005
62
I am using CR Xi.

Is there a way to dynamically change the column width ? I read some where that you can use some API to accomplish this.

What specific APIs do I need to use ? Is this the only route to accomplish this functionality ? Is there no other approach ?

Hope somebody gives me a direction...!!
 
If the changes are modest. then you can create multiple sections and suppress them according to which size suits you.

Crosstabs will dynamically change their size by themselves, if that works for you.

You should specifically post the requirement.

-k
 
thanks K for the response. I am using the "suppressing sections" approach.
I was wondering if this approach can be avoided. Let me explain my problem

I have 10 parameters being passed to a report.

col1, col2....col10

If the user selects 10 parameters

col1 col2 col3 col4 col5 col6 col7 col8 col9 col10

if the user selects 3 parameters, this is what I show

col1 col2 col3

The entire right side of the report appears blank.

So I show it like this
col1 col2 col3

Assume page width is 10inches so each field is kept at 3.3 inches each..

My client is not happy with this too.. as it now introduces gaps between the fields

I was thinking if I could dynamically change the width of the columns to eliminate any gaps between the fields.

I hope I have explained my problem clearly..
 
Ahhh, I see.

Assuming that you've misrepresented the concern, and that they can shoose any field to display, not always columns in order, you could build out 10 formulas, as in:

@col1
If {?parm1} = true then
{table.field1}
else
If {?parm2} = true then
{table.field2}
else
If {?parm3} = true then
{table.field3}
else
etc...

So you have 10 formulas which designate which column to display

@col2 would start with parm2, as in:

@col2
If {?parm2} = true then
{table.field2}
else
If {?parm3} = true then
{table.field3}
else
If {?parm4} = true then
{table.field4}
else
etc...

You didn't share what's in the parms, so I couldn't code it to your design, hopefully this describes a solution.

Posting specifics allows for specific answers.

-k
 
K.

Thanks for the response.. But I am not understanding how your approach will solve my problem.

Going by your approach, if the user selects 3 parameters

I will get the following:

table.field1 table.field2 table.field3

The right side of the report will still be blank.

Have I not understood your approach ..Am I missing something very obvious ?

>>You didn't share what's in the parms, so I couldn't code it to your design,
The parameters can contain Date, string, number.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top