Checking for datasource changes failed
The "checking for datasource changes" failed error is usually caused by one of the following reasons:
1) The Server Name parameter passed to the session("oApp").LogonServer call is not the same server that is stored in the report. The LogonServer call cannot be used to tell the report to point at a different server at runtime. You can open the report in the Crystal Reports designer and go into the Database menu and choose "Set Location". Check to see what the "Server Name" is. That is what you pass in the LogonServer call.
2) You are not logging on to the database. Your ASP page that instantiates the report does not call LogonServer, or SetLogonInfo. If this is the case you should download Crystal Decisions demos. The file is simpxmps and is available at the following URL:
ftp://ftp.img.seagatesoftware.com/pub/crystal/crweb/simpxmps.zip.
Extract SimpleLogonServer.zip and SimpleSetLogonInfo.zip from this archive. Have a look at the .asp files (with the same name as the archive) for the code.
3) You are providing invalid logon credentials for the database. If the userid and password that you pass does not have sufficient rights to the database object (Table, View, Stored Procedure, etc.) this error will occur.
4) Oracle stored procedures. If you are trying to pass stored procedure values for an Oracle Stored procedure you will receive this error. This is because there is an issue with the CRPE32.DLL handling Oracle Stored Procedures. This is an issue in out Trackbase (Track ID: 8884) that is currently being fixed.
For an example on passing stored procedure parameters from ASP you can look at SimpleStoredProcParam.asp in SimpleStoredProcParam.zip (from simpxmps.zip)
ftp://ftp.img.seagatesoftware.com/pub/crystal/
crweb/simpxmps.zip
Simple Examples - How to set Subreport Locations
If you are looking at the SimpleStoredProcParam.asp or SimpleSetLogonInfo.asp, neither of these demos completely sets location or passes stored procedure parameters for a subreport. These are meant as demo apps to illustrate a concept, they are no means complete solutions to any particular issue.
For setting a subreport's database location you must open the subreport explicitly and then logon to the database server using SetlogonInfo. Or if the stored procedure is on the same server but in a different location.
Example:
set session("oSubRpt") = session("oRpt").OpenSubreport(SubreportName)
'Creates a subreport handle named session("OSubRpt")
set SubDatabase = session("oSubRpt").Database
'Creates a Database object for the subreport
set SubTables = SubDatabase.Tables
'Creates a Tables collection for the subreport database
set SubTable1 = SubTables.Item(1)
'Obtains a handle for the first table (or stored procedure)in the tables collection
'To set the location to a different server use:
Subtable1.SetLogonInfo "Server or DSN Name", "Database Name", "User ID", "Password"
'To set the location to a different location on the same server use:
Subtable1.Location "Database.Owner.Object"
'To set a stored procedure parameter for this subreport you would then use the following:
set SPParameters = SubDatabase.Parameters
'Create a collection of stored procedure parameters
set SPParameter1 = SPParameters.Item(1)
'set an object for the first stored procedure parameter
SPParameter1.value = "Parameter Value"
'set the value for the first stored procedure
Printing from Active Server Pages
If you want to print the reports directly to a printer when called from the web, you can do so using the automation server in Active Server Pages (ASP). If you are using the web report server (as in calling your reports directly via URL reference) then you will have to write some ASP code to instantiate the reports using Crystal Decisions COM interface (CPEaut32.DLL, Crystal Automation Server). For examples on ASP automation code you can go to Crystal Decisions's ftp site at:
ftp://ftp.img.seagatesoftware.com/pub/crystal/crweb/simpxmps.
It is important to note that since Active Server Pages run on the server, if you use the ReportObject.Printout method the report will print from the Web Server's printer. Using the ReportObject.SelectPrinter method you can specify a network printer. However NT prohibits services (such as IIS) to access Network resources. So if printing to a network printer from your ASP code is what you need to do, you will have to setup the network printer on the Web Server then follow the Microsoft Kbase on how to expose a network printer to a service (Article number: Q152451).
Looping Log On
This behaviour is usually caused when the authenticated Internet User making a request to a report does not have sufficient rights to access the database. A couple things to check for this are:
1) If you are connecting to your database through ODBC, are you using a System DSN?
The ODBC DSN must be a System DSN and not a User DSN for a report served over the web. This is because a User DSN is available only to the user that created it. It is unlikely that this user is whom your web server is authenticating. Ensure that the Web Server machine does not have a DSN defined under User and System with the same name.
2) Are you reporting from a PC database (such as Microsoft Access)?
The database file does not exist on the web server, or the path to that database is not valid. You should open the report in the Crystal Reports Designer and go into the database menu and choose Set Location. Make sure that the path to the database file is valid from the web server. This is also the case for ODBC connections, the ODBC DSN must spevify a path that is valid from the server. The path should be to a drive on the server.
Furthermore, the Web Server Application (IIS or Netscape) runs under an NT System account. System ccounts do not have Network access. So when the Crystal Web Report Server (CRpgsvr.exe) is launched by the Web Server Application, it too is running under the System account which does not have network access. If your database file is on a network machine you must launch the CRpgsvr.exe under an account that has network access, before calling reports.
To launch the page server manually first stop your web service. Next look in the Task Manager to see if CRpgsvr.exe is running. If it is, end the process (note that you can not end the process unless the web service is stopped). Then start the web service. Now launch the page server. Do this by browsing to the CRpgsvr.exe and executing it. Open a fresh browser instance and call the report.
To ensure that the page server is always launched under a valid account, you can add the CRPGSVR.EXE to the WINNT\Profiles\All Users\Start Menu\Programs\StartUp folder. This will launch the page server on boot up, no matter whom (what NT account) starts the NT machine.
Is your NT server an NTFS or FAT drive? If it is NTFS then it is possible that the anonymous Internet account (IUSR_Machinename under IIS) is being restricted from accessing your datasource, or the system account is restricted from a required directory. If your drive is NTFS, check the security for both IUSR_Machinename and the System accounts on your machine to see if the below mentioned MINIMUM required rights are in effect. If you are using Netscape Web Server then you will need to run the Web Server Services under a User account, that user account will need the same rights as IUSR listed below:
In the event that you are using NT Challenge/Response or Basic (clear text), the account that is authenticated by IIS must have the same permissions as does the IUSR account. One potential solution will be to create a group "Internet Users" in User Manager for Domains, grant access permissions the same.
Virtual Servers - App Mappings for Internet Information Server 4.0
To set up an ISAPI Application mapping for Virtual Servers do the following in the IIS 4.0 Internet Services Manager:
1) Right Click on the Virtual Server Website
2) Select Properties
3) Go to the Home Directory Tab and click the Configuration button
4) In the App Mappings tab, make sure that the "Cache ISAPI Applications" check box is checked.
5) In the listing ("Extension" and "Executable Path") you must have an entry for .rpt (referencing CRWeb.DLL) and .cri. (referencing CRImage.DLL). If you have these entries already then you do not need to do anything. If ,however, you do not see step 6. If you have multiple entries for .rpt and/or .cri you must remove all but one entry for .rpt and .cri.
6) Add the entries for .rpt and .cri by clicking on the Add button. In the Executable text box you must enter the fully qualified path and file name for CRWeb.DLL.
**Note that you can not browse to the CRWeb.DLL or CRImage.DLL using the browse button as the dialog will not accept long filenames. So the path must reflect the 16 bit long file name specification which is 6 characters, a tilde (~) and a one (1). Example: c:\progra~1\seagat~1\CRWeb.DLL
For CRWeb.DLL the extension is .rpt, for CRImage.DLL the extension is .cri. You should not type anything in the "Method Exclusions" text box. The "Script Engine" and "Check that file exists" should be unchecked.
7) Once the correct information is filled out, be sure to click the Apply button in the Application Configuration dialog.
8) Now right click on the virtual website and select "new" and "virtual directory". The directory should be named viewer and it should point to the \crweb subdirectory of the installed Crystal Reports directory.
9) Close the Microsoft Managment Console and when prompted to save settings made in the console, say Yes".
Printing page size and orientation from the Smart Viewer ActiveX
Problem:
When calling a report from the web server, the report is returned to the client browser in the Crystal Reports Smart Viewer/ActiveX. The report was designed in Crystal Reports for a particular page size and orientation, and displays in the correct orientation and page size in the Smart Viewer. But when the report is printed, it is printed in the default printer's default page size and orientation.
Resolution:
The reason that the Smart Viewer prints the report in the default orientation and page size is because of the encapsulated page format (epf) used by viewers. Crystal Reports uses a printer driver to create report pages, even for screen preview. Since the printer driver on the server (where the report page is created) is most often different than the printer driver on the client (where the report page is rendered) and that we require a printer driver to display a report page, the epf must be printer driver independant.
If an epf was printer driver dependant then it could retain the page size and orientation settings (as orientation and page size are printer driver dependant control codes), but the printer driver on the client would have to be the same driver as on the server. This is highly unlikely as even if the server and client have the same printer device, drivers for Win 3.1, are different from Win 95 which are different from Win NT. If the driver is different the report would display incorrectly if it displayed at all. Therefor, due to the distribution to varied client configurations we must use the printer driver independant method employed in the epf specification.
Thus to print a report in a page size or orientation other than the printer's default, from the Smart Viewer ActiveX, you must change the print properties in the viewer to print the report in the desired orientation or page size.
Retaining the page size and orientation in epf is currently an enhancement request. However this is difficult due to the driver dependant nature of orientation control, so the enhancement request is still in Research and Development.
6.0 Smart Viewer/ActiveX truncates objects on the report
Problem:
When previewing a report over the web in the Smart Viewer/ActiveX, report objects are being truncated.
Resolution:
When a text object was modified to include an indented margin (leaving space between the edge of the text object and the text)the text object was no longer being truncated. To add an indented margin to the text object, double click on the text object and modify the top guideline in the text object's ruler bar.
For field objects, the field borders can be stretched and the actual data can be centered within field borders.
How to Auto Refresh the report from the Crystal Web Report Server
The Crystal Web Report Server components (CRWeb.dll and CRpgsvr.exe) were designed to serve report pages from the server's cache if a report was requested a subsequent time.
This would result in a subsequent request for a report returning the previous requests's report data from cache. Even when passing new selection criteria (using the sf query string parameter) or new parameter values (using the prompt# query string parameter). The only way to get the new report data was to click the Smart Viewer's refresh button (Lightning bolt icon) after the subsequent report request was completed.
To allow for "automatic" refreshing of the report data directly from the URL request, a query string parameter (rf=1) was added. Now, if you do not want the report to be served from the cache, you can add the rf=1 parameter to the URL request, forcing the report to re-read the database and return the new data. If calling a report a subsequent time, passing new selection or parameter criteria, you must use the rf=1 parameter for the report to return with updated data.
*Note that you must have CRWeb.DLL and CRpgsvr.exe version 6,0,0,125 or higher. If you do not have this version of the web reporting components you can download them from:
ftp://ftp.img.seagatesoftware.com/pub/crystal/crweb/rptservr.zip
Installation instructions are contained in the readme.txt
Here is an example URL:
http://Domain/Directory/Report.rpt?rf=1&prompt0= Value&user0=userid&password0=password
The automatic refresh parameter (rf=1) only works with the Smart Viewer ActiveX and Smart Viewer Java. In order to get the HTML Frame and HTML Page viewers to automatically refresh on a subsequent call to a report (defining new parameters or selection criteria) you need to use the query string parameters: cmd=rfsh&vfmt=html_page&viewer=html_page&page=1
When you include these parameters in your request, the report will automatically refresh against the database with the new selection or parameter criteria. Note that when using these query string parameters you do NOT have to specify the viewer using the init=html_page or init=html_frame parameters. Also note that if using the HTML_Frame viewer you must pass this value for the vfmt and viewer parameters.
Here is an example URL:
http://Domain/Directory/Report.rpt?cmd=rfsh&vfmt=html_
page&viewer=html_page&page=1&prompt0=Value&user0= userid&password0=password
Error encountered by Crystal Report Web Engine - Unable to load report
Using IIS 4.0 running any report from the url results in the above error message.
· Launch Microsoft Management Console.
· Go to Default and right mouse click.
· Choose properties.
· Choose Home dir.
· Click on the Configuration button.
· Under the first tab called APP MAPPING make sure that the reference to .cri and .rpt is only in that list once. If it’s there multiple times remove all but 1 instance of it, click on the Apply button.
· Exit the Console and Save changes.
· Close down the browser. Go into control panel and Internet services. Stop the WWW service then restart it and re-launch the browser. May need to reboot the system. Now everything should work fine.
Prompted for SAVE TO DISK using IIS 4.0 when calling a report via the URL Command line.
Ensure that the Virtual directory your reports are stored in has both Read and Execute rights. Verify that there is only one entry of the .rpt and .cri in the ISAPI Extentions. See article in this document entitled "Virtual Servers – App Mappings for Internet Information Server 4.0" Check in the registry under
HKEY_LOCAL_MACHINE\System\CurrentControlSet\
Services\W3SVC\Parameters\ScriptMap
make sure that both .rpt and .cri exist and the path is pointing to the location of the CRWEB.DLL and CRIMAGE.DLL on the machine.
· Go to the Management Console. Start|Programs|NT 4.0 Option Pack|Internet Information Server|Internet Service Manager.
· Right Click on the Web Site that you are using. The default is Default Web Site.
· Choose Properties.
· Click on the Home Directory tab, configuration button, within this dialog, right at the top, there is an option that states "Cache ISAPI Applications" make sure this is checked on. In the middle of this dialog there will be the instances of .rpt and .cri, if more than one entry remove all but one occurrence of each extension.
NOTE: If there are NO ENTRIES within this dialog box you will need to add them. See the article above.