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!

Where is the "Display String" setting as noted in the linked thread..?

Status
Not open for further replies.

Man5ell

IS-IT--Management
Oct 5, 2009
6
GB
thread767-1611629

Hi lbass,

In the above post you mention the following:

"I think you can use an inserted crosstab and just select the summary->right click->format field->display string->x+2 and convert the seconds to a string there."

I've tried right clicking on the field I am trying to convert in the cross-tab and going to the Format Field menu but there is nothing in this Format Editor window that refers to a "Display String" setting.

I am using Crystal 8.5, could that be why?

I'd appreciate some help by return as I am having exactly the same issue as raised in the original posting.

Thanks in advance

Best regards

Steve
 
Display String became available in 9.0, I believe. If you want help, please provide specifics about the crosstab setup (rows/columns), the summarized field that you want to convert, etc.

-LB
 
Thanks for the speedy reply LB.

Bascially the cross-tab currently contains only numeric figures, including downtime in seconds (per "gradespec"), and then summarised for the total of all of the "gradespecs".

Instead of seeing total seconds, the customer would rather see hh:mm:ss - which is only available as a non-summarised value, in a cross-tab.

Is there any way of doing something similar to the original thread, only in Crystal 8.5 instead?
Code:
==================================================================
Cross-tab |  gradespec_x  |  gradespec_y  |  gradespec_z  |  total
==========|===============|===============|===============|=======
Value_a   |            1  |            1  |            1  |      3
----------|---------------|---------------|---------------|-------
Seconds   |           10  |           20  |           30  |     60
------------------------------------------------------------------
Value_b   |          101  |          102  |          103  |    306
==================================================================
Thanks again

Steve
 
Here is a kludgy workaround. Using the SynapseVampire faq for the conversion formula, select the seconds inner cell and total->format field->common tab->suppress->x+2 and enter:

whileprintingrecords;
numberVar dur := datediff("s",{Orders.Order Date}, currentdate); //get the seconds between 2 dates
numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;
hrs := Truncate(Truncate(dur/60)/60);
min := Remainder(Truncate(dur/60),60);
sec := Remainder(dur,60);
hhmmss := totext(hrs,"00") + ":" + totext(min,"00") + ":" + totext(sec,"00");
hhmmss;
false

Then go to the numbers tab->customize->currency tab->enable currency symbol->fixed->position: -123$->currency symbol->x+2 and enter:

whileprintingrecords;
stringvar hhmmss;

This will return the value first followed by the string conversion, e.g., if the value is 1131, it will return:

1,131.00 00:18:51

The only way to remove the value is to resize the width of the field so that only the 00:18:51 displays.

Another route would be to add a formula {@0}:

whilereadingrecords;
0

...as a second seconds summary, where you use this to display the results of the converted value (the preceding summary in which you have added the suppression formula). If you format this to no decimals and round to 1, you will get one zero on the left followed by the desired display. I think in 8.0 I then could go into the customize number screen and change the display zero to be blank (with no default or any value). I couldn't do this in XI. You could then suppress the 1st summary, displaying only the converted string in the {@0} summary.

-LB
 
That's perfect, thanks a lot LB.

The only difference for me was to replace:

Code:
numberVar dur := datediff("s",{Orders.Order Date}, currentdate); //get the seconds between 2 dates

With

Code:
numbervar dur := currentfieldvalue;


Thanks again!
 
Sorry. Copied my test formula into the thread without changing that. Glad you knew to do that.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top