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

How to change HTML viewer to ActiveX?

Status
Not open for further replies.

chenkang

Programmer
Jan 22, 2002
20
0
0
US
Hi,

We have a project use CE 9 as web reporting. For some reason (it's a long story), we can't use pageserver, and have to use jobserver schedule report first, then return the instance back to client browser.

I try to use "CrystalReports.CrystalReportViewer" to show the report, below is the sample code.

Everything works fine, however, the viewer is a HTML viewer, I want to use the ActiveX viewer. Any ideas?

Thanks a lot for your help.

Kang

'#######################################################
Dim viewer1, sf, rptSrc, rptSrcFactory
Set rptSrcFactory = oIStore.EnterpriseSession.Service ("", "PSReportFactory")
set rptSrc = rptSrcFactory.OpenReportSource(CDBL(NReportID))

EnsureImageCleanerIsRunning()

set viewer1 = Server.CreateObject( "CrystalReports.CrystalReportViewer" )

viewer1.ReportSource = rptSrc
viewer1.IsOwnForm = true
viewer1.IsOwnPage = true
viewer1.IsDisplayGroupTree = true
viewer1.PageToTreeRatio = 5.0
viewer1.IsDisplayToolbar = true
viewer1.IsDisplayPage = true
viewer1.HasRefreshButton = true
viewer1.URI = CStr(Request.ServerVariables.Item("SCRIPT_NAME")) + CStr(Request.ServerVariables.Item("PATH_INFO")) + "?init=actx&"
viewer1.URI = viewer1.URI + Request.ServerVariables.Item("QUERY_STRING")

viewer1.ProcessHttpRequest Request, Response, Session
'#######################################################
 
Hi,
try moving the viewer type spec to the end of the
viewer1.URI = viewer1.URI + Request.ServerVariables.Item("QUERY_STRING")statement and move the ampersand.

So:
Code:
  viewer1.URI = CStr(Request.ServerVariables.Item("SCRIPT_NAME")) + CStr(Request.ServerVariables.Item("PATH_INFO"))
  viewer1.URI = viewer1.URI + Request.ServerVariables.Item("QUERY_STRING")+ "&init=actx"

Haven't used that method to call a report so this may not help, but it should..

[profile]


 
If you are still using CE9 in some areas you may need to change the default viewer within CE itself.

To change the default viewer to the ActiveX Viewer, this code must be added to the reportviewer.csp found in:

X:\Program Files\Crystal Decisions\Web Content\Enterprise\ePortfolio\en

· Where X is the drive letter where Crystal Enterprise was installed.

In the function GetViewer(), put the viewer value to be zero. For example:

vwr = Number(vwr);

vwr = 0;
 
Thanks a lot for both of replies!

However, both method don't work. :-(

I think AmunRa's answer is for view report by using " viewrpt.cwr", but in our case, we use "CrystalReports.CrystalReportViewer" because we want to customize the viewer for different report.

I know instead of "CrystalReports.CrystalReportViewer", we can use "CrystalReports.CrystalReportInteractiveViewer" for DHTML viewer, is there any other object specific for ActiveX viewer? such as "CrystalReports.CrystalReportActiveXViewer"?

Anybody knows if CE have any document for this?

Thanks a lot.

Kang
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top