Print Page | Close Window

Dynamically move columns left/right. Crystal 2008

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=12497
Printed Date: 04 May 2024 at 9:06am


Topic: Dynamically move columns left/right. Crystal 2008
Posted By: burgervr
Subject: Dynamically move columns left/right. Crystal 2008
Date Posted: 03 Mar 2011 at 5:46pm

Hi

 
I hope the answer could be as simple as the question. I do NOT want to use a cross-tab report

 

Assume I have a few columns in Crystal

 

Jan       Feb      Mrt       Apr       May      Jun       Jul        Aug      etc        Total

 

The user select a date range based on start and end date

Let’s assume the data selected 15/02/2011 to 15/08/2011 and for whatever reason there were no transactions in June

 

What I would like to see in Crystal is

 

Feb      Mrt       Apr       May      Jul        Aug      Total

 

Can a column that has no data returnd be susspended and the column to the right automatically be moved to the left.

If not, can the formula button on the X and Width parameter when doing Object Size and Position be used in anyway to achieve the same and if so how?

(Nevermind what I put in the formula nothing seems to change anyway)

 

If none of the above can be achieved, I am open for any other suggestions that might give me the required data return as long as no heavy coding is involved as I am not a programmer

 

Regards

Burger




Replies:
Posted By: lockwelle
Date Posted: 07 Mar 2011 at 9:52am
when I tried to move objects, nothing seemed to happen...
Here's the trick...All of the movements are:
a) in twips (1440 to the inch)
b) from the original location of the control.
 
So to move the control 1 inch to the right the formula is 1 * 1440, I don't remember if you increment by accessing a property, or just return a number.  The formula will not move to an absolute position, only a relative position.
 
HTH
 
It's been a while since I did this


Posted By: burgervr
Date Posted: 07 Mar 2011 at 1:42pm

Hi Lockwell

 

This works great. If I can now take it one step further.

Is there a way to pick up the X (Left start) and Width from a column

 

Where I am going with this is to say: (Explained in English not coded)

 

Start value for column 1 = 1 inch for X and Width = .5 Inch

NOW my formula for column 2

If my Col1 field have no value Then my X for Column 2 must be X of Column 1 x 1440 and width must be Width of Column 1 * 1440

 

For Column 3 I do a check for blank column 2 or not

Then for column 3 my X would be my (X of column 1 + width of column 2 + width of column 3) * 1440

 

Hopes this gives an idea what I want to achieved

 

To do this thou as mentioned I need to know how to pick up the X and width of a specific column

 

Can you help or have any idees on this

 

Regards

Burger 



Posted By: lockwelle
Date Posted: 08 Mar 2011 at 3:03am
I think that I once wrote a report that was entirely dynamic in the layout.  I remember that all the columns started at the same point, and then were either suppressed or moved, but that may be another story...
 
As for displaying the columns in certain locations (so you can skip a column) I would think that a global/shared variable could keep track of where 'next' column is to be printed.
 
HTH
 



Print Page | Close Window