Problem in crystalreport viewer

  • Thread starter Thread starter Pattabi
  • Start date Start date
P

Pattabi

Hi!!!!!!!!!!
I am developing .net project without using visual studio.net
environment.
I have created a report in crystal reports 9.0.
I have written my code in c# to export and open the report. My
export is done perfectly where as my crystal report viewer part, gives
me the following error

CrystalReportViewer - crystalReportViewer1
Use the ReportSource or DataBindings property to specify a report
source.

Can anyone please help me in this, I will be really helpful for me

Thanks in advance

Regards
Dharani
 
Based on the error(you have not provided any code), you
are not telling the Crystal Report viewer which report to
show.

You need to do something like:
CrystalReportViewer1.ReportSource = rpt;
where rpt is your typed report object (an instance of the
class associated with the report you create.)
 
Hi,
Thanks for your reply.

yes i have used the same code as u told. here is my code

crystalReportViewer1.Visible = true;
crystalReportViewer1.ReportSource = crReportDocument;

I am want to remind that i am not using .net IDE. just doing everything
manually. please help further

thanks
dharani
 
Hi,

You need to create a report document and populate it with which rpt and
connection info:

crReportDoc = new ReportDocument();

crReportDoc.Load(path + "\\" + rptName);

cfCrystalReportsUtility.ReportDocumentSetLocation(crReportDoc,
ConnString);// Connection info

:

Do your other stuffs like param, record selection formula

:

CRViewer.ReportSource = crReportDoc;



elvin
 
Back
Top