Sì, voglio esportare report SSRS nel PDF e restituirlo dalla mia azione, Non ho alcun visualizzatore di report. Vi prego di suggerire come posso ottenere questo. Finora ho fatto questoEsportazione di report SSRS in PDF in MVC Azione
public void SqlServerReport()
{
NetworkCredential nwc = new NetworkCredential("username", "password", "domain");
WebClient client = new WebClient();
client.Credentials = nwc;
string reportURL = "http://servername/ReportServer/reportfolder/StateReport&rs:Command=Render&rs:Format=PDF";
Byte[] pageData = client.DownloadData(reportURL);
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "attachment; filename=" + DateTime.Now);
Response.BinaryWrite(pageData);
Response.Flush();
Response.End();
}
Sopra codice genera un'eccezione
"The remote server returned an error: (401) Unauthorized."
Le mie domande sono
1) sto andando in direzione giusta?
2) C'è qualche alternativa migliore per raggiungere questo obiettivo?
Come mai non si ottiene un 401 utilizzando un
JoshYates1980