// Dateinamen für Projekt und Ergebnis ermitteln
string
ProjectFile = Server.MapPath(
string
.Empty) +
@"\Reports\"
+ reportName;
Filename =
Path
.ChangeExtension(ProjectFile, "PDF");
TempDir =
Path
.GetDirectoryName(Request.PhysicalPath) +
@"\temp\"
+ Session.SessionID;
if
(!
Directory
.Exists(TempDir))
Directory
.CreateDirectory(TempDir);
// Optionen so setzen, dass Druck ohne Interaktion erfolgen kann
LL.AutoShowSelectFile =
false
;
LL.AutoShowPrintOptions =
false
;
LL.AutoDesignerFile = ProjectFile;
LL.AutoDestination =
LlPrintMode
.Export;
// Export-Optionen so setzen, dass Druck ohne Interaktion erfolgen kann
LL.ExportOptions.Add(
"Export.Target"
, Format);
LL.ExportOptions.Add(
"Export.File"
, Filename);
LL.ExportOptions.Add(
"Export.Path"
, TempDir);
LL.ExportOptions.Add(
"Export.Quiet"
,
"1"
);
// Datenquelle zuweisen
LL.DataSource = dataSource;
// Druck
LL.Print();
// Ergebnis anzeigen - hier z.B. in einem iframe
siteName =
"displayPDFfile.aspx?file="
+ Session.SessionID +
"/"
+ Filename;
myiframe.Attributes[
"src"
] = siteName