Venkat P

Venkat P

  • NA
  • 9
  • 0

Problem while Exporting Crystal report using dataset as source

May 29 2008 1:22 AM

Hi All,

Is the 'Export' icon (on the crystal report tools tab) works if i use dataset as the crystal report source??? I'm facing some problem. I'm able to view the report but while exporting i am getting an error. The error is "The report you requested requires further information" and it is asking for Dataset logon information. How do i resolve this..plz guide me.

The details:

I'm using VS2005. I've created one crystal report using data sets as source. I've implemented this on a web page. The logic i've written is.....When the user clicks the button 'Get Report', the data set gets populated from a query and that dataset used as source to the crystal report and finally displaying the report.

Please check the sample code below..i havent written the mainsteps..Please tell me where did i go wrong...!!

Page_Load(object sender, EventsArgs e)

{

}

ButtonGetReport_Click(object sender, EventsArgs e)

{

    try{

//Created the report object..

ReportDocument report = new ReportDocument();

report.Load(Server.MapPath("Report1.rpt"));

//created database connection

//populated the dataset

DynamicReportDemo3DataSet dset = new DynamicReportDemo3DataSet();

//DynamicReportDemo3DataSet created in the project..

sqldadapter.SelectCommand = new SqlCommand("select * from employee", conn);

sqldadapter.Fill(dset, "DataTable1");

//set the dataset as the reportsource

report.SetDataSource(dset);

//set the report object as the crystalreportviewer1 source

CrystalReportViewer1.ReportSource = report;

CrystalReportViewer1.Visible = true;

}

catch(Exception ex)

{

}

finally

{

   //closing the database connection..

}

}