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!

sql connection

Status
Not open for further replies.

JKingdom

Programmer
May 9, 2004
141
AE
can some one guide me through connecting crystal report to sql server .. i have the reportwiz.msi .. but am not sure what way to use ..

i created a report first through ODBC .. now do i have to use the ADO way of connecting in the asp page ?? or no need ...

what i need is(to create a report depending on 2 tables [group and details]..from an sql server located on the server not my PC ..

the report is working fine when i open it directry but it gives me error when opening it through the asp page ..

///////////////////////
Error Occurred Reading Records: The table '' could not be found.
//////////////////////
 
Hi,
Need more info:

What version of CR?
What method are you using to call that report in your asp page?
Have you read the docs or the asp samples from the Business Objects site?( I would provide a link but it is very version-dependent)







[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
i have CR10 and i have 8.5 as well ..

am using the samples provided in reportwiz.msi .. but am not sure if am doing it the right way .. and whether i need to specify the DSN in the page as well ..

this is my code:
///////////////////////////

reportname = "deptEmp2.rpt"


If Not IsObject (session("oApp")) Then
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application")
End If

Path = Request.ServerVariables("PATH_TRANSLATED")
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend

If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End if

On error resume next

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

If Err.Number <> 0 Then
Response.Write "Error Occurred creating Report Object: " & Err.Description
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
End If

session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False
session("oRpt").DiscardSavedData

session("oRpt").RecordSelectionFormula = CStr("{dept.dept_Id} =21")

On Error Resume Next

session("oRpt").ReadRecords

If Err.Number <> 0 Then
Response.Write "Error Occurred Reading Records: " & Err.Description
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
Else
If IsObject(session("oPageEngine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
//////////
then open it in the browser through SmartViewerActiveX.asp



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top