Click here to Skip to main content
15,893,668 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
is it possible to show the crystal report value at runtime.
i want to take one textbox and pass the date value, up to that date all record must be show from database.

how does it done?
please help
Posted

 
Share this answer
 
Comments
Ashishmau 4-May-11 0:42am    
good link my5
suvaaj 21-May-11 6:31am    
i tried it(my aspx form) but it not work i used same code as u give in ur ex.but at runtime it gives runtime another textbox with calender & submit button when date insert into that else where not work.
thatraja 21-May-11 11:25am    
So you have two parameters in that report? clear that. Also include your code in your question. I can help you.
suvaaj 21-May-11 6:32am    
i tried it with windows form it work nicely so i give 5 to it but i need help for .aspx form please help me.
thatraja 21-May-11 11:27am    
i tried it with windows form it work nicely
That's fine.
but i need help for .aspx form
what? tell me about that, BTW read my another reply to your another comment.
using System;

using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
public partial class Pages_ReportLoader : System.Web.UI.Page
{
    ReportDocument reportDocument = new ReportDocument();
    ParameterField paramField = new ParameterField();
    ParameterFields paramFields = new ParameterFields();
    ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            paramField.Name = "@Dept"
            paramDiscreteValue.Value = "CS";
            paramField.CurrentValues.Add(paramDiscreteValue);
            paramFields.Add(paramField);
            CrystalReportViewer1.ParameterFieldInfo = paramFields;
            reportDocument.Load(Server.MapPath("CrystalReportTest.rpt"));
            CrystalReportViewer1.ReportSource = reportDocument;
            reportDocument.SetDatabaseLogon(---connectionstring---);

        }

    }

    protected void btnShowReport_Click(object sender, EventArgs e)

    {
        paramField.Name = "@Dept";
        paramDiscreteValue.Value = txtParamDept.Text.ToString();
        paramField.CurrentValues.Add(paramDiscreteValue);
        paramFields.Add(paramField);
        CrystalReportViewer1.ParameterFieldInfo = paramFields;
        reportDocument.Load(Server.MapPath("CrystalReportTest.rpt"));
        CrystalReportViewer1.ReportSource = reportDocument;
        reportDocument.SetDatabaseLogon(--connection string--);

    }

}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900