private void ConfigureCrystalReports()
{
if (!IsPostBack)
{
crystalReportViewer.Visible = false;
}
string reportPath = ("~/customreports/CURRINV_GL_NOLOT_PROD.rpt");
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = "Ross_Data";
connectionInfo.DatabaseName = "fin_prod";
connectionInfo.UserID = "xxx";
connectionInfo.Password = "xxx";
crystalReportViewer.ReportSource = reportPath;
SetDBLogonForReport(connectionInfo);
}
protected void ddlWarehouse_SelectedIndexChanged(object sender, EventArgs e)
{
string warehouse = ddlWarehouse.SelectedValue;
string selectFormula = "{VW_CURRENT_INVENTORY_GL.WH}=" + "'" + warehouse + "'";
crystalReportViewer.SelectionFormula = selectFormula;
crystalReportViewer.Visible = true;
crystalReportViewer.DataBind();
}
private void Page_Init(object sender, EventArgs e)
{
ConfigureCrystalReports();
}
private void SetDBLogonForReport(ConnectionInfo connectionInfo)
{
TableLogOnInfos tableLogOnInfos = crystalReportViewer.LogOnInfo;
foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
{
tableLogOnInfo.ConnectionInfo = connectionInfo;
}
}
private void ConfigureCrystalReports()
{
if (!IsPostBack)
{
crystalReportViewer.Visible = false;
}
string reportPath = ("~/customreports/BillOfLading2.rpt");
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = "Ross_Data";
connectionInfo.DatabaseName = "fin_prod";
connectionInfo.UserID = "xxx";
connectionInfo.Password = "xxx";
crystalReportViewer.ReportSource = reportPath;
SetDBLogonForReport(connectionInfo);
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
string bol = txtbol.Text;
string selectFormula = "{VW_BOL_DESPATCH_HEADER.DESPATCH_NOTE_TEXT}=" + "'" + bol + "'";
crystalReportViewer.SelectionFormula = selectFormula;
crystalReportViewer.DataBind();
crystalReportViewer.Visible = true;
}
private void Page_Init(object sender, EventArgs e)
{
ConfigureCrystalReports();
}
private void SetDBLogonForReport(ConnectionInfo connectionInfo)
{
TableLogOnInfos tableLogOnInfos = crystalReportViewer.LogOnInfo;
foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
{
tableLogOnInfo.ConnectionInfo = connectionInfo;
}
}
Were the reports that don't open, developed on your machine or by someone else?
Can you open the reports in Crystal and change the data source?
mlmcc