Advertisement

09.21.2000 at 10:04AM PDT, ID: 11340717
[x]
Attachment Details

call crystal report from asp--help please!!

[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0
Hi,

After I installed microsoft personal web server in my machine, I developed a web application using asp technology. Now I am tring to display a crystal report from an asp page by performing the following steps:

1. install Crystal Report 8.0(complete version) in my machine;
2. create a crystal report and put the report(name: RptInventory.rpt)  in the same website home directory;
3. "call" the report using the following code.

However it does not work. Could anyone tell me why? Do I need to do something else except the above steps?

Any response is highly appreciated!

Lina


reportname="RptInventory.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                                                    

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

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

session("oRpt").DiscardSavedData

set session("ParamCollection") = Session("oRpt").Parameterfields                  
'set Param1 =  session("ParamCollection").Item(1)
'set Param2 =  session("ParamCollection").Item(2)
'ParamValue = Request.Form("SelectedCountry")
'Call Param1.SetCurrentValue (CStr(ParamValue), 12)
'ParamValue = Request.Form("TitleString")
'Call Param2.SetCurrentValue (CStr(ParamValue), 12)

On Error Resume Next                                                  
session("oRpt").ReadRecords                                            
If Err.Number <> 0 Then                                                
  Response.Write "An Error has occured on the server in attempting to access the data source"
Else

  If IsObject(session("oPageEngine")) Then                              
   set session("oPageEngine") = nothing
  End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
%>


<HTML>
<HEAD>
<TITLE>Seagate ActiveX Viewer</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript ONLOAD="Page_Initialize">

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

<SCRIPT LANGUAGE="VBScript">
<!--
Sub Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
if ScriptEngineMajorVersion < 2 then
window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
CRViewer.ReportName = "rptserver.asp"
else
Dim webSource
Set webSource = CreateObject("WebReportSource.WebReportSource")
webSource.ReportSource = webBroker
webSource.URL = "http://eugtrip1/aspxmps8/test/CrystalQueryReports/rptserver.asp"
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
</html>
Answered By: shahzad73
Expert Since: 06/20/2000
Accepted Solutions: 25
shahzad73 has been an Expert for 8 years 6 months, during which he has posted 350 comments and answered 25 questions. shahzad73 is just one of 785 experts in the Crystal Reports Software Zone. 1 expert collaborated on this answer, which was graded an "A" by the asker.
 
 
20081119-EE-VQP-48