Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

"A string is required here error" message

Posted on 2009-05-20
12
Medium Priority
?
820 Views
Last Modified: 2012-05-07
Can anyone with understanding of ASP/Crystal Reports, please tell me where the following line of code points?

session("oRpt").ReadRecords

I just kept getting the error that says simply: "A string is required here error"

and the error points to the session("oRpt").ReadRecords line.

I have been pulling my here now for 2 days.

I have looked at the .rpt file and what needs to be Datefield is date field.

Only suspicion I have is the logic that says, "If user's selection = "All", then show all values partaining to that field.

Otherwise show the only selected value.

So, for example, there is a checkbox with ALL alongside of FromDate and ToDate.

Not sure if that ALL is creating these issues.

Thanks in advance
0
Comment
Question by:simflex
[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
  • 5
  • 4
  • 3
12 Comments
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 24433247
Make sure that that Field in the database is of the Right [Data Type]
If it is a Number Field, Make sure that it is set as Number
If it is a Text field, make sure that it is set as [Text]
(Would would explain the error somewhat)

Carrzkiss
0
 

Author Comment

by:simflex
ID: 24434244
thanks Carrzkiss

Problem with ASP/Crystal reports is that sometimes, as in this case, you don't get much details.

That line was all I got.

I have checked the db and they have the correct data type.

So, what you are saying is that this line:

session("oRpt").ReadRecords is pointing to the db?
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 24434335
Maybe.
The session
Part is pointing to a session variable.

Please have a look at the following
Crystal Reports: Tutorials and Sample Code
And the old faithful
Google Search for Crystal Report Tutorials

I do not know anything about Crystal Report, I have seen it mentioned and asked
About for a while here on EE, if it was not for EE, then I doubt that I would ever hear about it.

Good Luck
Hope that you can get it resolved.

(Look into a session, as I think that is what that is referring too.
Also, get a hold of the original source and link and see if there is some
Documentation on it as well)

Also.
Is this ASP.NET?
(or) Classic ASP?
If it is ASP.NET , then you can click on the [Request Attention]
And ask to have it re-zoned to ASP.NET

Carrzkiss
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:simflex
ID: 24434449
Yea, I forgot to mention that I do have several reports fully integrated into ASP (Yes, Classic ASP) and working fine.

The reason this one is kicking my tail is because of that simple but hard to figure out error that says, "A string is required here"
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 24434538
Change this
session("oRpt").ReadRecords
To this
CStr(session("oRpt").ReadRecords)

And see if it will compile with errors?
Carrzkiss
0
 

Author Comment

by:simflex
ID: 24434629
still same error:

Crystal Reports ActiveX Designer error '80047405'

A string is required here.
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 24434701
There is absolutely "nothing" on that error what so ever.???

I am sorry, but I really do not know what else to do.
Did you download this project from someone's site?
If so, then you need to go back to their site and see if you can find
Some more info on it, as I have run out of resources over here.

Sorry
Good Luck
Carrzkiss
0
 

Author Comment

by:simflex
ID: 24434865
see what I mean?

Not enough errors to go any meaninful research.

Thanks a lot dude!
0
 
LVL 1

Expert Comment

by:sidkud
ID: 24442623
I guess this has to do with the syntax in
1) a formula used in the report or
2) the selection formula

Most probably this is failing at run time while concatenating or calculating and for some specific data.
... so as carrzkiss: said, you first need to check that the actual data is of the type that it says it is,
(you may want to look at the formulas for that)
and, try running the report for a different set of data (using different filters conditions etc.)
0
 
LVL 1

Accepted Solution

by:
sidkud earned 200 total points
ID: 24444031
I believe the readrecords method is responsible for actually pulling the data from the server, based on the filter criteria, so please examine the logic used for filtering,
More specifically, the text between these two lines

Set session("oRpt") = session("oApp").OpenReport(path & "\" & reportname, 1)
...
...
session("oRpt").ReadRecords

I have attached a code snippet with my understanding of the report filter
if Request.Form("CheckAll") = "on" THEN
	session("oRpt").RecordSelectionFormula = ""
 
else
	Session("oRpt").ParameterFields.GetItemByName("StartDate").AddCurrentValue(CStr(" & request.form("SDate") & "))"
	Session("oRpt").ParameterFields.GetItemByName("EndDate").AddCurrentValue(CStr(" & request.form("EDate") & "))"
	session("oRpt").RecordSelectionFormula = "{t1.test_date} in DateTime ({?StartDate}) to DateTime ({?EndDate})"
end if

Open in new window

0
 

Author Comment

by:simflex
ID: 24520362
Thanks a lot. I almost forgot about this post because I got frustrated and left it alone.
0
 
LVL 1

Expert Comment

by:sidkud
ID: 24533127
Hi,
Hope you got this to work.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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 recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

610 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