Joined: 15 Mar 2010
Online Status: Offline
Posts: 5
Topic: Push Data in Crystal Reports from DataSet Posted: 31 Mar 2010 at 5:00am
Hi,
I have the following problem: I want to do these steps:
1. load a report 2. export it as html 3. analyse the html 4. edit the report data 5. export it as pdf
because i have to edit the report data, I want to store it in a dataset in order to manipulate it and push it in the report again.
this is my code:
SqlConnection conn = new SqlConnection("Data Source=server;Database=dbname;Integrated Security=SSPI"); SqlCommand command = new SqlCommand("storedProcName", conn); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@param1", SqlDbType.NVarChar).Value = "test"; conn.Open(); SqlDataAdapter adapter = new SqlDataAdapter(command); DataSet ds = new DataSet(); adapter.Fill(ds); ReportDocument rptClass = new ReportDocument(); rptClass.Load("filename"); rptClass.SetDataSource(ds); ... rptClass.Export() <---------- askes for DB login and parameters
But if I use this code, I get asked for the DB login and parameters and the report
loads from db again but not from the dataset. But I don't want CR to load the report data from DB again. I want it to use the dataset and not asking for any login stuff.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum