Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,
i am used report viewer in my webapplication, i downloaded data from webform to pdf, it is successfully working in my local system, but when i was hosted at server it does not work, even i put put dll's on bin folder also
shows below error
VB
at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.GetSecureMethods()
   at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.IsSecureMethod(String methodname)
   at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.SetConnectionSSLForMethod(String methodname)
   at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn](RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1 retryMethod)
   at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID)
   at Microsoft.Reporting.WebForms.ServerReport.EnsureExecutionSession()
   at Microsoft.Reporting.WebForms.ServerReport.SetParameters(IEnumerable`1 parameters)


can any body suggests me...
Posted
Updated 3-Oct-13 9:39am
v2
Comments
ZurdoDev 3-Oct-13 13:53pm    
What's the actual error? This is just a stack trace.
Sergey Alexandrovich Kryukov 3-Oct-13 16:53pm    
What's the use of the stack trace if you don't show your code?
—SA
Member 10042721 3-Oct-13 23:56pm    
LocalReport Report = new LocalReport();
DataSet dsReport = new SFIS_NEWDataSet(); // dataSet Feom database
try
{
objquotationdc.Quotationid = Convert.ToInt16(quotationid.Text);
dsReport = objquotationbl.get_quot_dets_pdf(objquotationdc);
if (dsReport.Tables[0].Rows.Count == 0)
{
return;
}
ReportDataSource reportrds = new ReportDataSource();
reportrds.Name = "DataSet1";
reportrds.Value = dsReport.Tables[0];
Report.DataSources.Add(reportrds);
Report.ReportPath = Server.MapPath("~") + "\\Samp_Quotation.rdlc";
Report.ReportEmbeddedResource = Server.MapPath("~") + "\\Samp_Quotation.rdlc";
Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string filenameExtension;

byte[] bytes = Report.Render(
"PDF", null, out mimeType, out encoding, out filenameExtension,
out streamids, out warnings);

using (FileStream fs = new FileStream(Server.MapPath("~") + "\\Customer_Pdf\\MWFTS_Quotation_" + quotationid.Text + ".pdf", FileMode.Create))
{
fs.Write(bytes, 0, bytes.Length);
}


}
catch (Exception ex)
{
WebFormMaster.WriteToErrorLog("", ex);
}




protected void btnview_Click(object sender, EventArgs e)
{
try
{

sample_rep();
string FilePath = Server.MapPath("~") + "\\Customer_Pdf\\MWFTS_Quotation_" + quotationid.Text + ".pdf";
System.IO.FileInfo TargetFile = new System.IO.FileInfo(FilePath);
if (TargetFile.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + TargetFile.Name);
Response.AddHeader("Content-Length", TargetFile.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(TargetFile.FullName);
}

}
catch (Exception exp)
{
WebFormMaster.WriteToErrorLog("", exp);
}
}

1 solution

Your code is writing files to disk and this requires the asp.net windows account to have such permission. It's possible that your hosting services is not allowing you to do that so contact them for further details.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900