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

Crystal Viewer won't display report due to subreport with Access table

Status
Not open for further replies.

jmooney2

Technical User
Feb 24, 2004
1
US
I created a Crystal 8.0 report that references an Oracle database and an Access database that works just fine within Crystal. However, when I try to create an HTML file to run that report Crystal Viewer gets hung up on the Access connection. What is the trick?

I'm guessing I need to tell Crystal to make a connection to Access but I don't know how. Below is the code to fire the rest of my Crystal Reports from a web page (which don't use any Access tables). This particular report has a few other subreports connecting to the same database as the main report which works fine.

My problem is with a Crystal subreport called "Budget" which uses a table from an Access database with the path "//Server1/Data/Share/Budget.mdb" and table name of "tblBudget_Allocation". There is no security on the Access database.

Someone else set up the VB(?) code and I just enter the new report location and create a new link to this HTML file. I don't know VB so I'm hoping someone can give me a line or two of code where I can enter the Access database location in a way that will keep Crystal Viewer happy.

Any ideas? I looked all through this web site but couldn't find the answer.

Thanks,

John

Code:
<html>
<head>
<TITLE>Crystal Report Viewer</TITLE>
</head>
<SCRIPT LANGUAGE="JavaScript">
</SCRIPT>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript>

<OBJECT ID="CRViewer"
    CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
    WIDTH=100% HEIGHT=95%
    CODEBASE="/viewer/activeXViewer/activexviewer.cab#Version=8,0,0,371">
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=0>
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
<PARAM NAME="EnableSearchExpertButton" VALUE=0>
<PARAM NAME="EnableSelectExpertButton" VALUE=0>
</OBJECT>

<SCRIPT LANGUAGE="VBScript">
<!--

Sub window_onLoad()
	Page_Initialize()
End Sub

Sub Page_Initialize
    On Error Resume Next
    Dim webBroker
    Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
    if err.number <> 0 then
        window.alert "The Seagate Software ActiveX Viewer is unable to create it's resource objects. To rectify this problem, please install Internet Explorer 4.0 or install DCOM for Windows 95 and the latest Microsoft Scripting Engine. These files are available at Microsoft's web site."
        CRViewer.ReportName = "[URL unfurl="true"]http://Server1:80/CRYSTAL_REPORTS/RPT[/URL] Files/Cost Report.rpt"
    else
        Dim webSource0
		Set webSource0 = CreateObject("WebReportSource.WebReportSource")
		webSource0.ReportSource = webBroker
		webSource0.URL = "[URL unfurl="true"]http://Server1:80/CRYSTAL_REPORTS/RPT[/URL] Files/Cost Report.rpt"
		webSource0.PromptOnRefresh = True

		webSource0.AddParameter "user0", "Report"
		webSource0.AddParameter "password0", "ReportPassword"
		
		webSource0.AddParameter "user0@Plan Lab Details", "Report"
		webSource0.AddParameter "password0@Plan Lab Details", "ReportPassword"

		webSource0.AddParameter "user0@Plan Mat Details", "Report"
		webSource0.AddParameter "password0@Plan Mat Details", "ReportPassword"
		
		CRViewer.ReportSource = webSource0
    end if
    CRViewer.ViewReport
End Sub

-->
</SCRIPT>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top