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

Dynamic Pick lists into report parameters in CE 1

Status
Not open for further replies.
Oct 23, 2002
7
GB
Hi,
I need to be able to put dynamic pick lists against many of our Crystal Reports being run through Crystal Enterprise 8.5. I am aware of the ability to do this through customised .csp pages, but most of our reports are run via On-Demand reporting hence .csp page development is not really an option. Does anybody know/or has put Dynamic pick lists either directly into Crystal Reports somehow or know of a way to modify/customise the parameter pick lists in the on-demand reporting part of CE.

Any help or suggstions on this would be much appreciated.
 
On our project, we have a Weblogic app server for the database our Crystal Reports hit. Using the business logic in the EJBs, we wrote JSP web pages to build parameter pick lists for users to select the parameters they wish to open reports with. When they submit the HTML form, the JSP builds the URL to open the report on CE, populating the values of each parameter (prompt0=xyx&prompt1=abc&...). Search the Crystal support site for documentation on the URL commands to the CE Web Component server. Note that you can still open reports directly via a URL if they're managed, you just have to provide the APS ID of the report instead of the report filename in the URL.
 
I have managed to do this by adding some code to the parameter.csp page. A paremeter is given a specific name in the report itself and the code in the csp file looks out for this - if it finds it it goes off and reads lines from a text file which I have created and populates the pick list with this data.

I have also got one working which gets live data from a database via an SQL query and fills a pick list with it. All of the reports that use this method are on-demand.

Is this the kind of thing you're looking for?
 
Sea Monkey
How did you get
"I have also got one working which gets live data from a database via an SQL query and fills a pick list with it. All of the reports that use this method are on-demand
"

to work?
Any help would be greatly appreciated?
Regards - James
 
Sea Monkey

Would you be willing to share your discoveries?

thanks

Icytrue
 
No probem,

Here is the code that I have used to build a pick list from a text file. This is a simplified version to give you the idea, and is incorperated in the parameter.csp file. All you need to do then is to name a report pramater "Get_list" and the code will fire...

<%
Set MyParametersCol = MyPluginInterface.ReportParameters
For each MyParameter in MyParametersCol
ParaName = MyParameter.Parametername
If ParaName = &quot;Get_List&quot; then

Response.Write(&quot;<SELECT NAME='&quot; & ParaName & &quot;' SIZE=1 ALIGN=LEFT>&quot;)
Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set FileRetrieved = fso_OpenTextFile(&quot;E:\Program Files\Seagate Software\Web Content\Pick Lists\ListFile.txt)

Do While Not FileRetrieved.AtEndOfStream
Response.Write(&quot;<OPTION>&quot; & FileRetrieved.ReadLine & &quot;</OPTION>&quot;)
Loop

Next
%>

The actual code that I have used is more flexable in that the file name that it should extract the information from is given within the paramater name itself.

You can easily use the same principle for getting a list from a database but at the moment I have mislaid the code ! I never used it as it is obviously a lot quicker to extract a list from a text file then logging on to a database everytime. An overnight SQL recreates the text files every day so they are always up-to-date!

Hope that helps.
 
Does anyone have any code samples for dynamic pick lists that will work with CR9 and RAS9? The code sample in this thread uses csp pages. I would really like to see an example that uses the asp pages in RAS9.
 
Woa ! You've just scared me. Are you saying that csp pages are definately NOT supported in version 9 software. Surely this can't be true - it would prevent me, and anyone else who has gone down this route, from ever continuing on an upgrade path.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top