on 01-29-2015 7:54 AM
Hi,
I am trying to export dynamically to pdf and excel. this coding was working fine before update pack 12. after updating pack 12, it gives error "Method not found", even roll back pack 12 and update pack 10, it gives same error. I have tried all the possibilities to resolve, but to fail. kindly help me to resolve it. i am adding code for reference.
Madhavarao
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Web;
string reportPath = "c:\\RptReports\\COA_QC_new.rpt";
ReportDocument reportDocument = new ReportDocument();
reportDocument.Load(reportPath);
ParameterFieldDefinitions pfdDefinitions = reportDocument.DataDefinition.ParameterFields;
ParameterValues pvValues = new ParameterValues();
ParameterDiscreteValue pdvDiscreteValue = new ParameterDiscreteValue();
pdvDiscreteValue.Value = txtQC.Text;
pvValues.Add(pdvDiscreteValue);
ParameterFieldDefinition prdDefinition = pfdDefinitions["qono"];
prdDefinition.ApplyCurrentValues(pvValues);
CrystalDecisions.CrystalReports.Engine.Tables CrTables = reportDocument.Database.Tables;
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
CrystalDecisions.Shared.ConnectionInfo crConnectionInfo = new CrystalDecisions.Shared.ConnectionInfo();
crConnectionInfo.UserID = "uml";
crConnectionInfo.Password = "uml";
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
reportDocument.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "c:\\temp\\" + Session["filename"].ToString() + ".pdf");
I have also tried with this code, but gives same error.
reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "c:\\temp\\" + Session["filename"].ToString() + ".pdf");
Hello,
Try viewing the report in the WEB Viewer and use it's export button and see what happens. It could be the DB is failing to log on now or your permissions on c:\temp has changed.
By the way, you should not use c:\temp any more. Microsoft changed the default folder for \temp files and I have personally run into other software issues when that folder existed.
Try renaming it to c:\temp1 and set the permissions for IIS on that new folder and see what happens.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If it works from the viewer then something in your code needs to be updated. It could be some new Enhancement in the API's may require you to recompile your application.
SP 13 was just release, give that a try.
Also, in this line of your code try try hard coding the report file name:
"c:\\temp\\" + Session["filename"].ToString() + ".pdf");
To:
"c:\\temp\\Test.pdf"); // " + Session["filename"].ToString() + ".pdf");
May be something with the Session GUID causing the problem. You need to debug this yourself.
Don
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.