Click here to Skip to main content
15,906,947 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
cryRpt rptform = new cryRpt();
            ReportDocument rptFile = new ReportDocument();
            rptform.Text = ".........";
            rptFile.Load(Application.StartupPath + "\\mainR.rpt");
            rptform.crys.ReportSource = rptFile;
            rptFile.SetDatabaseLogon("admin", "lbbs");
            rptFile.DataDefinition.FormulaFields["CmpName"].Text = "'" + MainCon.cmNme + "'";
            rptFile.DataDefinition.FormulaFields["CmpAdd1"].Text = "'" + MainCon.cmAdd + "'";
            rptFile.DataDefinition.FormulaFields["CmpAdd2"].Text = "'" + MainCon.cmAddr + "'";
            rptform.crys.RefreshReport();
            rptFile.Refresh();
            
            rptform.crys.Show();
            rptform.Show();


I have problem when I show report there are no data show in report .

please help me.
Posted
Updated 4-Oct-10 4:02am
v3
Comments
Hiren solanki 4-Oct-10 10:02am    
added 'pre' tags for code visibility.

I think you forgot,

rptFile.SetDataSource()
Method

Hope it Helps.
 
Share this answer
 
Comments
raj_raje 4-Oct-10 10:12am    
i set crystal report with dsn so how to set datasourse plz hlp
Hey.. you forget to bind the report :-) from a source!!! :)
rptFile.SetDataSource(DataSet or Table source!)
 
Share this answer
 

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