Advertisement

06.06.2004 at 07:35PM PDT, ID: 21015420
[x]
Attachment Details

Question about ASP + CR10

[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!

7.6
I'm just starting to use ASP + CR10 to develope a web application.
I'm using the "Crystal ActiveX Report Viewer Control 10.0" to view the report on the browser.
I have some question about CR10.

------------------------------------------------------------------------------------------------------------
Question 1:
I found 2 different file for the "WebReportSoruce" Object.
The 1st is "RDCrptserver10.asp", the 2nd is "rptserver.asp"

Dim webSource
Set webSource = CreateObject("CrystalReports10.WebReportSource.1")
webSource.ReportSource = webBroker
webSource.URL = "RDCrptserver10.asp" OR "rptserver.asp"    <--- Here!!

I found that when using RDCrpserver10.asp the code for create crystal report object is:
  --> Set session("oApp") = Server.CreateObject("CrystalRuntime.Application.10")
when using "rptserver" the code is:
  --> Set ObjFactory = CreateObject("CrystalReports10.ObjectFactory.1")

a) What is the different between two way to create the CR object?
b) Why have two different way?
c) Which one is better?

------------------------------------------------------------------------------------------------------------
Question 2:
I'm currently to use the RDCrpserver10.asp to develope the Web Application.
I have two different Databases (development & production), how to set the database at runtime?

I have the code for this, but seem cann't work:

*****************************************************
' CREATE THE APPLICATION OBJECT
If Not IsObject (session("oApp")) Then
  Set session("oApp") = Server.CreateObject("CrystalRuntime.Application.10")
End If

If IsObject(session("oRpt")) then
  Set session("oRpt") = nothing
End if
      
Set session("oRpt") = session("oApp").OpenReport("C:\Inetpub\wwwroot\test\" & reportName, 1)

' Creates the Database object
set ReportDatabase = Session("oRpt").Database
      
' Set logon information for each table in the report
Set dbTables = ReportDatabase.tables
For Each dbTable in dbTables
  If Right(Server.MapPath(".\"), 5) = "\test" Then  ' Testing folder
    dbTable.SetLogOnInfo "xx.x.x.xx",  "dbTest", "sa" , "pwd"    ' Testing DB
  Else
    dbTable.SetLogOnInfo "xx.x.x.xx",  "dbProduction", "sa" , "pwd"  ' Production DB
  End If
Next
*****************************************************

The report's data is come from production Database even i am using the testing web page to generate it.
Why?
How to set the report database dynamically?

------------------------------------------------------------------------------------------------------------

Pls advice!
Thank you~~~

Hero
Answered By: jcurrie
Expert Since: 10/09/2003
Accepted Solutions: 21
jcurrie has been an Expert for 5 years 3 months, during which he has posted 101 comments and answered 21 questions. jcurrie is just one of 785 experts in the Crystal Reports Software Zone. 3 experts collaborated on this answer, which was graded an "A" by the asker.
 
 
20081119-EE-VQP-47