2017-03-16 24 views
2

對於Asp.net MVC獲得PDF格式的報告,我有Stimulsoft 2015年問題的工作是,我不知道如何將我的代碼轉換,以便與Stimulsoft核心在Asp.net的核心工作。似乎有些功能在Stimulsoft Core中不再可用(如StiReport)。

這是在Asp.net MVC正常工作Migirating到Stimulsoft核心

public ActionResult GetReportSnapshot(string sort) 
    { 

     StiReport report = new StiReport(); 
     report.Load(Server.MapPath("~/Reports/Jobs.mrt")); 

     report["@PrjectId"] = 1; 
     report["@OrderBy"] = sort; 
     report.Dictionary.Variables["title"] = new Stimulsoft.Report.Dictionary.StiVariable("title", sort); 

     report.Render(); 
     MemoryStream stream = new MemoryStream(); 
report.ExportDocument(StiExportFormat.Pdf, stream); 
     stream.Position = 0; 
     FileStreamResult fsr = new FileStreamResult(stream, "application/pdf"); 
     return fsr; 
    } 

我會感謝所有幫助的代碼。

回答

0

你使用了哪些nuget軟件包?這可能是你錯過了包含StiReport類的nuget包。 (我看他們分手了他們的圖書館在多次的NuGet包)

而且這可能是他們沒有遷移這部分的dotnet核心呢。 我建議你點擊那裏github回購,看看你是否可以找到任何信息:https://github.com/stimulsoft,或在那裏的網站。

通過他們最近纔開始遷移到dotnet的核心所以這會想我的第二個建議是正確的建議的NuGet的樣子。 enter image description here

+0

我使用stimulsoft核心NuGet包,並且只有一個包中的NuGet包管理器.NET的核心。我認爲他們已經完成了核心版本,但似乎他們仍在努力 –