I'm using the Crystal Reports add-on to Visual Studio. The report calls a stored procedure with a whole list of parameters. I added an int parameter to the stored procedure, now I want to make the crystal report pass a 1 for that parameter.
How do I do that? When I go to database expert > Selected Tables - it just shows the name of the stored procedure. Where does it list the parameters?
If you already created the report and added the parameter to the stored procedure after that you need to use "Verify Database" to get the parameter to the report
Related
I am trying to debug missing data in an existing report.
I see the database it is connected to, but I do not find any table or stored procedure or view in that database with the same name that I see in the record selection part of the Crystal Report.
Is there a way to find which table/view/stored procedure is used as input for the Crystal Report?
Thank you
Never mind. I found it. Rt click on Database Fields and select Set Datasource location...
You need to set up first what type of connection you need.
This will help you using ODBC connection.
Ideally you can set this when first time confiugre the data, but suppose if you update the table or procedure and that will not impacted in your crystal report.
To update the updated db element / object in crystal report, simply "Update datasource" option click which pull the changes and update in crystal report.
May be helpfull in future.
Hello: I am trying to run crystal report 10 report from command line (and I'm new to crystal). The report has two date parameters ?from and ?to. I can query a different database to get the ?from and ?to parameters. So what I'm trying to do is get rid of the external parameters by generating the dates from within the report to replace/populate ?from and ?to.
Can I somehow add a sub-report to query Oracle to get the ?to and ?from dates? This new sub-report would need to run first since the other four reports (3 subs and 1 main report hitting SQL server) all use these date parameters?
Thanks for any help.
To the extent I know, Whether you use sub report of main report if a user needs to enter his own parameters to query the database then you need to create external parameters
Edit------------------------------------------------------------------------------------------------
Since you are trying to get the date input from different database... your approach is correct to create a sub report for this.
Make sure to place the sub report first in order from where you are taking the values.
Either use a shared variable or through parameter linking get the date values to main report and pass the values to remaining sub reports through linking option in sub report links.
Crystal Version - Crystal Reports 2008 Business Objects - XI
I have written a query to populate a subreport and want to pull in a parameter to that query based on input from a user. My question is, what is the correct syntax I need to put in the first line of the 'Where' clause to accept the parameter?
I created a parameter in Add Command it is called PickDate
Here is the query I am using in Crystal Reports:
select
table2.book_no,
table2.time_stamp,
table2.restdate,
a.timestamp,
a.event_type,
a.status,
a.people,
a.new_date,
a.comments,
a.operator_id
from table1 a, table2
where table1.book_no = table2.outage_no
I have tested the query, it is pulling all the data, now I just need help adding parameter to prompt user to enter datatime.
Did you try using the Select Expert in the subreport? You should be able to say field = {?PickDate}
I'm using Crystal reports designer Version 11.
I have a report which calls a subreport and I have set up linked parameters.
The subreport is using a stored procedure.
I can't see how I feed to the parameters passed to the sub report into the stored procedure that is returning the data.
This is really late to the party, but I'm researching the same problem (I think) and have found a solution. In the main report, right-clck on the sub report and "Change Subreport Links".
In the top section, choose your parameter in the main report and click the right arrow to add to the "Field(s) to link to". In the bottom, sub-report section of the window, change the left side "Subreport parameter field to use" drop-down. It defaults to creating a new parameter in the sub report and you don't want to do that. You want to use an existing paramter (that was automatically added by using the stored procedure). In the drop-down choose that parameter that was auto created by the stored procedure.
Doing this means that you can have a parameter in the main report that you can automatically pass to the subreport which means you don't have to enter the same value for two separate parameters.
I hope this helps. It works great for me.
I understand this question is old but have found no satisfactory answer elsewhere. The simple solution I found is to implement the stored procedure from within a crystal command just like any other command sql. I could not get the parameters to show up in the bottom left drop downs no matter what. Something similar to below where ZNG_PROACTIVE_STREET_SWEEPS is the name of the stored procedure and the two parameters are what the stored procedure takes in.
[dbo].[ZNG_PROACTIVE_STREET_SWEEPS] #StartDate ={?begindate}, #EndDate = {?enddate}
After considering and then some searching, I take back my original answer.
Once you have parameters defined for the SQL Command, they are visible/available as parameters from outside the report. When you set up the links from the calling report to the subreport, the subreoprt parameters will be visible and available and you can link fields from the main report to those parameters.
A recent post in someone's blog covers the same activity with subreports driven from SQL Commands
Using SQL Commands and Parameters
I hope this helps and I hope that my original answer did not negatively affect your progress on your report.
Original answer
You cannot pass parameters to a stored procedure from report objects. The stored procedure will respond to CR Designer when you first reference the SP when you define the report. CR creates links to stored procedure parameters from the data source interface only, not from the report.
You will see an entry in the Parameters objects, but it will be read-only -- you can place it in the display section, but you cannot set it from report formulas, passed values, etc. Using formulas to process data before calling the stored procedure will not work, nor will trying to pass data through subreport links from the main report.
Using other design tools, you can have code that controls the data source interface, and processes data that is passed in parameters, but in CR Designer, you are pretty much left with the bare minimum options. You can right-click on the parameter and do things like set default values, set prompting text, set a pattern / mask for the format, but that's about it.
I have created a report which links into subreports. I created parameter fields to feed into the parameters of the subreports using subreport links.
If I do not add a subreport link and therefore the subreport is prompting for the value directly it will allow the set to null option. However, if the enter value prompt is being generated from the parameter field I inserted then the set to null option is not displayed.
I have 12 subreports so I can't prompt for the same values 12 times.
I am using Crystal Reports XI designer and not .net
set up formulas with nothing in them (null values) to pass to the subreports
In XI, I've only seen the 'Set to Null' option when the report uses a stored procedure as its data source. Is this the case for your subreport?
Usually, subreports are linked to fields in the main report so that the user isn't prompted repeatedly (once for each time the section that contains the subreport is rendered). If they are linked, the only prompting that will be encountered it that of main report.
Crystal Reports XI parameter fields (created in the UI, not the result of a SP) do not have a 'Set to Null' option. As a result, each parameter will need to have some value.
You may want to have a look at my Crystal Reports: Optional-Multi-Select Parameters posting on how you can add some optional values to your parameters.