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

Passing Varibles from ASP to Crystal 9

Status
Not open for further replies.

hodgesp

Programmer
Apr 21, 2004
32
US
I have an asp page that I use to define a sql statement that I pass to a crystal report via the SmartViewerActiveX.asp on another page. The report works fine and responds correctly, displaying the data based on the selection criteria I input.

The fields pick up the correct data elements and obviously the report is seeing my sql selection statement.

The issue is; I would like to pass the selection criteria, itself, via stringvar to a crystal variable so I can display the selection criteria in the report header.

How do I do this? [bigglasses]



 
This would be an ugly hack.... but suppose you have this SQL:
SELECT *
FROM myTable
WHERE (myField = 'whatever')


What if you could do this instead?
SELECT [red]myTable.*, 'fakeFieldString' as FakeField[/red]
FROM myTable
WHERE (myField = 'whatever')



I don't understand what you are trying accomplish...
 
What I'm trying to do is use the sql statement in a variable in crystal to display the selection criteria in plain english so I can display it in the report header. That way management will know what the report is displaying.
(rememeber they need all the help they can get)

Just for end-user information and to clarify what selection criteria was use for the report.

For example if I generate a SQL statement:
Select TrackingNumb from IssuesTbl Where TrackingNumb='1234'

I would like to be able to pass that statement into a crystal varible that I can manipulate to display something like this in the Crystal report header:
Tacking Number = '1234'

[wiggle]
 
If you can edit both the ASP and the report then you could do that thing I was suggesting. There is probably a better way but I can't think of it right now.

Something like:
Select TrackingNumb, 'By Tacking Number' As English_Explanation
from IssuesTbl
Where TrackingNumb='1234'
 
Bummer, that didn't do it.

The problem is that the sql statement or ASP variable select string which I use to query the database is a virtual variable and doesn't correspond to any database table field object.

I need to pass the value of this
session("oRpt").SQLQueryString = selectstring

into a variable in crystal so I can display it as a report object.

In 8.5 I could see the SQL string under the database menu option. However, I have just upgrade to 9 and it doesn't seem to have that option any longer.

I know the report sees it, otherwise it would fail in the viewer. But how do I capture the string so I can display it in the report as a sepreate report text object in Crystal?

[flip]




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top