"Push" method for crystal report
-
Im trying to code a crystal report which gets the information from a dataset, I have the C# code to bind the data but i need the vb code, or if anyone knows of a good example on the net that might help. Thanks, Colum private void Page_Load(object sender, System.EventArgs e) { CrystalReport1 report=new CrystalReport1(); CrystalReportViewer1.Visible=true; DataSet ds=new DataSet("Account");//give same name as on //dataset1 table header DataTable table=new DataTable("Account");//give same name as on //dataset1 table header table.Columns.Add("Fname",typeof(System.String)); table.Columns.Add("Lname",typeof(System.String)); table.Columns.Add("Salary",typeof(System.String)); DataRow row=table.NewRow(); row["Fname"]="Mathew"; row["Lname"]="Hayden"; row["Salary"]="5000$"; // add to table table.Rows.Add(row); ds.Tables.Add(table); // set report's dataset report.SetDataSource(ds); // set report source CrystalReportViewer1.ReportSource =report; }
-
Im trying to code a crystal report which gets the information from a dataset, I have the C# code to bind the data but i need the vb code, or if anyone knows of a good example on the net that might help. Thanks, Colum private void Page_Load(object sender, System.EventArgs e) { CrystalReport1 report=new CrystalReport1(); CrystalReportViewer1.Visible=true; DataSet ds=new DataSet("Account");//give same name as on //dataset1 table header DataTable table=new DataTable("Account");//give same name as on //dataset1 table header table.Columns.Add("Fname",typeof(System.String)); table.Columns.Add("Lname",typeof(System.String)); table.Columns.Add("Salary",typeof(System.String)); DataRow row=table.NewRow(); row["Fname"]="Mathew"; row["Lname"]="Hayden"; row["Salary"]="5000$"; // add to table table.Rows.Add(row); ds.Tables.Add(table); // set report's dataset report.SetDataSource(ds); // set report source CrystalReportViewer1.ReportSource =report; }
Well, I'd normally say just run it through one of the C#/VB.NET code translators on the 'Net, but you have an object in that code snippet that doesn't exist in the Page_Load function, 'table'. See this Yahoo search[^] for a list of translators. RageInTheMachine9532