Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li><p>Execute a Dataset to fill data from the oracle storedprocedure. Make sure The table names in the dataset are same as the name of the database object based on which the report was designed.(Stored Procedure name in this case)</p></li> <li><p>Do not provide any logoninfo. <strong>This is important</strong>.</p></li> <li><p>Set all report parameters but dont provide any data filters as the dataset contains already filtered data.</p></li> <li><p>do the data binding manually.</p> <p><em>doc.SetDataSource=yourdatasource;</em></p></li> </ol> <p>now proceed with report export as usual.</p> <p>This is <strong>Push Model</strong> way of populating report. Generally i use oledb dataadapter for oracle for designing reports. But if you are dealing with stored procedures then Push model is the only way. The designer can access the oracle SP and populate the report but In the application you have to take care of it otherwise you will be presented with annoying popup asking the Stored Procedure Parameter value.</p> <p>Here is some code </p> <pre><code>OracleConnection cn = new OracleConnection("Data Source=yourdbname;User ID=someid;password=somepw;Pooling=true;Connection Lifetime=30;Min Pool Size=5;Max Pool Size=100"); OracleParameter DETAILS = new OracleParameter(); DETAILS.ParameterName = "DETAILS"; DETAILS.Direction = ParameterDirection.Output; OracleParameter NN = new OracleParameter(); NN.ParameterName = "PRODUCT"; NN.Direction = ParameterDirection.Input; NN.Value = 1000; // Some product id OracleParameter DD = new OracleParameter(); DD.ParameterName = "TRDATE"; DD.Direction = ParameterDirection.Input; DD.Value = “09-DEC-2008”; // Some Date // for Oracle.DataAccess.Client use the following DETAILS.OracleDbType = OracleDbType.RefCursor; NN.OracleDbType = OracleDbType.Varchar2; DD.OracleDbType = OracleDbType.Date; // for System.Data.OracleClient use the following //DETAILS.OracleType = OracleType.Cursor; //NN.OracleType = OracleType.VarChar; //DD.OracleType = OracleType.DateTime; OracleCommand cmd = new OracleCommand("Myschemaname.GETSTOCK", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(NN); cmd.Parameters.Add(DD); cmd.Parameters.Add(DETAILS); OracleDataAdapter da = new OracleDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds,"GETSTOCK"); //Name must be same as Procedure ReportDocument rptDoc = new ReportDocument(); rptDoc.Load(Server.MapPath("FINC//abc.rpt")); rptDoc.SetDataSource(ds); CRT.ReportSource = rptDoc; // CRT is the name of Crystal report viewer control // your export routine goes here </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload