Hallo,
Ich benutze den List & Label ReportServer 23.
Es besteht ein Report auf dem Reportserver, der mehr als 1 Berichtsparameter hat. Per Weboberfläche kann ich den Report exportieren und alle Parameter (wichtig: mehr als einer) werden wunderbar berücksichtigt. Versuch ich den selben Report per API mit den selben Parametern, die ich auch auf der Weboberfläche benutzt habe, zu exportieren bekomme ich einen leeren Report zurück. Ich habe den Report mit eurem Beispielprogramm (Beispiel: C# ClientApiSample, Klasse: ExportReportDialog, Methode: btnExportOrPrint_Click) ebenfalls ausprobiert. Hier kommt der selbe Fehler zustande. Der exportierte Report ist leer, obwohl er mit den Parametern Ergebnisse zurückliefern müsste.
Hier die Funktion in der die Parameter hinzugefügt werden.
string reportTemplateId = (cbReportTemplate.SelectedItem as ReportTemplate).Id;
string exportProfileId = (cbExportProfile.SelectedItem as ExportProfileBase)?.Id; // with null as export profile, the default export profile of the report template will be used
// Prepare an export and set the options:
PreparedReport preparedExport = _rsClient.Exporter.PrepareExport(reportTemplateId, exportProfileId);
preparedExport.DisableCaching = chkDisableCache.Checked;
// Copy the rows of the report parameter listview to the report parameter list of the export:
foreach (ListViewItem listViewItem in lvReportParameters.Items)
{
string parameterName = listViewItem.Text;
object paramterValue = listViewItem.Tag;
preparedExport.ReportParameters.Add(parameterName, paramterValue);
}
// Now we need to check what kind of export profile was selected:
// For file exports, we need to wait until the export is completed on the server and then download the files
if (cbExportProfile.SelectedItem is ExportProfile)
{
await ExportAndDownloadFiles(preparedExport);
}
Nun meine Fragen:
Kann es sein, dass dem Codeabschnitt noch was hinzugefügt werden muss, damit mehrere Parameter berücksichtigt werden?
Habe ich eine Einstellung im Report Designer selber übersehen?
Mit freundlichen Grüßen
Luca