Click to See Complete Forum and Search --> : Problem with displaying crystal reports from ASP


ss_learner
11-13-2005, 09:28 PM
Hi there,
Can anyone pls help me out!!
I am stuck and not able to find any way out..
I have created a crystal report called testreport
and I am calling it from ASP

I need to pass the sql query from asp to crystal reports which I did..
And when i try to open the report then its showing the error

Error Occurred Reading Records: Server has not yet been opened.

but I am able to open the report through crystal reports and view the results in the preview pane..
Please help me out, I am a kind of new to using crystal reports esp from ASP.
I am pasting my sql query down

SelectClause = " SELECT DISTINCT view_icnotequal.""deptic"", view_icnotequal.""Name"",view_icnotequal.""AttdIc"",view_icnotequal.""dept_code"""
FromClause = " FROM view_icnotequal ""view_icnotequal"""
WhereClause = " WHERE view_icnotequal.""attd_date"" >= '"&vfromdate&"' and view_icnotequal.""attd_date"" <='"&vtodate&"'"
OrderClause = " ORDER BY view_icnotequal.""dept_code"",view_icnotequal.""name"""


NewQueryString = SelectClause & FromClause & WhereClause '& OrderClause

Response.Write cStr(newquerystring) & "<br>"
'These lines of code build the new SQL Query String for the report.
session("oRpt").DiscardSavedData
session("oRpt").SQLQueryString = CStr(NewQueryString)

Thanks in advance
Regards