W celu wdrożenia szybkiej automatyzacji generowania raportów Crystal Reports można zastosować skrypt Power Shell.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param([String[]] $filename, [Int32] $param0) | |
[reflection.assembly]::LoadWithPartialName('CrystalDecisions.Shared') | |
[reflection.assembly]::LoadWithPartialName('CrystalDecisions.CrystalReports.Engine') | |
$report = New-Object CrystalDecisions.CrystalReports.Engine.ReportDocument | |
$report.Load($filename) | |
$report.SetDatabaseLogon('username','password') | |
$report.SetParameterValue("param0", $param0) | |
$report.ExportToDisk("Excel", "c:\temp\report.xls") | |
$report.ExportToDisk("PortableDocFormat", "c:\temp\report.pdf") |
Komentarze
Epicforce Tech