I have two tables Customer and Contract Table
CustomerTable
CustID(pk)
CustName
CompanyName
ContractTable
ContractID(pk)
CustID(fk)
ContractDate
ContractDuration
TotalPayment
TotalInstallment
TotalCommission
I’m trying to create a crystal report to display customers of this month like this
|CustID||CustName||ContractDuration||TotalPayment||TotalCommission|
| || || || || |
Total |200 || || $20,000 || $200 |
After installing crystal reports for visual studio2010 from SAP i made crystal report using graphical interface and put this code in form_load event
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load("C:\\Documents and Settings\\Administrator\\my documents\\visual studio 2010\\Projects\\democrystal1\\democrystal1\\CrystalReport1.rpt");
crystalReportViewer1.ReportSource = cryRpt;
crystalReportViewer1.Refresh();
when i run the project it prompt me to enter userid and password but i’m using windows authentication from SSMS what userid and password now i put in? and if i use a view to generate crystal report from it how that view looks like?
You may need to tell the report specifically when you load it to use Integrated Security like you want. Here’s a blog post I made a while back, scroll down to where the “ApplyNewServer” method is and that should get you started.
http://www.blakepell.com/Blog/?p=15
That method was taken out of a larger class. You’ll see that I was referencing properties for username/password, etc. Using a method like this will loop through your report and all the sub reports and apply the connection info you specify. I should really just turn this into an extension at some point.
Hope this puts you in the right direction, if not, let me know what additional questions you have.