Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

A number, currency amount, boolean, date, time, date-time, or string is expected here

$
0
0

I have used below code for showing report, it should be filterd by value of another page for excample (0013-SA-PPI/SEP-TT-0064) that takes by query string.

When I run the page it takes the value but it has below error.

 

'{tblTranstoCon.TRANSMITtoCon} = 0013-SA-PPI/SEP-TT-0064' A number, currency amount, boolean, date, time, date-time, or string is expected here.

public partial class TransmittalReport : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
         //Rebind the report.
         BindReport();
    }

    private void BindReport()
    {
        ReportDocument report = new ReportDocument();
        report.Load(Server.MapPath("Transmittal.rpt"));

        SetTableLocation(report.Database.Tables);

        CrystalReportViewer1.ReportSource = report;

        report.DataDefinition.RecordSelectionFormula ="{tblTranstoCon.TRANSMITtoCon} = " + Request.QueryString["transmittocon"].ToString();
    }

    private void SetTableLocation(Tables tables)
    {
        ConnectionInfo connectionInfo = new ConnectionInfo();

        connectionInfo.ServerName = @"home-c5198b1aaf";
        connectionInfo.DatabaseName = "EDMS";

        foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
        {
            TableLogOnInfo tableLogOnInfo = table.LogOnInfo;
            tableLogOnInfo.ConnectionInfo = connectionInfo;
            table.ApplyLogOnInfo(tableLogOnInfo);
        }
    }
}




Viewing all articles
Browse latest Browse all 1507

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>