How to set Command Timeout in Crystal report while calling from C# code

I am using Crystal report XI R2.  I am calling SQL server 2005 stored procedure as source in the report. I want the report should timeout from the website if the stored procedure doesn't return resultset after 5 minute. Could you please assist how should I chnage the below code to achieve that.
Code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CrystalDecisions.CrystalReports.Design;
using CrystalDecisions.Shared;
using CrystalDecisions.Web;
using CrystalDecisions.CrystalReports.Engine;
namespace CrystalTest
    public partial class _Default : System.Web.UI.Page
        protected ReportDocument rd;
        protected CrystalReportViewer Crv;
        protected void Page_Load(object sender, EventArgs e)
            rd = new ReportDocument();
            rd.Load(Request.MapPath("FXRate.rpt"));
            SetDBLogonForReport(GetCrvConnectionInfo(), rd);
            ParameterFields crtParamFields;
            ParameterDiscreteValue crtParamDiscreteValue1;
            ParameterField crtParamField1;
            ParameterDiscreteValue crtParamDiscreteValue2;
            ParameterField crtParamField2;
            ParameterDiscreteValue crtParamDiscreteValue3;
            ParameterField crtParamField3;
            ParameterDiscreteValue crtParamDiscreteValue4;
            ParameterField crtParamField4;
            ParameterDiscreteValue crtParamDiscreteValue5;
            ParameterField crtParamField5;
            ParameterDiscreteValue crtParamDiscreteValue6;
            ParameterField crtParamField6;
            crtParamFields = new ParameterFields();
            crtParamDiscreteValue1 = new ParameterDiscreteValue();
            crtParamField1 = new ParameterField();
            crtParamDiscreteValue1.Value = "USD";
            crtParamField1.ParameterFieldName = "@BaseCurrCode";
            crtParamField1.CurrentValues.Add(crtParamDiscreteValue1);
            crtParamFields.Add(crtParamField1);
            crtParamDiscreteValue2 = new ParameterDiscreteValue();
            crtParamField2 = new ParameterField();
            crtParamDiscreteValue2.Value = "EUR";
            crtParamField2.ParameterFieldName = "@CounterCurrCode";
            crtParamField2.CurrentValues.Add(crtParamDiscreteValue2);
            crtParamFields.Add(crtParamField2);
            crtParamDiscreteValue3 = new ParameterDiscreteValue();
            crtParamField3 = new ParameterField();
            crtParamDiscreteValue3.Value = "2008-05-28 00:00:00";
            crtParamField3.ParameterFieldName = "@FromDate";
            crtParamField3.CurrentValues.Add(crtParamDiscreteValue3);
            crtParamFields.Add(crtParamField3);
            crtParamDiscreteValue4 = new ParameterDiscreteValue();
            crtParamField4 = new ParameterField();
            crtParamDiscreteValue4.Value = "2008-05-28 00:00:00";
            crtParamField4.ParameterFieldName = "@ToDate";
            crtParamField4.CurrentValues.Add(crtParamDiscreteValue4);
            crtParamFields.Add(crtParamField4);
            crtParamDiscreteValue5 = new ParameterDiscreteValue();
            crtParamField5 = new ParameterField();
            crtParamDiscreteValue5.Value = "ashok12";
            crtParamField5.ParameterFieldName = "@CurrentUser";
            crtParamField5.CurrentValues.Add(crtParamDiscreteValue5);
            crtParamFields.Add(crtParamField5);
            crtParamDiscreteValue6 = new ParameterDiscreteValue();
            crtParamField6 = new ParameterField();
            crtParamDiscreteValue6.Value = DateTime.Now.ToString("dd MMM yyyy hh:mm");
            crtParamField6.ParameterFieldName = "@ClientTime";
            crtParamField6.CurrentValues.Add(crtParamDiscreteValue6);
            crtParamFields.Add(crtParamField6);
            Crv.ParameterFieldInfo = crtParamFields;
            Crv.DisplayGroupTree = false;
            Crv.BestFitPage = true;
            Crv.ReportSource = rd;
        private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument)
            Tables tables = reportDocument.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
                TableLogOnInfo tableLogonInfo = table.LogOnInfo;
                tableLogonInfo.ConnectionInfo = connectionInfo;
                table.ApplyLogOnInfo(tableLogonInfo);
        public static CrystalDecisions.Shared.ConnectionInfo GetCrvConnectionInfo()
            CrystalDecisions.Shared.ConnectionInfo con = new CrystalDecisions.Shared.ConnectionInfo();
            con.ServerName = System.Configuration.ConfigurationSettings.AppSettings["conServer"].ToString();
            con.DatabaseName = System.Configuration.ConfigurationSettings.AppSettings["conDatabase"].ToString();
            con.UserID = System.Configuration.ConfigurationSettings.AppSettings["sesUser"].ToString();
            con.Password = System.Configuration.ConfigurationSettings.AppSettings["sesPwd"].ToString();
            return con;
        private void Page_Unload(object sender, System.EventArgs e)
            if (rd != null)
                rd.Close();
                rd.Dispose();
            if (Crv != null)
                Crv.HasCrystalLogo = false;
                Crv.Dispose();

Yes it is possible to use datasets. resources listed below. One hting to be aware of; Using datasets larger than about 5,000 records (depending on the report) is not advisable. Performance will potentially be an issue with datasets that are too large.
Crystal Reports Guide To ADO.NET
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/401c4455-a31d-2b10-ae96-fa57af5aec20
Reporting Off ADO.NET Datasets
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2091d0c3-da1d-2b10-22be-a3426b183f75
VS2005_Walkthroughs
http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf
VB samples:
https://smpdl.sap-ag.de/~sapidp/012002523100006252822008E/net_win_smpl.exe
In the above samples see VBNET_WIN_ADODOTNET
C# samples
https://smpdl.sap-ag.de/~sapidp/012002523100006252722008E/csharp_win_smpl.exe
BTW., notes databse is here:
https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_ossnotes&query=&adv=true
Articles can be searched here;
https://www.sdn.sap.com/irj/sdn/businessobjects-articles
Ludek
Edited by: Ludek Uher on Feb 17, 2009 1:22 PM

Similar Messages

  • How to add the parameters onto the reports while calling from forms

    Hi all,
    I am using oracle forms 10g. I want to call a report from the form.
    But i dont know how to add parameters to the url while using
    web.show_document();
    i have a sample code. But it does not add the forms values onto the url.
    DECLARE
    v_host varchar2(100);
    v_port varchar2(10);
    v_parameter_string varchar2(4000);
    v_username varchar2(50);
    v_password varchar2(50);
    v_database varchar2(50);
    BEGIN
    -- Get the full domain name of the server from the formsweb.cfg
    tool_env.getvar('SERVER_URL',v_host);
    -- Get the username/password and database from the .env file
    tool_env.getvar('APPLICATION_USERNAME',v_username);
    tool_env.getvar('APPLICATION_PASSWORD',v_password);
    tool_env.getvar('APPLICATION_DATABASE',v_database);
    -- If it is localhost then we are running on windows and need to use the windows port, otherwise we
    -- are on AIX and need to use the AIX port
    IF v_host = 'localhost' THEN
         v_port := '8889';
    ELSE
         v_port := '7778';
    END IF;
    -- Now build the parameter string for running the report      
    v_parameter_string := 'server=rep_fsprod';
    v_parameter_string := v_parameter_string||'&report=AAP_TOTAL_CONTRACT_VALUE_RPT.rdf';
    v_parameter_string := v_parameter_string||'&userid='||v_username||'/'||v_password||'@'||v_database;
    v_parameter_string := v_parameter_string||'&execution_mode=batch';
    v_parameter_string := v_parameter_string||'&comm_mode=synchronous';
    v_parameter_string := v_parameter_string||'&destype=cache';
    v_parameter_string := v_parameter_string||'&desformat=pdf';
    -- Now run the report
    web.show_document('http://'||v_host||':'||v_port||'/reports/rwservlet?'||v_parameter_string,'_blank');
    END;
    Are we able to add the text values in the form from to the URL.
    Please let me know....
    thanks in advance....
    Naveen

    hello
    read the following white paper http://www.oracle.com/technology/products/forms/pdf/10g/frm10gsrw10g.pdf
    cheers
    Q

  • How to set command timeout for table object?

    I have a report that is generating an error during rendering in a CrystalReportViewer control (v10.5).  The error is "Failed to open a rowset." which appears to be caused by a timeout.  I'm currenlty setting the connection info and location of the sproc programmatically.  How can I set the command timeout as well?  Can I set this via the Attributes collection of the ConnectionInfo object?  (This appears to be a command timeout, not a connection timeout, which I'm already including in the Attributes collection of the ConnectionInfo object and setting at 15 seconds.  I've tried making this as much as 60 seconds but it doesn't change the behavior.)

    The error message includes text that states the timeout was exceeded (in bold below)...
    CrystalDecisions.CrystalReports.Engine.InternalException: Failed to open a rowset.
    Details: ADO Error Code: 0x
    Source: Microsoft OLE DB Provider for SQL Server
    Description: Timeout expired
    SQL State: HYT00Error in File J:\DOCUME1\ADMINI1\LOCALS~1\Temp\SpecificationSummaryReport {42EDFEA3-DD0D-4F5E-BC0B-F9CC1126A872}.rpt:
    Failed to open a rowset. ---> System.Runtime.InteropServices.COMException (0x800002D3): Failed to open a rowset.
    Details: ADO Error Code: 0x
    Source: Microsoft OLE DB Provider for SQL Server
    Description: Timeout expired
    SQL State: HYT00Error in File J:\DOCUME1\ADMINI1\LOCALS~1\Temp\SpecificationSummaryReport {42EDFEA3-DD0D-4F5E-BC0B-F9CC1126A872}.rpt:
    Failed to open a rowset.
    1)  Is there a Service Pack for CR 10.5???  That is the runtime that is in use - not XI.
    2)  The report viewer app is in version 10.5 (as mentioned in the first post) but the report was created in the designer for version 11.  Before we assume that is a problem - I have other reports created this way that work fine.
    3)  The data source is SQL 2005.
    4)  The connection type is OLE DB - Microsoft OLE DB provider for SQL Server.
    I think the issue is due to corruption in the report file.  I've seen this many times with reports (over the last 10 years).  I've had reports that refuse to work but if I recreate them from scratch the new report works fine.  In fact, I've recreated the data portion of this report (using the same sprocs) and that one works.

  • How to set printersettings for the crystal report viewer in SAP BI dynamically

    Hello
    I have set the URL method for my crystal report and with parameter passing as shown below, it was displaying the crystal report viewer by connecting to the SAP BI 4.0 server with this method.
    http://cr:port/businessobjects/enterprise115/desktoplaunch/opendoc/openDocument.jsp?sDocName=CRLabelParam&sType=rpt&lsSnPrinted=0&lsSsTestProjectNr=1
    This URL will be called from Web application by different users, i would like to set the printer settings differently for different users for this crystal report viewer how shall i need to set the printer options?
    shall i need to set the printer settings programatically for each user. Please advise me how do i need to proceed.
    Thanks & Regards,
    Rajeswari.

    There are no BI / CR APIs that would do this for you. The way I see it, you'll have to have your own print button and populate it with the correct printer information for each user as they request the report. Of course, alternatively, use the viewer printer button and get the users to choose the correct printer.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • How to set formula field in crystal report

    Hello all,
    I develope the code in C#.NET and use SAP B1 2004C. I have a problem with crystal report. I have in crystal report one unbound field. This field is string type. I need in my code change value of this field to another text ex. ("test").
    I use this code:
    FormulaFieldDefinitions crFormula;
                FormulaFieldDefinition crFormulafieldD1;
                crFormula = crReportDocument.DataDefinition.FormulaFields;
                //FormulaFieldDefinition test;
                //bool test = crFormula.IsReadOnly;
                string error = "";
                bool isCorrect = true;
                crFormulafieldD1 = crFormula[1];           
                string ahoj = crFormulafieldD1.FormulaName;
                crFormulafieldD1.Text = " ""+OP.ToString()+"" ";
                isCorrect = crFormulafieldD1.Check(ref error);     
                // Display the error message if the syntax is incorrect.
                //if (!isCorrect) MessageBox.Show(error);
    The value of the field is set, but on the report isnt it. Why not. Can you help me. Send some sample.
    Thanks

    Hi
    I've never tried to change a field of the report directly. Maybe it would solve the problem if you make a parameter field, which you can use in the formula.
    You can set then the parameter field:               report.SetParameterValue("NameOfParam", valueOfParam);
    Regards,
    Martin

  • How to set Excel Options using  crystal reports 2008

    Hi,
    I am trying to figure out CR 8.5 (Crystal report control) Equivalents in Crystal reports 2008 using crystal report viewer in .Net but not able to find the exact replacments.
    Properties used in CR 8.5
    CRAXDRT.ExportOptions.ExcelUseWorksheetFunctions=True
    CRAXDRT.ExportOptions.ExcelUseTabularFormat =True
    CRAXDRT.ExportOptions.SetLogOnInfo(1,3,4,5)
    Please let me know the replacements for the above mentioned properties in .Net using crystal report viewer (CR 2008)
    Thanks in Advance
    Regards,
    Ramnath

    Hello,
    The code that has been provided is of Report Designer Component.
    RDC has been deprecated in Crystal Reports 2008.
    Use the 'ExcelFormatOptions' class. It provides many options regarding exporting in an excel format.
    ExcelFormatOptions myExportFormatOptions = new ExcelFormatOptions();
    Try exploring the Developer guide for Crystal Reports .NET SDK [here|http://www.sdn.sap.com/irj/boc/sdklibrary#section7]..

  • How to set relative position in Crystal Reports

    Hi
    We are using CR XI R2 for designing crystal reports and Oracle 9i as datasource.
    we have placed 5 columns in vertical position next to one another in details section.
    for ex
    Salesrevenue
    Company description
    SalesSummary
    as data fetch is dynamic whenver data in 'Sales revenue' is more it is overlapping on 'Company description' column
    and so on with 'Sales summary' too.
    I know that Relative postion works only when columns are placed in ROW MANNER i.e
    Salesrevenue||Company description||SalesSummary but doesn't work when placed in the above manner.
    Please let me know if there is any workround or any other option need to be configured to overcome this issue.
    Thanks in Advance,
    BSR

    Right click the report navigator(left of your report body under design mode), and then choose 'insert a new section below', this will insert a new detail section called 'details b', put the 'Company description' into that section and third one into another new detail section.
    This will let you avoid the overlap issue.
    Thx, Hao

  • Set a timeout for crystal sessions while using the Windows.Forms.Viewer?

    Hi,
    I am looking for a way to set the timeout for the crystal report sessions when using the Windows.Forms.Viewer in a .NET application. I guess that the default value is 20 minutes (like in the entperprise installations) but we cannot afford to keep many sessions open for that long. Is there a registry entry which can be set? Or even a way to do this programmatically?
    Thank you in advance,
    Stratos

    Hi David,
    we are talking here about a standalone .NET application where the reports are installed locally (like the application itself). We are not retrieving the reports from a server. The whole thing was developed using the crystal report viewer model probably because it was easier to do so. Is there a method in this model to tell the crystal runtime to do the clean-up work either for a report (like the ReportDocument.Close() ) or for the entire runtime instance. Dispose() does not seem to help us. If you say that there is no other way than redesign then we have to consider this option also.
    Cheers
    Stratos
    PS: What I was thinking of (as Plan B instead of using the ReportDocument object model) is to instantiate the crystal report viewer object in a separate process (.exe). Please note that we open a new crystal report viewer windows for each report, which is displayed. Closing the viewer window (ie. terminate the process) will at least then clean up and release the crystal DLLs and hopefully close the database connections. Or am I missing something here?
    Edited by: Efstratios Karaivazoglou on Jul 29, 2008 10:05 PM

  • Crystal Reports 9 called from a VB6 application - Invalid TLV record

    I have a VB6 app that calls a Crystal Reports 9  CRViewer9.  On two PC" I got "Invalid TLV record". From what I read I think that there is a problem with a .dll but I not sure which one so I reinstalled Crystal Reports 9 on one PC and it corrected the problem.  However when I tried this solution on the 2nd PC (XP SP3) I get
    Error 1904. Module commonobjmodel..dll failed to register.  HRESULT -2147024770.
    If I press Ignore, I get the same message for several other .dll's.  I tried going to the DOS command and use REGSVR32 but it fails as well.
    Any suggestions?

    hello,
    A couple of possible causes. They have an older version of CR which installed crpe32.dll into the \windows\system32 folder. If so rename it as well as the \windows\Crystal folder.
    You don't have all of the required dependencies on the work station.
    Or you don't have permission, must have local PC Admin rights, to install software.
    Don

  • How to set a timeout on the web service call

    I can use Business process or JCD wrapped as business process. I need to send a web service request and wait for 2 seconds, if the response doesnot comeback within the 2 second time frame, I need to raise the fault message and publish it to queue. Webservice external system, doesnot have configurations for the duration of the web service call, Is there any better way of getting this accomplished.
    thanks
    Kiran

    This can be solved quite easily if you use BPEL... but I think you also could do it in a JCD.
    What you need to do, is to delegate the actual web service call to a "sub service". Then you call this "sub service" using an asynchornous mechanism like JMS. After the JMS send, you do a JMS recieve waiting for your desired amout of time. If this times out, you can throw an exception or whatever.
    The "sub service" consists of queue that triggers your "sub service" that does the web service call normally. The "sub service" blocks until the web service returns a response and posts this back on a queue (you should use a dedicated reply-to Queue). If the reply comes to late, it is ignored by the calling business process.

  • How to set custom page heading in List when called  from Screen

    Hi All,
    I have a requirement in which i have to call a list from screen. On the list i have to display data on from screen. The data width is 200(around 15 columns).
    In the screen's PBO i have used the below code to navigate to list:
    LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
      SET PF-STATUS space.
      SUPPRESS DIALOG.
    But, here how can i set the custom LINE-SIZE and LINE-COUNT.
    Please do reply  with an example.
    Thanks in advance,
    Sumesh

    Hi,
    Use the below code.
      data : lo_column_setting type ref to if_salv_wd_column_settings,
             LO_COLUMN TYPE REF TO CL_SALV_WD_COLUMN,
              LO_HEADER TYPE ref to cl_salv_wd_column_header.
    lo_column = lo_column_setting->get_column( 'USERID' ).
      CALL METHOD lo_column->CREATE_HEADER
      RECEIVING
        VALUE  = LO_HEADER.
      CALL METHOD LO_HEADER->SET_TEXT
      EXPORTING
        VALUE  = 'User Id'.
    Regards,
    Priya

  • How to set the password encrytacion a database. Accdb from Visual Basic 2010 for a report. Rpl

    I want to know how to set the password encrytacion a database. Accdb from Visual Basic 2010 for a report. Rpl

    You have to connect via ODBC, then use code along the lines of what is described here:
    http://scn.sap.com/thread/3526924
    by me on March 28 and Jan on March 29.
    Also see KBA: 1686419 - SAP Crystal Reports designer does not recognize Access *.accdb file
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • How to center the content in crystal report viewer?

    open crystal report viewer in winform, default at the left top
    after maxmium the winform window, content become at the center
    another odd thing is that i set window winform size 1208*1024 and crystal report view is fill
    then tried, content is not center any more
    How to center the content in crystal report viewer in code?
    Edited by: Mathew_666 on Oct 6, 2011 5:20 AM

    Since there is no control for center you'll need to do the math on your own. This is just a rough draft, but you'll get the idea.
    One of the things you'll need to figure out is your buffer to help you give a centered feel. We'll say that value is 50 in this case.
    Height
    int buffer = 50;
    int formHeight = 1000; // we'll assume a height of 1000 in this case
    int crystalTop = buffer;
    int crystalViewerHeight = formHeight - (buffer * 2); // buffer is at the top and bottom
    Width
    int formWidth = 1000; // we'll assume a width of 1000 in this case
    int crystalLeft = buffer;
    int crystalViewerWidth = formWidth - (buffer * 2); // buffer is at the top and bottom

  • Step- by- Step on How to Load Excel data into Crystal Reports?

    Hi Friends,
                      Can anyone send me a Step- by- Step on How to Load Excel data into Crystal Reports? Pls help me. Thanks in Advance.
    Vijay

    It's also important to 'prep' the excel file prior to connecting to it.
    Give the data tab a meaningful name
    Make sure the column headers are unique and that every column has a header
    Delete any blank tabs
    If you have trouble with Excel changing the data type of a field (say, a social security number you want to be a string value rather than a number so you don't lose leading zero) an alternative would be to save the spreadsheet file as a CSV, create a schema.ini to specify the data types for each column (example below) and use the same steps to connect except instead of choosing Excel 8.0, scroll to the bottom and choose Text.  You have to make sure the CSV file is in the same folder as the schema.ini file that defines the columns.
    Schema.ini example:
    200912PUSD.csv
    ColNameHeader=True
    Format=CSVDelimited
    MaxScanRows=25
    CharacterSet=OEM
    Col1=SSN Char Width 9
    Col2=LAST_NM Char Width 25
    Col3=FIRST_NM Char Width 25
    Col4=DOB Date
    Col5=STDNT_ID Char Width 10
    Col6=SORTKEY Char Width 10
    Col7=SCHOOL_NM Char Width 30
    Col8=OTHER_ID Integer
    Col9=GRADE Char Width 2
    The filename in the first line needs to have the []  brackets around it, but I couldn't get it to display in this forum correctly.
    Edited by: Eric Petersen on Jan 27, 2010 9:40 AM

  • How do set operation timeout in tomcat server?

    hi all
    suppose i have one endless loop program(jsp) that program run under tomcat server,
    so it's keep on runing in tomcat server.
    i want, after some time the server send error message like operation timeout.
    how do set operation timeout in tomcat server?
    if anybody know help me.
    my mail id [email protected]

    Well, the server.xml file has connection time outs, but that is for idle time, I think... I'm not sure what would happen in a loop... , especially if you are sending some data back to the client in each iteration. Generally you shouldn't be starting a loop that will really run forever. Maybe have some type of counter to break out if something hasn't occurred within x iterations, or create a separate thread that can sleep for x seconds and set a flag to break the loop after that time.

Maybe you are looking for

  • Problem with decimal

    Hi Experts, I'm having a problem with decimal. I have a alv data grid that can be edited.Once I press enter the value for the decimal fields are changed. Example: If i input 5.00 in the field then I press enter it converts it to 0.05 And If I input 2

  • Import data from excel

    Hi, I am using Jdeveloper 11g 11.1.1.5.0 and I want to import data from excel in my table through the jsf page and commit it to database. How can I implement it. Its urgent please help me!!!!!!!!!!!!!!!!!!!!!

  • Should I purchase iphone if I don't live in 3G area?

    I live in a rural area in Alabama. Because of AT&T, 3G is not accessible. Also, voice quality is moderate. Would an iphone work in this area? If so, would I be able to use it for most things, apps. etc. What in the world is 3G? Please advice, I reall

  • Cannot access/change APN with iPhone 4.1 (Celluar Data Networking Missing)

    I updated my iPhone 3GS from 4.0 to 4.1 last night and this morning I notice when trying to retrieve mail I receive the error "You are not subscribed to a cellular data service" and I cannot access mail, the web or use any data related applications.

  • My computer is not opening mail it has a small apple sign in front of it

    My computer wont let me restart it as my mail is not working