Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Push Data in Crystal Reports from DataSet Post Reply Post New Topic
Author Message
bembi
Newbie
Newbie


Joined: 15 Mar 2010
Online Status: Offline
Posts: 5
Quote bembi Replybullet 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.


what am I doing wrong?

Thanks
Juergen


IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.016 seconds.