Hello
in many projects i have used the visual studio builtin crystal reports. now i want to use seagate crystal reports 11 with my new c# application.
the question is "how to connect c# with outside reporting facility like seagate crystal reports?? if someone has a sample code please post the code too."
Regards.
Mansoor
Loading
Prabhu RajaPosted Sep 9, 2011, 2:35 AM
try this. Hope it will be useful
Public void GenerateYourList()
{
OleDbConnection objConn;
OleDbDataAdapter daT1 ;
DataSet DataSet1 ;
String strConnection ;
String strSQL ;
strConnection = "provider=Microsoft.Jet.OLEDB.4.0;data source=" & Application.StartupPath & "\MyCustomers.mdb"
objConn = New OleDb.OleDbConnection(strConnection)
objConn.Open()
strSQL = "SELECT * FROM YourTable"
daT1 = New OleDbDataAdapter(strSQL, objConn)
DataSet1 = New DataSet
daT1.Fill(DataSet1, "YourTable")
rptYourList rpt = New rptYourList // Here rptYourList , may be any type of report
FrmReport.CrystalReportViewer.SelectionFormula = "{YourTable.Status} > " & "''Current''"
rpt.SetDataSource(DataSet1)
FrmReport.CrystalReportViewer.ReportSource = rpt
objConn.Close()
}
----------------------------------
If it helps you, then mark as "Correct Answer"