Qui ho usato abbonamento tempestivo, ho avuto necessità di generare il rapporto su qualche pulsante di scatto, così ho creato sottoscrizione che sarà il fuoco dopo un minuto e generare report PDF. E ho avuto tutto l'aiuto di questo articolo: http://odetocode.com/articles/114.aspx
È necessario aggiungere riferimento webservice di webservice fornito da SSRS http://mymachine/ReportServer/ReportService2010.asmx
Qui @ "\ MyMachineName \ Share", è il percorso in cui il mio pdf è stato conservato (pERCORSO: il percorso della cartella o UNC condivisione file percorso in cui salvare il rapporto https://msdn.microsoft.com/en-us/library/ms154020.aspx.)
così si può chiamare generare abbonamento secondo le vostre necessità sul file creato.
using Test_WebProject.ReportService2010;
private static ExtensionSettings GetExtensionSettings()
{
ParameterValue[] extensionParams = new ParameterValue[7];
for (int i = 0; i < extensionParams.Length; i++)
extensionParams[i] = new ParameterValue();
extensionParams[0].Name = "FILENAME";
extensionParams[0].Value = "[email protected]";
extensionParams[1].Name = "FILEEXTN";
extensionParams[1].Value = "true";
extensionParams[2].Name = "PATH";
extensionParams[2].Value = @"\\MyMachineName\Share";
extensionParams[3].Name = "RENDER_FORMAT";
extensionParams[3].Value = "PDF";
extensionParams[4].Name = "WRITEMODE";
extensionParams[4].Value = "None"; //"Overwrite ";// "AutoIncrement";
extensionParams[5].Name = "USERNAME";
extensionParams[5].Value = "gmd";
extensionParams[6].Name = "PASSWORD";
extensionParams[6].Value = "password123";
ExtensionSettings extensionSettings = new ExtensionSettings();
extensionSettings.Extension = "Report Server FileShare"; // EXTENSION_FILESHARE;
extensionSettings.ParameterValues = extensionParams;
return extensionSettings;
}
static void generateSubscription()
{
string report = @"/MyReports/TestSSRSSubscrptionReport";
string description = "My Test subscription2010";
string eventType = "TimedSubscription";
ExtensionSettings extSettings = GetExtensionSettings();
List<ReportService2010.ParameterValue> parameters = new List<ReportService2010.ParameterValue>();
parameters.Add(new ReportService2010.ParameterValue() { Name = "EmployeeKey", Value = "9" });
parameters.Add(new ReportService2010.ParameterValue() { Name = "SelectedColumn", Value = "EmployeeKey" });
parameters.Add(new ReportService2010.ParameterValue() { Name = "ParamSelectedColumns", Value = "FirstName" });
parameters.Add(new ReportService2010.ParameterValue() { Name = "ParamSelectedColumns", Value = "LastName" });
NetworkCredential credentials = new NetworkCredential("gmd", "password123");
ReportService2010.ReportingService2010 rs = new ReportService2010.ReportingService2010();
rs.Credentials = credentials; // System.Net.CredentialCache.DefaultCredentials;
DateTime topDatetime = DateTime.Now;
topDatetime = topDatetime.AddMinutes(1);
string scheduleXml = "<ScheduleDefinition><StartDateTime>";
scheduleXml += topDatetime.ToShortDateString() + " " + topDatetime.ToShortTimeString();
scheduleXml += "</StartDateTime></ScheduleDefinition>";
string sid = rs.CreateSubscription(report, extSettings, description, eventType, scheduleXml, parameters.ToArray());
}
Ho uno script PowerShell utilizzando la funzione di rendering per ottenere il file XML di nuovo per l'analisi di un rapporto di SCCM per i nomi di computer associati a un parametro nome utente. Non ha ancora fallito e sembra solido e affidabile. – ssaviers
Brian, grazie mille. Questo era il tipo di soluzione che stavo cercando. Ho usato il primo suggerimento per licenziare l'abbonamento tramite SSIS. – AJ01