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!

Not display comma in start of data in Report footer formula 1

Status
Not open for further replies.

varadha72

Programmer
Oct 14, 2010
82
US
Hi can someone help me here. I have below outline in my report.
In Group Header:
@int
WHILEPRINTINGRECORDS;
STRINGVAR WorkingDay:="";
STRINGVAR finaloutput;

In GroupFooter-1a
@DisplayWorkingDays
WHILEPRINTINGRECORDS;
STRINGVAR WorkingDay;
WorkingDay;

In Details:
@WorkingDay
WHILEPRINTINGRECORDS;
STRINGVAR WorkingDay;
WorkingDay:=WorkingDay+ ","+ {cmd.PivotDate};
WorkingDay;

In Group Footer-1b
@FinalOutput
WHILEPRINTINGRECORDS;
STRINGVAR finaloutput:="";
Finaloutput:= TRIM({@@DispWorkingdays});

OUTPUT:I am getting output like ,8/1/2014,8/2/2014,8/3/2014

REQUIRED OUTPUT:8/1/2014,8/2/2014,8/3/2014

I need to get rid of the comma in the start. I tried using onfirstrecord and onlastrecord as well, but of no use. Please can someone suggest how I can get rid of the comma from the start only.
 
The RIGHT() of the WorkingDay string, for the LENGHT() of the WorkingDay string minus 1.
 
Thanks I am was trying the same using left()
left(FO,len(FO)-1) which did not work, but right() worked thanks.
 
Another (perhaps simpler) approach would be to use the Mid function.

Also, your approach could be simplified slightly by changing your {@FinalOutput} formula to refer to the WorkingDay variable itself rather than the formula where it was created.

The formula would look like this:

[Code {@FinalOutput}]
WHILEPRINTINGRECORDS;
STRINGVAR WorkingDay;
WorkingDay := Mid(Trim(WorkingDay,2));
WorkingDay
[/Code]

Hope this helps.

Cheers
Pete

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top