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

Determining table and field of parameter

Status
Not open for further replies.

BobHuk

MIS
May 12, 2004
8
GB
How do I find out the table and field name of the source of values in a parameter list? I need to determine the source of the values in the parameter list for each parameter in a parameter fields collection. Looking through the developer help file I can't find any properties that expose this, so is there anyone on here who has managed to discover how you can access this information?
 
Perhaps, but you should post what version of Crystal and how you are using Crystal (from VB using the RDC, Mr. Mustard with a pipe in the library, or...).

-k
 
Sorry about the lack of information I posted last time. I am using vbscript to interrogate the parameter fields collection in ASP code for Crystal Reports v11. However, the only information I can get about the collection is from the developer help file with CRv11, and this doesn't show any properties that expose the actual source of the data for each parameter list. It shows the parameter name, and the type of data for each item, but does not show where the data came from. What I need is the data table and field names so that if no default values have been supplied from within the report, I can build in-line sql queries to go to the database and collect all values from the same field for display in list boxes on the ASP forms.
 
If you are using SQL enterpise you can go under tools and choose profiler. Start a trace then execute the program that your are using to send parameters to Crystal with.

Profiler shows you database calls being made and you can see exactly what tables and records are being pulled.
 
FlashOverX,

Thank you for your answer. Unfortunately the whole idea is that the ASP code will interrogate a report when it is called, and find out what parameters are in its parameter fields collection. When using static parameters, lists of default values are stored within each parameter field within the collection, and these can be iterated through, and presented in a list on the page for the user to select from.

However, if the report has dynamic parameters then no default values exist in any of the parameters, so it is necessary to query the database to fill the parameter lists that will be displayed to the user when the report is run. This happens automatically when you run a Crystal v11 report with dynamic parameters through Crystal itself, or through the Reports Server, but when using the ActiveX plugin to run the report through ASP code it doesn't.

It is for this reason that I need to discover which table and field each parameter gets its information from. The problem is that this needs to be done dynamically for each parameter in the list, and within the ASP code, so outside programs such as SQL Enterprise can't be used, as the back end database could be anything from Access to DB2.

So far I have been interrogating properties exposed in the parameter fields collection to get the name of the parameter, its data type, and any default values it may have, but as I said earlier this only works with static parameters. Although I am using Crystal Reports v11, the parameter fields collection does not seem to have been updated to expose properties such as data table and field, so when dealing with dynamic parameters my ASP viewing program won't work correctly.

That is why I have posted my original question, does anyone here know if the table and field properties of each parameter are exposed anywhere in the report object, either within the parameter fields collection, or within any other sub set of properties for the report?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top