?
Solved

Error 20515

Posted on 2003-03-10
15
Medium Priority
?
254 Views
Last Modified: 2008-01-16
Hi everyone,

I am using CR8.0. In my report I have only one formula (all the others have been commented. They generate the same error on diff Formulas).
When I launch a .bat file (see command below) which execute a VB6 app which receive 1 parameter for CR (that part works fine), I get the following error message:
20515 - Error in Formula <Formula_Field>.
'StringVar str;
'
The ) is missing.

Here is the code for the Formula. There are no ) missing ???
StringVar str;
str := "Du ";
str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")));
str := str + " au ";
str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")) + 6);
str

Note: Timestamp is a DateTime.
The VB6 app is exporting from .rpt to .xls. This works fine without the Formula mentionned above.
the .bat command is:
MyVB6App.exe "username||pwd||MyRPTReportPath||MyXLSReportPath||19||TheParameterForCR"

username and password for the database
.rpt report source and the destination .xls report
19 is the format of exportation (.xls) and
the parameter for CR Report.

I cannot see where is the real problem.
HELP please !!!

Thanks a million
Gallia


0
Comment
Question by:Gallia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
15 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 8105634

GroupName takes only 1 parameter

str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")));

should be

str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}), "daily"));


str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}), "daily") + 6);

mlmcc
0
 

Author Comment

by:Gallia
ID: 8105889
mimcc,

The second DateValue (case with + 6) you suggested is giving this error:
To many argument for DateValue (which takes 1 or YYYY,MM,DD)

but if instead I put:
str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp})+6), "daily");
The msg is A string is expected (+ "6"). But I want to add 6 days, not append 6 to the date. How can i do it ?

Thanks again
Gallia
0
 

Author Comment

by:Gallia
ID: 8105901
mimcc,

I forgot to add that even if i put the second str := ... in comment, i still get the error 20515 The ) is missing.

Gallia
0
Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

 

Author Comment

by:Gallia
ID: 8105951
mimcc,

I forgot to add that even if i put the second str := ... in comment, i still get the error 20515 The ) is missing.

Gallia
0
 

Author Comment

by:Gallia
ID: 8106041
mimcc,

I forgot to add that even if i put the second str := ... in comment, i still get the error 20515 The ) is missing.

Gallia
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 8107346
I am not sure what the problem is.

Does

str := "Du ";
str := str + " au ";
str

work?

CR7 doesn't have the GroupName function.  I'll look at that in the morning.

mlmcc
0
 

Author Comment

by:Gallia
ID: 8110721
mlmcc,

str := "Du ";
str := str + " au ";
str

does work.
Gallia
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 8111559
You need a format string in the ToText function


StringVar str;
str := "Du ";
str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")),"dd-MMM-yyyy");
str := str + " au ";
str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")) + 6","dd-MMM-yyyy");
str


mlmcc
0
 

Author Comment

by:Gallia
ID: 8111966
mlmcc,

I removed the double quote after the 6, it gave the ) missing error in CR.
Now CR doesn't give any error, but when I execute the .bat file, I still get the error 'The ) is missing'.

What could be the reason(s) ?
Thanks
Gallia

0
 
LVL 101

Expert Comment

by:mlmcc
ID: 8115758
It has something to do with the adding of 6
Delete that line and see if it is accepted.

There is a date add function in CR8. (DateAdd I think)

Not sure of the syntax
It is either
DateAdd(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily"))), 6 ,"D")

or

DateAdd("D",DateValue(GroupName ({iApplicationStat.Timestamp}, "daily"))), 6 )

mlmcc
0
 

Author Comment

by:Gallia
ID: 8122575
Sorry for the delay.

I have tried what you suggested and all the variations possible, but nothing worked. When i try

DateAdd(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")), 6 ,"D")

I get 'a string is expected here. (before DateValue)

if i try
DateAdd("D",6,DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")))

I get the error 'missing )'

Thanks for your help and your time
Gallia
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 8124824
You still need the ToText( )around the date

Sorry.  Was lazy in typing and copying.

mlmcc
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 150 total points
ID: 8124826
ToText(DateAdd(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")), 6 ,"D"))

mlmcc
0
 

Author Comment

by:Gallia
ID: 8131451
mlmcc,
Your last comment did not work either. I am considering to get rid of the GroupName function. It doesn't seem to be mandatory.

The working code is:
ToText(DateAdd("D",6,DateValue({iApplicationStat.Timestamp})));

Thanks for the help
Gallia
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 8132649
I see where the problem lies then.  Forgot the format of the DateAdd

ToText(DateAdd("D",6,DateValue(GroupName ({iApplicationStat.Timestamp}, "daily"))))

Glad you got it solved.

mlmcc
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question