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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP to Crystal isn't seeing sqlstring

Status
Not open for further replies.

hodgesp

Programmer
Apr 21, 2004
32
US
I am having an issue passing a sqlstring into crystal via an ASP page. I have checked my code, and my connection, everything seems ok.

In fact the crystal report page displays the report just fine. The problem is that it seems to be ignoring the sqlstring variable that limits the dataset and the report displays <b>ALL</b> the data from the view instead of the records in the select statement.

I used the exact same script I use to browse the data and I modified the page to include these lines:
Code:
%>
<!-- #include file="AlwaysRequiredSteps.asp" -->
<%
   session("oApp").LogonServer "PDSsql.dll", "ServerName", "dbName", "Usename", "Password"
   session("oRpt").SQLQueryString = sqlstring   
%>
<!-- #include file = "MoreRequiredSteps.asp" -->
<!-- #include file = "SmartViewerActiveX.asp" -->
		</center>
	</body>


I pass the variable with Response.Writes and the values displayed are correct. I looked at similar pages on my local intranet for comparison and except for database specifics they are the same as mine, yet they seem to work ok.

Is the problem Crystal??? I can not seem to make this work.


 
You might want to try something like this:

window.location.href = serverLocation + "user0=<UserName>&password0=<Password>&prompt0=" + reportgroup + "&prompt1=" + EntityList + "&prompt2=" + ShowDetail + "&prompt3=" + GroupOrder;


OR

window.location.href = serverLocation + "user0=<UserName>&password0=<Password>&prompt0=" + reportgroup + "&promptex-Prompt1Name=" + EntityList + "&promptex-Prompt2Name=" + ShowDetail + "&promptex-Prompt3Name=" + GroupOrder;

Good Luck!
 

The problem seem to have to do with Crystals intercepting the sqlstring. The conncetion is ok.

I recently upgraded to Crystal 8.5. Do I need to download some new include files?
 
I got same return. The page is passing the varibles to the report page but my script:

Code:
 session("oRpt").SQLQueryString = selectstring

doesn't seem to successfully pass the sql to the report.

I recently upgraded to Crystal 8.5. Do I need to upgrade any of the include files? If so where can I download the Alwayrequired, etc... files.

[bomb]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top