Print Report and Parameter Prompt

I am using Crystal 2008 and .Net 2005.  I have a report viewer on a windows form.  When I preview a report, the Crystal based dialog for the report parameters comes up and the users can enter the parameters.  When I call PrintToPrinter, this dialog does not come up and I get an error saying that there are Missing Parameter Values.  I can't pass the parameters directly to the report at runtime during "silent" printing because the user needs to select them on the Crystal based dialog.  How can I do this?  I thought the code with the comment  "//parameter not found, popup dialog for user to enter" would accomplish this.
Thanks
public override void PrintReport()
            ReportDocument report = this.CreateReportDocument();
            System.Drawing.Printing.PrinterSettings settings = new System.Drawing.Printing.PrinterSettings();
            if (this.Config.ReportOutput.Print != null)
                if (this.Config.ReportOutput.Print.PrinterName != string.Empty)
                    settings.PrinterName = Config.ReportOutput.Print.PrinterName;
            System.Drawing.Printing.PageSettings pageSettings = new System.Drawing.Printing.PageSettings();
            report.PrintToPrinter(settings, pageSettings, false);
            report.Close();
            report.Dispose();
            report = null;
private ReportDocument CreateReportDocument()
            ReportDocument report = new ReportDocument();
            report.Load(this.Config.CrystalSettings.ReportFileName);
            while (!report.IsLoaded)
                System.Threading.Thread.Sleep(1);
            ConnectionInfo ci = this.CreateConnectionInfo();
            this.UpdateReportDocumentTables(ref report, ref ci);
            this.UpdateReportDocumentSubReportTables(ref report, ref ci);
            this.UpdateParamFields(ref report);
            return report;
private void UpdateParamFields(ref ReportDocument ReportDoc)
            ParameterField field = null;
            ParameterFields fields = ReportDoc.ParameterFields;
            ParameterDiscreteValue paramValue = null;
            for (int i = 0; i < fields.Count; i++)
                field = fields<i>;
                if (field.Name.ToLower() == "office")
                    paramValue = new ParameterDiscreteValue();
                    paramValue.Value = this.Config.Office;
                    field.CurrentValues.Add(paramValue);
                    field.HasCurrentValue = true;
                else if (field.Name.ToLower() == "casekey")
                    paramValue = new ParameterDiscreteValue();
                    paramValue.Value = this.Config.CaseKey;
                    field.CurrentValues.Add(paramValue);
                    field.HasCurrentValue = true;
                else if (field.Name.ToLower() == "user")
                    paramValue = new ParameterDiscreteValue();
                    paramValue.Value = this.Config.User;
                    field.CurrentValues.Add(paramValue);
                    field.HasCurrentValue = true;
                else
                    //try to get parameter from passed in values
                    ReportParameter param = GetParameterByName(field.Name);
                    if (param != null)
                        paramValue = new ParameterDiscreteValue();
                        paramValue.Value = param.Value;
                        field.CurrentValues.Add(paramValue);
                        field.HasCurrentValue = true;
                    else //parameter not found, popup dialog for user to enter
                        field.CurrentValues.Clear();
                        field.HasCurrentValue = false;
                        field.IsOptionalPrompt = false;
Edited by: rmwade on Mar 18, 2010 4:31 PM

There are a number of sample apps that should server as examples:
csharp_web_discreteparams.zip
csharp_web_rangeparams.zip
csharp_web_sub_daterange_param.zip
vbnet_web_discreteparams.zip
vbnet_web_multirangeparams.zip
vbnet_web_rangeparams.zip
vbnet_web_sub_daterange_param.zip
and more. The samples can be found on [here|https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples].
And don't forget to consult the developer help file for your version of CR.
Ludek

Similar Messages

  • Sub-reports displaying parameter prompt

    I have a CR XI r2  application using the JRC that displays a list of reports and allows a user to select the desired report. I then programatically determine the paramaters needed and set the values required. This works fine except when I use a report containing a sub-report. Although I loop thru the report heirarchy including the sub report and set all the parameters it still prompts for the sub-report parameter in the viewer before displaying the report. I tried setting the enable prompting to false but that didn't help.

    Hi,
    It may help you.
    Try to link the subreports with the main report Using Change Subreport Link.
    And map the parameters to the main Report.
    Thanks,
    Saravanakumar..

  • Print report and append control image to report.vi problem

    why print report.vi and control image to report.vi can't executable in xp service pack 3??
    before that, i use xp service pack 1. these sub vi can use successful. but after i transfer all ni file into xp service pack 3, that sub vi can't executable..why it happen???
    please, help me...

    When you said that you used your VIs in service pack 1 and then transferred to Service pack 3, are you referring to 2 different computers or you simply updated the computer with SP1 to SP3?
    If you are using 2 different computers, were all the software and the toolkit also installed in the pc with SP3? I am using XP with SP3 and I am not having any problems with the print vi.
    If you have more information, like if you get an error message, kindly post it here as well.
    Best regards,
    Mary Anne
    .....YOU WONT LEARN IF YOU ALREADY KNOW.....

  • Parameter Prompt when print only

    In the past we used the RDC to run reports within our application. When a user selects a report to run they have the option to preview or print it. No matter which option they chose the Crystal Parameter prompt screen would be displayed so they could enter the appropriate values. Then of course the report would run and either be printed directly to the printer (if chose print) or displayed in a viewer (if chose preview). We have recently switched to using CR2008. We have the preview working like before but not the print option. I'm thinking we are just missing something. If we choose print then the parameter prompt screen from crystal never shows and therefore the user is unable to enter values and report fails. How do you get crystal display the parameter prompt screen when not using a viewer?

    There is no RDC in CR 2008 so I assume you are using VS 2008 and CR .NET Assemblies.
    Look at these samples for more options:
    Root Page
    http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsHome
    Enterprise Samples (including managed and unmanaged ras)
    http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsSDKSampleApplications
    Non-Enterprise Samples
    http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsSDKSampleApplications
    Exporting Samples (RAS)
    http://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples#NETRASSDKSamples-Exporting%2FPrinting
    Also, use the ReportClientDocument.Refresh before making changes to the report to clear reports with saved data and then it will prompt for parameters.
    Thank you
    Don

  • Crystal Reports 2008 parameter panel

    Hello,
    I'm using Crystal Reports 2008 stand-alone application to design reports. I'm wondering is there a possibility to change information display on parameter panel?
    The problem is that I've created a parameter with option "prompt with description only" set to true. This parameter has value and description. When it's prompting for parameter everything goes fine, it prompts with description only, but in parameter panel it's only values (not descriptions) displayed. This is confusing for report users as the value is key (int type) and description is name (string that actually says something to user).
    Maybe there is something to be set in Crystal Reports Viewer component properties?
    Thanks in advance.

    Hello Gemi,
    I recommend to post this query to the [Crystal Reports Design|SAP Crystal Reports; forum.
    This forum is dedicated to topics related to the creation and design of Crystal Report documents. This includes topics such as database connectivity, parameters and parameter prompting, report formulas, record selection formulas, charting, sorting, grouping, totaling, printing, and exporting but also installation and registering.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all Crystal Reports Design queries remain in one place and thus can be easily searched in one place.
    Best regards,
    Falk

  • Template is not attached to AP Check Printing report (XML Publisher)

    Hi Guru,
    I have implemented XML publisher version of AP check Print report and did all the setups. When we make the payment in payables it automatically submits check print report. The report is completed successfully, but no output.
    When I check View details button noticed that template layout is not attached to the report.
    Please do the needful.
    Thank in Advance,
    Venkat.

    Hi,
    The following are the Instance details
    OS : OEL5
    Database: 11g
    EBS : 11.5.10.2
    I have completed all the setups for the report and I am able to see the template attached to the request for other reports where we submit them in SRS window.
    But "AP check Print report" submits automatically through the form while making the payment against supplier in AP.
    Thanks in Advance,
    Venkat.

  • Sub report parameter prompt appears when running Visual Studio 2008 with Crystal Reports 2008

    Post Author: relliott
    CA Forum: .NET
    If I build a simple Crystal Report that contains another simple Crystal Sub Report, the report will print preview fine in Crystal 2008.  The problem happens when add this report to a Visual Studio 2008 Web Application Project and I build and debug the application, the Crystal Viewer is prompting the user for the parameter used to link the sub report to the main report.  This should never happen as the user is not supposed to see this parameter.  If I type in some value for this sub-report parameter prompt, the Crystal Report Viewer gives an error message about not finding the field.
    I was having the same problem in Vs2005 with Crystal 10 which is why I upgraded.  Business Object's official fix for this problem was published under their KB article number c2018840 and c2019047.  These hot fixes ended up causing general exception errors in Visual Studio so I scrapped these solutions.
    Support had me install SP0 for Crystal 2008 (which did not fix it).
    Any ideas?
    Any help is greatly appreciated.
    Thanks,
    Rich Elliott

    Hi Bontrager,
    Thank you for posting in MSDN forum.
    According to your description, I agree with pvdg42's suggestion, so I suggest you can try pvdg42's suggestion to install the version of
    Crystal Reports 10.5 to check this issue again.
    Reference:
    http://forums.asp.net/t/1236730.aspx?Which+CR+version+is+in+Visual+Studio+2008+
    In addition, since this forum is
    to discuss: Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor. So if you have any issue about the
    Crystal Reports, I suggest you can ask the issue to the
    SAP Crystal Reports website:
    http://scn.sap.com/community/crystal-reports/content?filterID=contentstatus%5bpublished%5d~objecttype~objecttype%255bthread
    as pvdg42 pervious suggestion, it will be better support.
    Thanks for your understanding.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to print pdf file in SQL Server Reporting services report using command prompt?

    Is there a way to automatically print a SQL Server Reporting services report on command prompt? For eg: We can save a pdf file using rs.exe utility. I want to print a pdf using rs.exe utility. Is it possible? I don't want to install any 3rd party software.

    Thanks Simon for replying to my question.
    In oracle form, there is oracle command to print the report from command prompt with the help of rwrun.exe
    e.g: rwrun.exe   REPORT="D:\Test\REP_25\MLA.REP" DESNAME="testprinter" DESTYPE="PRINTER" P_FORMNAME="MLA.FMX" P_SPRACHE="E" P_SPRACHE_NR2="1" P_WHERE_BEDINGUNG="order by land_nr" USERID="test/test.world" PSV_NAME="PSV_DEMO" PSV_JOB_ID="PS$9583" RECURSIVE_LOAD="NO"
    BATCH="YES" NONBLOCKSQL="NO" ARRAYSIZE="1" PARAMFORM="NO" ERRFILE="c:\temp\psv16.tmp"<
    and to save the report we just need to change DESNAME="c:\temp\OC_100001349.pdf" DESTYPE="FILE" in above command instead of DESNAME="testprinter" DESTYPE="PRINTER".
    DESNAME and DESTYPE are the input parameters of the respective report.
    In SSRS, we can run the file from the command prompt and save it.
    rs -i "C:\Users\pujarswa\Documents\reports\new\LoadReport.rss" -s ww2004760:80/ReportServer_MSSQL -v fileName="C:\Users\pujarswa\Desktop\TipsReportLoad.pdf"
    -v reportPath="/TipsReport/LoadListTabular" -t -v format="PDF" -v LandNr=4 -u ap\swati -p test@# -e Exec2005
    But we cannot use same command for printing as you said we need to create another script for printing files.
    I have gone through the links but I dont want to use Adobe Acrobat Reader exe for printing because client it may not have Adobe Acrobat Reader on their machine.
    Also I want to pass a input parameter as type="Printer" to my report which will print directly for me and same I can acheive in command prompt passing type="Printer" fileName="C:\Users\pujarswa\Desktop\TipsReportLoad.pdf"

  • Filtering report data based on user login and Parameter fields

    Post Author: mronquillo
    CA Forum: General
    Hi,I am running a report that filters data based on the user login. To do this, I created a formula called @user that compares the login name (using the CurrentCEUserName field) and returns the user's name. If the user login is not a login specified in the if statements, it returns the parameter field "user_name":For example: if CurrentCEUserName = "loginname1" then "User's Name 1"else if CurrentCEUserName = "loginname2" then "User's Name 2" else if CurrentCEUserName = "loginname3" then "User's Name 3"  else if CurrentCEUserName = "loginname4" then "User's Name 4".. .else {?user_name}   In select expert, I have a condition which filters data based on the string returned from that formula:{Table.Name} = {@user}  This works fine and when the users run the report they only their own data. However, they are still prompted to choose a parameter field regardless if of the value returned by the @user formula. Oddly enough, regardless of what parameter field they choose, they will still only see their own data (i.e. if John chooses "Bob" from the parameter list, he will still only see John's data.)If I remove the "else {?user_name}" line from the @user formula, then the users are not prompted anymore. However, if they are not a "valid" user - that is, if any of the if statements in the formula are not true for their login name - then they will see no data. What I want to do is make the report ONLY prompt the user to choose a parameter field if their login name is not "valid". That is, if the @user formula is able to return a string value for their login name, then they will jump right into the report without being prompted to choose a parameter - otherwise, the user will be prompted to choose a name from the parameter list. I thought my formula would allow this (hence the "else" clause), but it seems that if a parameter field is present in any formula, then the report automatically prompts the user to choose a parameter. Is what I am trying to accomplish possible in CR (I'm using CR v10.0) or is there a better way to do what I am trying to do?Thanks in advance.

    Post Author: sharonmtowler
    CA Forum: General
    try, or something like that
    (if CurrentCEUserName ={?user_name} then true else ({Table.Name} = {@user}) )

  • To create a Crystal Report which will prompt for a value and if nothing is entered select the alternative value from the database record.

    Hi Experts,
    I am working on a report in Crystal (2008) which will prompt user to input a value, but if nothing is entered then it will select relevant database value.
    I created a string parameter prompt called "{?Pack_Qty_Overide}" and used the following formula.
    IF {?Pack_Qty_Overide} = ""
    THEN {OITM.SalPackUn}
    ELSE {?Pack_Qty_Overide}
    However, when I check the formula in editor, it says that there should be a number at the end of "Else" clause.
    What am I doing wrong?

    Hi Janos,
    OITM.SalPackUn is Numeric(19.6). When I used parameter input type as number, my formula returned error that "A number is required here" at the "if .... " statement.
    So I used the formula you provided and it worked, such that when I input a quantity in parameter prompt it would display that, but if no override value given, the field remains blank - i.e. it does not display the value stored in OITM.SalPackUn.
    What am I doing wrong?
    Thanks,
    YP

  • Cant get Parameter prompting in Report Viewer XI

    Post Author: jt327
    CA Forum: Crystal Reports
    Hi All,
    I am relatively new to crystal, so this may be a stupid question..
    I have created a report in Crystal Reports 10, and it all works fine in Crystal itself. However, when I try to run the report in Reports Viewer XI, I dont get the parameter prompts. Instead it just uses the default values.
    Anybody know how I can get this working?
    Thanks.

    Post Author: bchu
    CA Forum: Crystal Reports
    If you are referring to Crystal Reports Viewer XI, then it only supports viewing saved data report only, so there will be no database logon prompting and no parameter prompting.
    - Ben

  • Printing report that has a parameter with multiple values crashes jvm

    I am using BOE XI 4.0 as an unmanaged RAS.
    I am able to preview a report that has a string discrete parameter that can have multiple values.  If I give it a single value.  It previews fine.  If I give it an empty string it prints all values which is fine.  If I give it two discrete values, it displays just those two.
    However, if I try printing the report to a printer:
    1 parameter value - prints fine.
    2 parameter values - crashes jvm
    empty string parameter value - crashes jvm
    I would appreciate some direction on how to do this.  It works in crystal reports for eclipse.
    The test jsp I am using is based off of the samples.  The print test jsp is the same as the preview test with the exception of the following code differences.:
    preview report.jsp code
    // Create a Viewer object
    CrystalReportViewer viewer = new CrystalReportViewer();
    // Set the report source for the  viewer to the ReportClientDocument's report source
    viewer.setReportSource(clientDoc.getReportSource());
    // Process the http request to view the report
    viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), out);
    // Dispose of the viewer object
    viewer.dispose();
    print report jsp code
      PrintReportOptions printOptions = new PrintReportOptions();
      printOptions.setPrinterName("DELL");
      try {
          clientDoc.getPrintOutputController().printReport(printOptions);
      } catch (ReportSDKException ex1) {
          System.out.println("Message - " + ex1.getLocalizedMessage());
      } catch (Exception ex2) {
          System.out.println("Message - " + ex2.getLocalizedMessage());
      clientDoc.close();

    I am using BOE XI 4.0 as an unmanaged RAS.
    I am able to preview a report that has a string discrete parameter that can have multiple values.  If I give it a single value.  It previews fine.  If I give it an empty string it prints all values which is fine.  If I give it two discrete values, it displays just those two.
    However, if I try printing the report to a printer:
    1 parameter value - prints fine.
    2 parameter values - crashes jvm
    empty string parameter value - crashes jvm
    I would appreciate some direction on how to do this.  It works in crystal reports for eclipse.
    The test jsp I am using is based off of the samples.  The print test jsp is the same as the preview test with the exception of the following code differences.:
    preview report.jsp code
    // Create a Viewer object
    CrystalReportViewer viewer = new CrystalReportViewer();
    // Set the report source for the  viewer to the ReportClientDocument's report source
    viewer.setReportSource(clientDoc.getReportSource());
    // Process the http request to view the report
    viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), out);
    // Dispose of the viewer object
    viewer.dispose();
    print report jsp code
      PrintReportOptions printOptions = new PrintReportOptions();
      printOptions.setPrinterName("DELL");
      try {
          clientDoc.getPrintOutputController().printReport(printOptions);
      } catch (ReportSDKException ex1) {
          System.out.println("Message - " + ex1.getLocalizedMessage());
      } catch (Exception ex2) {
          System.out.println("Message - " + ex2.getLocalizedMessage());
      clientDoc.close();

  • Reports 6.0 and Parameter Lists and Generate to File

    I am using the run_product built in from Forms 6.0 and opening
    up a report passing it several parameters via a parameter list.
    Everything works great when previewing the report.
    There is the option in the report preview under File -> Generate
    to File. When I generate a report to file using any type of
    format it appears that the report does not use the parameters
    that I passed in originally from the form. It appears that it
    looses all the parameters I passed in. This is most concerning
    to me. Am I doing something wrong or is this a "feature" I
    didn't know about? I really would like users to have this
    ability.
    null

    Yes I guess this will work, but the option to generate to file
    is extremely misleading if you ask me. This option should
    generate the current report with the current parameters. This
    is unacceptable as far as I am concerned and should be
    considered a bug. Oracle needs to give us more control over
    FORMS and REPORTS into all too many situations I have been
    frustrated because I am not able to do something that I want to
    do.
    I feel in general REPORTS object is very limited compared to
    crystal reports....
    Dan Paulsen (guest) wrote:
    : Give the user the option on the calling form whether to save
    the
    : report to file or just view it. If they want to save to file,
    : pass the parameter to save to file when you call the report
    and
    : suppress the parameter form, this will eliminate the problem.
    : Spencer Tabbert (guest) wrote:
    : : I am using the run_product built in from Forms 6.0 and
    opening
    : : up a report passing it several parameters via a parameter
    : list.
    : : Everything works great when previewing the report.
    : : There is the option in the report preview under File ->
    : Generate
    : : to File. When I generate a report to file using any type of
    : : format it appears that the report does not use the
    parameters
    : : that I passed in originally from the form. It appears that
    it
    : : looses all the parameters I passed in. This is most
    : concerning
    : : to me. Am I doing something wrong or is this a "feature" I
    : : didn't know about? I really would like users to have this
    : : ability.
    null

  • Printing a report and using the print dialog for it

    i already have the print dialog vi from NI. I am using the normal report generation toolkit for printing reports. But I want to give the user an option to choose the number of pages and landscape/portrait options. But how do I integrate the 2 so that before printing the user can select these features.

    There is an activeX control that will set these settings. It is called IAS Helper COM Component 1.0 Type Library. It operates the Windows printer configuration program. Since another company wrote the code, I do not have the resources to help you use the control, but the attached example program should get you started.
    Jeremy Braden
    National Instruments
    Attachments:
    Print_Window_Example_v61.llb ‏59 KB
    Print_Window_Example.llb ‏59 KB

  • Why is printing report different from report builder and app server

    I created a report and when ran from report builder it looks fine.
    And when i moved the report to server and ran the report in the browser using this url
    http://192.1.1.8:7778/reports/rwservlet?userid=esp/esp_dev1@wdev&report=FMMA_VOUCHER.rdf&destype=cache&desformat=pdf
    and print it the report shrinks, the fonts become small and the margins change. I am having hard time how to figure out a way to correlate the formatting in the report builder and when i run on the server using pdf format.
    Is there any way to set the server so that the pdf output matches with the report builder.
    Thanks.
    Sree

    I assume you are doing a cross platform deployment
    Pls read section 6.2
    Resolving PDF Font Issues During Cross-Platform Deployment
    in
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    [    All Docs for all versions    ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf
    ---------------------------------------------------------------------------------

Maybe you are looking for

  • In 32bit system getting exception "Could not load file or assembly 'SIPEPS, Version=5.0.0.0' "

    Hi All, We are developing a windows service for Lync user state change using UCMA 4.0. It works fine in 64 bit system but once we run the window service in 32 bit system we are getting the exception as  below. Exception  message: Could not load file

  • Oracle 9.2.0.1.0 support

    Hi friends I am currently using Oracle 9.2.0.1.0 version. I need to upgrade to 9.2.0.8.0. Is there any patch available or oracle stop the support to 9.2.0.1.0. If so to change to a new version what to do? Please help me with a specific answer. Please

  • Storage location to be excluded from MRP Run

    Dear Gurus , We are trying to exclude perticular Storage location from MRP Run with the Configuration setting IMG >>> Production >>>.MRP >>>.Planning >>>>.Define Storage Location  MRP per plant >>>> Indicator 1 is set Still the Stock is being conside

  • Mandatory fields for inbound delivery idocs

    hi all i want to generate inbound idocs for inbound delivery ASN i am using message type DESADV and idoc type /AFS/DELVRY03 in order to generate inbound idoc what are mandatory values i have to pass to the idocs thanks Anil

  • Read and Unread flag for Workflow entries in the inbox.

    Hi there! I was wondering if there is any mechanism or way to detect that the user have read a particular approval. else it will be mark as unread. It is of similar concept to our email as well as the Alert link in SRM. If this approval(item) is not