Hi:
I am developing an web application where I have Crystal Reports which I need to provide print option for users. I also don't like to use CR Toolbar. I created an ASP button (PDF Print) where I write code for converting CR into .pdf and popup the .pdf file. When I run the application on my local machine it works fine but when I run it from server and click the PDF Print button it shown the logon page. Also it's not working after providing the logon credentials. Here is my code fro converting and printing CR:
protectedvoidButton1_Click(objectsender,EventArgse){
ReportDocumentRpt =newReportDocument();//report path in applicationstringreportPath =Server.MapPath("Reports\\14DaysReport.rpt");Rpt.Load(reportPath);CRConnectionInfoconnectionInfo =newCRConnectionInfo();CRConnectionInfo.SetDBLogonForReport(connectionInfo,Rpt);//Rpt.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "BiWeeklyReport.pdf");Rpt.ExportToDisk(ExportFormatType.PortableDocFormat,@"C:\BiWeeklyReport.pdf");stringpopupScript="<script language='javascript'>"+"window.open('C:/BiWeeklyReport.pdf');</script>" ;
}
in SetDBLogonForReport() method I already provided the logon credentials.
Any code help is highly appreciated.
Thanks in advance.
Maksuda...