I managed to do everything correctly in the Oracle connection and everything works for me, but when the web form appears, the report viewer reports nothing. This is my code:
using System;
using System.Data;
using System.Data.OleDb;
using Microsoft.Reporting.WebForms;
namespace VisorRpt.Reportes
{
public partial class Visor : System.Web.UI.Page
{
private string Txt;
private string oradb = "Provider=OraOLEDB.Oracle;Data Source=UMBD;User Id=DESAUMBRELLA;Password=USERDESA;";
public static OleDbConnection Conn;
protected void Page_Load(object sender, EventArgs e)
{
// el valor del reporte y de la empresa debe ser pasado
int NRep = 182; // Número reporte
string NEmp = "C145"; // Código empresa
string NomE; // Nombre de la empresa (Pendiente)
double Tot;
DataTable dt;
OleDbDataAdapter da;
OleDbConnection Conn= new OleDbConnection(oradb);
Conn.Open();
DataSet ds = new DataSet();
Txt = string.Concat("SELECT * FROM M_TIPO_REPORTE WHERE TIPO_REP_ID=",NRep);
da = new OleDbDataAdapter(Txt,Conn);
dt = new DataTable();
da.Fill(dt);
// Comando SQL almacenado
string XSel = Convert.ToString(dt.Rows[0]["SQL_T_REP"]);
da.Dispose();
dt.Dispose();
if (NRep == 182) // Ventas Extendidas
{
Vrx.Text = "Variantes:";
DDVrx.Items.Add("Cliente");
DDVrx.Items.Add("Proveedor");
DDVrx.Items.Add("Vendedor");
DDVrx.Items.Add("Producto");
DDVrx.Items.Add("Agencia");
Txt = string.Concat("SELECT COM_ID,NOM_CLIENTE,SUM(SUBTOTAL) as Stot FROM VM_VENTAS_EXT WHERE "
+ "COM_ID='", NEmp, "' GROUP BY COM_ID,NOM_CLIENTE");
da = new OleDbDataAdapter(Txt, Conn);
dt = new DataTable();
da.Fill(dt);
Tot = Convert.ToDouble(dt.Rows[0]["Stot"]); // Total Ventas
//NomE = Convert.ToString(dt.Rows[0][]); // Nombre empresa
da.Dispose();
dt.Dispose();
RV.LocalReport.DataSources.Clear();
Txt = string.Concat("SELECT COM_ID, NOM_CLIENTE AS NOMBRE, TARIFA, SUBTOTAL, (SUM(V.SUBTOTAL)/", Tot, ") *100 AS STOT, (SUM(V.TARIFA)/", Tot, "1)*100 AS TAR "
+ "FROM VM_VENTAS_EXT WHERE COM_ID='", NEmp, "' GROUP BY COM_ID,NOM_CLIENTE");
da = new OleDbDataAdapter(Txt, Conn);
dt = new DataTable();
ReportDataSource dataB = new ReportDataSource("Ventas", dt);
// Ojo en esta linea hay que colocar el path definitivo
RV.LocalReport.ReportPath = @"\umbrella.local\dfs\data_user\desarrollo1\Documents\Visual Studio 2015\Projects\VisorRpt\VisorRpt\Reportes\RptVentas.rdlc";
var Titulo = new ReportParameter();
var Vtas = new ReportParameter();
RV.LocalReport.SetParameters(new ReportParameter[] { Titulo, Vtas });
RV.LocalReport.DataSources.Add(dataB);
**RV.LocalReport.Refresh();**
}
}
}
}
Even though the Refresh is executed and I have all the Oracle's permissions, it only presents the web page with a couple of controls that I placed to filter later. I appreciate any help.