Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
Crystal Reports e reportistica
Errore Crystal Report
giovedì 02 agosto 2012 - 16.33
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
LuigiJin
Profilo
| Newbie
10
messaggi | Data Invio:
gio 2 ago 2012 - 16:33
Salve, ho un errore di questo tipi:
Logon failed.Error in File C:\WINDOWS\TEMP\ReportElencoDifettiMarelli {7A7DF568-DF94-4C24-8FF7-403D28CF2126}.rpt:
Unable to connect: incorrect log on parameters.
Descrizione: Eccezione non gestita durante l'esecuzione della richiesta Web corrente. Per ulteriori informazioni sull'errore e sul suo punto di origine nel codice, vedere l'analisi dello stack.
Dettagli eccezione: System.Runtime.InteropServices.COMException: Logon failed.Error in File C:\WINDOWS\TEMP\ReportElencoDifettiMarelli {7A7DF568-DF94-4C24-8FF7-403D28CF2126}.rpt:
Unable to connect: incorrect log on parameters.
Errore nel codice sorgente:
Riga 84: report.Refresh();
Riga 85:
Riga 86: report.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Server.MapPath("~/Marelli2/StampaSchedaLavoro/") + @"\" + MyIdScheda + "Dif.pdf");
Riga 87:
Riga 88: Response.ContentType = "application/pdf";
non riesco a risolvere il problema.
questo è il mio codice
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CrystalDecisions.CrystalReports.Engine;
using System.Data.OleDb;
using System.Data;
using CrystalDecisions.Shared;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string MyIdScheda = Request.QueryString["IdScheda"];
string MyIdUtente = Request.QueryString["IdUtente"];
ReportDocument report = new ReportDocument();
string reportPath = System.Web.HttpContext.Current.Server.MapPath("~/") + @"\Report.rpt";
OleDbConnection conn = new OleDbConnection("Stringa");
string sql = @"SELECT * From Tab";
OleDbDataAdapter adapter = new OleDbDataAdapter(sql, conn);
DataSet dataSet = new DataSet();
adapter.Fill(dataSet);
report.Load(reportPath);
report.DataSourceConnections[0].SetConnection("NomeServer", "DB", "User", "Psw");
report.SetDataSource(dataSet.Tables[0]);
report.Refresh();
report.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Server.MapPath("~/") + @"\" + MyIdScheda + "Dif.pdf");
Response.ContentType = "application/pdf";
Response.Redirect("~/" + MyIdScheda + "Dif.pdf");
Response.End();
}
}
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !