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!

Viewing Reports in Crystal Enterprise 8 via ASP created URLs

Status
Not open for further replies.

InShadows

IS-IT--Management
Jul 7, 2000
36
0
0
US
I have created a few ASP pages to interact with Crystal Enterprise. I used their white paper entitled URL Commands for the Web Component Server for Crystal Enterprise 8.0. The resulting URL that I am sending is viewrpt.cwr?id=745&init=actx:connect&apsuser=username&apspassword=password&apsauthtype=secEnterprise&promptOnRefresh=0&promptex-AGENCY="CSB"&promptex-PROGRAM="ChildCare"&promptex-CA%20ASSIGNED="lboone"&promptex-DATE=["Date(2001,2,25)"-"Date(2007,6,30)"]

this sequence brings up the report but not with the selected parameters. It's defaulting to the first time the report was run successfully. I have also tried inserting the report name where viewrpt.cwr is and removing the id=745 and came up with invalid filename. If I reinsert the id=745 with the report name then it defaults to the aforementioned action. Likewise it will default to the same page no matter what my filename is. It could be asdfasdfasdf.rpt and as long as that id=745 is there then it accepts it and displays the report's first successful run. We also tried the promptex0 and prompt0 methods for parameters, but to no avail.

What needs to be done either on my ASP side or on the Enterprise side that will relay to the server that I wish to reestablish my parameters with the ones mentioned and execute the query and display the results?
 
I have used URL syntax, but have only used it in running reports with the default "Guest" logon that you do not need to include in the URL. Here is a sample URL that I have been using on various reports:

href="="_blank">

I did noticed in your example that you didn't use any decode values for the backets ([) or double quotes (") that surround your date range prompt. The decode values are "%5B" = left bracket ([), "%22" = double quotes (") and "%5D" = right bracket (]). I did have problems until I made these changes to my date range prompt syntax. I hope this helps.
 
Thanks for your help. I added in the decode messages and tried it out to no avail. I then changed it back to the rpt extension and pushed the file over into that specified directory. It's now giving me a Cannot connect to SQL error. It's not a SQL database but an Oracle database and we are using OLE DB connection and an ODBC connection.

Is there something wrong with that?

Should I be using the crystal/enterprise/ePortfolio/en/reportname.rpt file or should I be using the crystal/enterprise/ePortfolio/en/viewrpt.cwr?? What is the correct directory structure/filename for the reports?

Should I be using the ID parameter as mentioned in page 3 of the Crystal URL Commands for the Web Component Server?

Below is a copy of the new URL: crystal/Active%20Contracts%20by%20Department%20and%20Program%20cr01.rpt?user-asdf.crystal=username&Password-asdf.crystal=password&init=actx:connect&apsuser=user&apspassword=password&apsauthtype=secEnterprise&promptOnRefresh=0&promptex-AGENCY=%22ALL%22&promptex-PROGRAM=%22ChildCare%22&promptex-CA%20ASSIGNED=%22lboone%22&promptex-DATE=%5B%22Date(2001,2,25)%22-%22Date(2007,6,30)%22%5D
 
Last question, I hope. Does the client version of Crystal Reports have to reside on the machine that the person is viewing the reports from? We were told no and that's why we have Crystal Enterprise but it seems that when I click on refresh it only asks for a new date parameter and nothing else even though we do not have the promptonrefresh command in the string.
 
I've had the most luck using the Managed Report solution. Here is an example of the URL I've used. Notice the variables are in a slightly different order:

viewrpt.cwr?id=1917&apsuser=user&apspassword=pass&apsauthtype=secEnterprise&init=actx&user0=dbuser&password0=dbpass&promptex-@param1="6224"&promptex-@param2="NULL"

viewrpt.cwr?id=745&init=actx:connect&apsuser=username&apspassword=password&apsauthtype=secEnterprise&promptOnRefresh=0&promptex-AGENCY="CSB"&promptex-PROGRAM="ChildCare"&promptex-CA%20ASSIGNED="lboone"&promptex-DATE=["Date(2001,2,25)"-"Date(2007,6,30)"]

The ActiveX viewer should be sufficient, no other software should be needed on the client if you are using a browser. By the way is it IE? You might play around with the Java browsers if you have time.
 
w00t!! It works. Thank you SomeHelp and PeteytheSnake for your help. It ended up that the db call was calling an incorrect server. I was linking directly into the server instead of calling the server where CE resides and then using the odbc connection on that server to call up the db. now comes the fun stuff of hiding the connection information from the client.

thanks again.
 
If they always use the same database connect for the report, just set it in the Management console. You won't have to send that information to get the report to run unless you want to change it for some reason.

Lisa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top