How to prompt for parameters (with details, please)

Post Author: RainbowRiver
CA Forum: Data Connectivity and SQL
I have spent all afternoon on this. It should be fairly simple, but I just can't figure it out and the documentation is not helping.
This is how the SQL Server stored procedure looks in Query Analyzer, and it works just fine:
DECLARE @startDate datetimeDECLARE @endDate datetimeSET @startDate = '2007-11-01'SET @endDate = '2007-11-30'EXECUTE MonerisTransaction_ReportNotReconciledByDate @startDate, @endDate
I have two parameter fields on the report for the two parameters of the stored procedure.
In the database expert, if I select the stored procedure and click ">" to add it to the selected tables, there is no error message, but when I run the report, no data is displayed.
If I add a command instead of a stored procedure, what do I type as the SQL query in the "Add Command To Report" text box? The only way I won't get an error message is if I enter the entire five lines of code above. I can add parameters by clicking the "Create" button, but if I don't enter the five lines of code above and I click OK, I get an error message that the start date parameter is missing.
Why does it have to be so complicated?
Can anyone help me? My job is at stake!

Post Author: RainbowRiver
CA Forum: Data Connectivity and SQL
I've figured it out for those who have the same problem.
On the Database Expert screen:
1. Expand the "Current Connection" node.
2. Right-click "Add Command" under your connection and select "Add Command to Report" from the drop-down menu.
3. On the "Modify Command" screen, in the text box with the header "Enter SQL query in the box below", enter:
DECLARE @organizationID intDECLARE @date datetimeSET @organizationID = {?organizationID}SET @date = {?date}EXECUTE Report_ReconciliationSummary @organizationID, @date
4. Still on the "Modify Command" screen, In the list with the header "Parameter List", create the following parameters:
     organizationID
     date
5. Click OK.

Similar Messages

  • Report does not prompt for parameters when SeparatePages=False

    Hi all. We are using CR2008 Basic w/SP1 along with VS2008. Within our application, reports pull up fine and prompt for parameters using the CrystalReportViewer against the web service. SeparatePages is set to True. We want to change SeparatePages to False, but when I do that any report that should prompt for parameters is not.
    The reports were created in CR 8.5. We have upgraded them to CR2008 (open, refresh, save) which has greatly increased performance. With some further testing, I've discovered that if I take a report that doesn't currently have any parameters and add one via VS2008 report designer, it WILL prompt for the parameter when I run it in our application with SeparatePages=False.
    So I'm leaning that the problem has to do with the reports originally being created in 8.5. I've tried modifying an existing report with parameters, deleting parameters and re-adding, but I still can't get these to prompt for parameters with SeparatePages=False.
    Again, these same reports prompt for parms and work fine as long as SeparatePages=True.  I'm hoping someone might be able to shed some light on this. There are over 400 reports so re-creating them from scratch under CR2008 will be a painful option
    If I need to provide any additional information just let me know. Thank you!
    Sheila

    We are still working to resolve this issue. Testing has shown that for reports that don't return a lot of data, the prompt for parameters will display. But for larger reports, we just see the hour glass and the parameter prompt never displays. It's almost like the reports are trying to return the full dataset without any paramters being passed BEFORE it will prompt for parameters. This would explain why smaller reports will prompt and larger reports never will (?). Not sure that is what is happening.  Again, with SeparatePages=True we are immediately given the parameter prompt. With SeparatePages=False we run into the issue of no prompts.
    Here's the code behind if it help:
    ReportDocument report = new ReportDocument();
    try
        String rptFileName = @"App_Data\Reports\" + Request.QueryString.GetValues(0).GetValue(0).ToString();
        log.writeLog("Loading Report: " + rptFileName);
        String rptFile = Server.MapPath(rptFileName);
        report.Load(rptFile);
        report.Refresh();
        ConnectionInfo crConnectionInfo = new ConnectionInfo();
        log.writeDebugLog("ServerName : " + rProperties.ODBCSource);
        crConnectionInfo.ServerName = rProperties.ODBCSource;
        log.writeDebugLog("DatabaseName : " + rProperties.ODBCSource);
        crConnectionInfo.DatabaseName = rProperties.ODBCSource;
        log.writeDebugLog("UserID : " + rProperties.ODBCUser);
        crConnectionInfo.UserID = rProperties.ODBCUser;
        log.writeDebugLog("Password : " + rProperties.ODBCPassword);
        crConnectionInfo.Password = rProperties.ODBCPassword;
        foreach (CrystalDecisions.CrystalReports.Engine.Table table in report.Database.Tables)
            TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();
            crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
            table.ApplyLogOnInfo(crTableLogOnInfo);
    catch (Exception err)
        log.writeLog("Error Loading Report: " + err.ToString());
        this.lblError.Text = err.ToString();
        this.ErrorTable.Visible = true;
        this.ReportTable.Visible = false;
        return;
    CrystalReportViewer1.HasCrystalLogo = false;
    CrystalReportViewer1.ReportSource = report; // _serverFileReport;

  • How to prompt for OU during OSD Task with SCCM 2012 R2?

    How to prompt for OU during OSD Task with SCCM 2012 R2?

    Hi,
    Here is an example on how to do it using a Variable prompt in Configuration Manager, It works the same way in SCCM 2007,
    http://www.the-d-spot.org/wordpress/2013/04/01/dynamically-join-computer-to-ad-ou-during-osd-with-sccm/
    Regards,
    Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

  • Crystal reports viewer will not prompt for parameters

    Help,
    I can not get crystal report viewer to prompt for parameters when called from IIS 8 on Server 2012 r2
    I can get crystal report viewer to prompt for parameters when run from vs 2010 built in web service.

    Thanks,
    The solution for me was to uninstall the latest crystal reports runtime 13.10.x and install 13.6.x instead.
    Thanks anyway.

  • Report Preview in CMC keeps prompting for parameters ...

    Dear Experts, I am trying to see the preview of a report in CMC (CMC -> Folders -> Browse to the report and then click on review). It prompts for parameters and I enter the parameters. The report shows the result but then prompts for the parameters again. I check the same report in Dev and QA and they work. All these systems have same configuration, same version of IE and same settings. I check them all.  Kindly point out if I'm missing something. I appreciate any help.

    Hi
    what exactly do you mean by:
    The report shows the result but then prompts for the parameters again
    Is your report shown and after X seconds it prompts again for the parameters automatically?
    Regards
    Stratos

  • Crystal Report Viewer Credential Prompt for Report with Dynamic Parameters

    The .NET Crystal Report Viewer is prompting for database credentials when launching a report containing dynamic parameters. This only occurs for reports created with SAP Crystal Reports 2011 designer. Reports created with Crystal Reports XI designer (where dynamic parameters were first introduced) work correctly.
    The credential prompt window contains the following fields:
    - Server Name: <server name> (disabled)
    - Database Name: <database name> (disabled)
    - User Name: <empty> (enabled)
    - Password: <empty> (enabled)
    - Use Single Signon Key: false (disabled)
    The values in the prompt window which are disabled are the database connection values used during the design of the report in the SAP Crystal Reports 2011 designer.
    Expected Result:
    - No prompt for database credentials.
    - Values read from the database should be populated in a drop down for the dynamic parameters.
    Environment:
    - Visual Studio 2010 (C#)
    - Windows 7 Enterprise
    - SAP Crystal Reports runtime engine for .NET Framework 4
    - SAP Crystal Reports, version for Visual Studio 2010
    - SAP Crystal Reports 2011
    The database connection is being set to use a DSN. It must be a DSN as the calling application is only aware of the DSN/Username/Password values. These values are being passed to the Crystal Report Viewer contained in a Windows form.
    The database connection for the report is being set as follows:
    foreach (InternalConnectionInfo internalConnectionInfo in this.report.DataSourceConnections)
        // Must set the UseDSNProperties flag to True before setting the database connection otherwise the connection does not work
        if (internalConnectionInfo.LogonProperties.ContainsKey("UseDSNProperties"))
            internalConnectionInfo.LogonProperties.Set("UseDSNProperties", true);
        // Supposed to set the database connection for all objects in the report (ie. main report, tables, sub reports)
        internalConnectionInfo.SetConnection(this.DSN, string.Empty, this.LoginName, this.Password);
    The SetConnection method's signature is as follows:
       SetConnection(string server, string database, string name, string password)
    As you can see from the code snippet above I am setting the DSN name as the server parameter, blank for the database parameter (a database connection using DSN should only require DSN name/Username/Password) and the database username and password respectively.
    Is this a SAP bug?
    Is this the correct way of setting the database connection to use a DSN?
    Is there some other properties that need to be set somewhere else in the report through code?
    Any help would be greatly appreciated.

    Thanks for the pointer to the database connection code generator. After taking a look at the output from the tool I was able to finally get the dynamic parameters to load and populate properly without prompting for credentials. I needed to tweak the outputted code a bit to match my requirements of using a DSN only connection.
    Instead of updating the database connection properties contained within the Report.Database.Tables collection from the CrystalReports.Engine namespace, I changed it to replace the database connection properties in the Report.ReportClientDocument.DatabaseController.Database.Tables collection from the CrystalDecisions.ReportAppServer.DataDefModel namespace. For one reason or another, using the RAS namespace solved the problem.
    Below is the updated code with the change made:
    using RAPTable = CrystalDecisions.ReportAppServer.DataDefModel.Table;
    foreach (InternalConnectionInfo internalConnectionInfo in this.report.DataSourceConnections)
        // Must set the UseDSNProperties flag to True before setting the database connection
        if (internalConnectionInfo.LogonProperties.ContainsKey("UseDSNProperties"))
            internalConnectionInfo.LogonProperties.Set("UseDSNProperties", true);
        // Sets the database connection for all objects in the report (ie. main report, tables, sub reports)
        internalConnectionInfo.SetConnection(this.DSN, string.Empty, this.LoginName, this.Password);
    // The attributes for the QE_LogonProperties which is part of the main property bag
    PropertyBag innerPropertyBag = new PropertyBag();
    innerPropertyBag.Add("DSN", this.DSN);
    innerPropertyBag.Add("UserID", this.LoginName);
    innerPropertyBag.Add("Password", this.Password);
    innerPropertyBag.Add("UseDSNProperties", "true");
    // The attributes collection of the tables ConnectionInfo object
    PropertyBag mainPropertyBag = new PropertyBag();
    mainPropertyBag.Add("Database DLL", "crdb_ado.dll");
    mainPropertyBag.Add("QE_DatabaseType", "OLE DB (ADO)");
    mainPropertyBag.Add("QE_LogonProperties", innerPropertyBag);
    // Pass the database properties to a connection info object
    ConnectionInfo connectionInfo = new ConnectionInfo();
    connectionInfo.Attributes = mainPropertyBag;
    connectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
    connectionInfo.UserName = this.LoginName;
    connectionInfo.Password = this.Password;
    // Replace the database connection properties of each table in the report
    foreach (RAPTable oldTable in this.report.ReportClientDocument.DatabaseController.Database.Tables)
        RAPTable table = new RAPTable();
        table.ConnectionInfo = connectionInfo;
        table.Name = oldTable.Name;
        table.QualifiedName = oldTable.QualifiedName;
        table.Alias = oldTable.Alias;
        this.report.ReportClientDocument.DatabaseController.SetTableLocation(oldTable, table);
    this.report.VerifyDatabase();
    Thanks again Ludek for the help.

  • How to prompt for root/sudo credentials with Gnome

    With other distros like Ubuntu, Gnome prompts for root/sudo authentication whenever applications like Gnome services are run from the Desktop menu.  How do you enable that feature in Arch?  I have tried different variations of gksude -u root, gksudo -S....  Nothing seems to work.
    Thanks

    msmail000 wrote:I have gksu installed...  my user id is in the sudoers file "username ALL=(ALL) ALL".  I execute gksu services-admin.  I am prompted for the password.  The Services window appears and the Unlock button is active.  When I depress the Unlock button, nothing happens, all of the available services remain unselectible.
    Yeah, that's a known issue with the system tools. No bug report filed for it, though, I don't think. The buttons/services should work properly, though, if you were to try through a regular user and then unlocking after that.

  • How to prompt for user input in Forms

    How do I prompt for user input in Forms?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?
    If the user chooses to input the value I want to update a set of database fields with the value.
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?

    Desgordon,
    This can be accomplished by displaying your message to the user using an Alert. I use 3 different Alerts (Note, Caution and Stop) in my forms and they are inherited from a central source file (such as an Object Library or a Template Form) so they can be used by all of my Forms. You can set the text of the Alert using the SET_ALERT_PROPERTY() built-in and capture what button the user presses with the SHOW_ALERT() built-in. Additionally, if you need more than one button to be displayed in an alert, you use the SET_ALERT_BUTTON_PROPERTY() built-in to rename the default button or to add up to a total of three buttons in the alert. Here's an example:
    DECLARE
       Alert_ID       ALERT;
       v_AlertType    VARCHAR2(10) := 'CAUTION';
       v_AlertTitle     VARCHAR2(25);
       v_AlertText    VARCHAR2(150);
       n_AlertButton  NUMBER;
    BEGIN
       v_AlertTitle := 'Title of Alert';
       v_AlertText := 'This is message to the user.';
       /* Code leading up to the decision point. */
       alert_id := FIND_ALERT(v_AlertType);
       /* Note: I only set the Label of Button 2 because the default button 1 label is 'OK' */
       SET_ALERT_BUTTON_PROPERTY(v_AlertType, ALERT_BUTTON2, LABEL, 'Cancel');
       SET_ALERT_PROPERTY(Alert_ID, v_AlertTitle, v_AlertText);
       n_AlertButton := SHOW_ALERT(Alert_ID);
      /* Now I can test the value of n_AlertButton for 1 or 2 to find out what button the user selected. */
      IF ( n_AlertButton = 1 ) THEN
         /* Do something, because the user selected 'OK' */
      ELSE
         /* It is assumed at this point that the user selected 'CANCEL' */
         /* Stop processing any further. */
         RAISE form_trigger_error;
      END IF;
    END:Hope this helps.
    Craig...
    -- If my response or the response of another answers your question, please mark the response accordingly. Thanks!

  • Infoview not prompting for parameters

    Hi all,
    quite basic question but I have spent hours on this now so decided to ask.
    I have a Crystal report based on BW query which has date range as mandatory variable.
    How do I control whether the Crystal report promts for that variable or not when opening. When I open the Crystal Report from INfoview it does not prompt for this parameter, although it did so previously.
    Is the setting with the paramter in the CR or with report options?
    thanks

    Hi,
    can you please check if the option Save data with the report is selected? You will find this under the File menu in the CR designer. If the option is selected then the report will not try to fetch data from the database when opened and therefore will not prompt you for the date variable. In this case you will have to refresh the report explicitely in the InfoView
    Regards,
    Stratos

  • How to use lexical parameters with Sql Server Stored Procedure?

    Hi,
    I'm developing a BI Publisher report on a sql server database. I need to execute a stored procedure to dynamically build the query by replacing the lexical parameters with the values of varaibles of the stored procedure. With Oracle stored procedures, I have used data template and had reference the varaiable in SP by prefixing it with '&'.
    It doesn't work if I try to do the same thing with SQL server. Is there anyone who has come across the similar situation? Please let me know if anyone has got any ideas...
    Thanks in Advance
    Rag

    TopLink currently doesn't support multiple ResultSets. Multiple ResultSets support is considered for a future release.

  • How to prompt for user input in PL/SQL

    How do I prompt for user input in PL/SQL?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?
    If the user chooses to input the value I want to update a set of database fields with the value.
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?
    Edited by: desgordon on Sep 3, 2008 10:33 AM

    desgordon wrote:
    How do I prompt for user input in PL/SQL?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?OK, you're doing that in Forms...
    >
    If the user chooses to input the value I want to update a set of database fields with the value.Write PL/SQL procedure for this purpose...
    >
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?Not clear what you mean with view?
    But if you call your procedure in that button then yes 'control will be passed back to the code'...
    Cheers!
    Edited by: Faust on Sep 3, 2008 7:57 PM
    Too slow...

  • Refresh_report prompts for parameters

    Following some installation problems from our installer using the .msm files to create crystal runtime info, we have switched to using the downloadable redistributable to install Crystal 2008 runtime files (SP3 & 4)
    When we do this, when our code issues a refresh_report(), the report prompts for the parameters again with the original values missing.
    We can see the parameters in the viewer (on the left) until we issue the refresh_report, and we have checked that the setting ReuseParameterValuesOnRefresh (or similar) is set to True.
    Clients running the same version of our application change behaviour if we uninstall the .msm based version and install the downloadable redistributable.
    Any suggestions (the msm based version was point blank refusing to install on certain clients (64bit W 7, but not all of them)?
    Iain

    We are using Visual Studio 2008 to write a C# wrapper to then interface with our actual application  as a COM dll.
    However, this code is working on a client where the runtime was installed using an installer which used the Crystal 2008 msm files, and isn't working where the client is installed using the re-distributable downloadable .msi files.
    We can leave our app in place, and uninstall one version of the crystal runtimes, and then install the re-dist provided by SAP and the problem manifests. Re-installing the original runtime files from the msms 'fixes' this problem, but we then cannot get this to install at all on certain clients.

  • Prompt for parameters, but save password

    I have a report that prompts the user to select a date range for query results.  I am using a 3rd party program to view the report.  Under Report Options, I have disabled "save data with report" so that it prompts for the dates each time the report is opened.  The problem is that is also prompts for the password to the database.  Is there a way to set up the report to ask for a date range, but not ask for the password each time?  The third party program does not prompt for the password, so when trying to view the report, it just errors out.  I am new to CR, so I've only being doing this for a couple of day.  Thanks.

    Hi Dustin,
    You said you are using 3rd party program ?  What is this program ? Is it developed using .net or Java ?  If this is java based of .net based then you can pass user login information through coding.
    Otherwise it is not possible to stop asking user credentials when you refresh crystal reports.
    Thanks,
    Sastry

  • Stop Crystal from Prompting for Parameters

    Hi there,
    I am trying to stop Crystal from prompting for a parameter that has the Optional Prompt flag set to True as I want to use the HasNoValue attribute to retrieve all records when there is not a specific value sent to the parameter.
    When the parameter is created from a store procedure, I can simply set the value to nothing and handle the resulting NULL in the procedure.
    I was expecting that I could do the same for the regular parameters but this returns a "parameter field and parameter field current values are not compatible" error.
    I have tried setting the HasCurrentValue to True but this is a read only attribute.
    I have also tried setting the Viewer.ReuseParameterValuesOnRefresh to False (and True) but the report still prompts for the parameter.
    I have searched the web for the last two days and have had no joy on this so any help or pointers would be appreciated.
    Thanking you in advance

    Hi Don,
    I am using Crystal 2008 for both the report and the assemblies.
    Using the word All is not really an option as I need to process all types of parameters i.e. Boolean, integers and dates as well as strings.
    I could create some complex formulas to handle this but I need the report creation to be simple as possible as possible so that the customer can create reports at will.
    Using the Optional Prompt feature now available in 2008 I can create a simple record selection formula that looks like something like this :-
    (not HasValue({?MyParameter}) OR {Table1.Field1} = {?MyParameter})
    My problem is getting the parameter to register through my code that it has been set to HasValue = False so that the user is not prompted by the viewer to enter the parameter again.

  • Safari 6.02 Lion not prompting for pdf with password

    Hi,
    Safari is no longer prompting for a password when the pdf is protected.
    Firefox will prompt correctly for the same PDF and so does Preview.
    Normal PDF's open fine in safari.

    Just a normal DSL connection. Thank you for taking an interest.
    Having puzzled over this for weeks before asking the question, I (sort of) solved it this afternoon within an hour of doing so. I found and deleted the safari plist file (not that easy a task because for some reason Finder doesn't volunteer to show my user/library folder). That also erased the developer menu, but Safari is now once again working as it should with iCloud and YouTube. Because I no longer have the menu to look at it, I can't actually prove that it's showing to them as the latest version, but it certainly looks like it.
    Again thank you for answering.

Maybe you are looking for

  • Is there a way to confirm iPad Notes are backed up after a sync?

    I'm skeptical that everything on my iPad is backed up to my new MacBook Air because I have been getting that stupid common error message ever since I first connected the two, about iPad being synced to another iTunes library already and if I want to

  • How to change calendar setting for one event in a repeating series?

    Is there any way to change the calendar setting (color) for a single event in a repeating series without changing the color of all events in that series? It seems one event in a repeating series is linked to all other events in that series even if yo

  • Tried to instal an auto update this morning and I got an error message

    I got the usual auto update message this mortning, so I clicked install! Now all I get is the error messages.... Program:C\program File(x86)iTunes\iTuneshelper.exe                                                        Error 6034 Then I get another p

  • How i can create tables(database) in ms-access using jsp

    i want to create tables by using jsp in ms-access .user can only enter table name ,how many table fields ,constraints etc

  • Weird Safari problems with Forum

    I've been having random problems with the forum and Safari. When I am not logged in I see this: Every user, every post is the same except for the occasional (see the 7th row) odd one. I'm also not able to sign on. The login screen comes up but when I