Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could have your service convert the RDLC into a PDF and send the PDF as a byte array to yor WCF client. The client can then save the byte array as a .pdf file in the temporary file directory, and then ask the OS to launch the default application that registered for handling PDFs (acrobat,...).</p> <p>As an example, here is the method I use in my MVVM viewmodel for a WPF client to download, save and launch a PDF report. The server sends a ReportDTO with the Report as a byte array, and FileName (report name with extension ".pdf"):</p> <pre><code>[DataContract(Name="ReportDTO", Namespace="http://chasmx/2013/2")] public sealed class ReportDTO { /// &lt;summary&gt; /// Filename to save the report attached in &lt;see cref="@Report"/&gt; under. /// &lt;/summary&gt; [DataMember] public String FileName { get; set; } /// &lt;summary&gt; /// Report as a byte array. /// &lt;/summary&gt; [DataMember] public byte[] @Report { get; set; } /// &lt;summary&gt; /// Mimetype of the report attached in &lt;see cref="@Report"/&gt;. This can be used to launch the application registered for this mime type to view the saved report. /// &lt;/summary&gt; [DataMember] public String MimeType { get; set; } } public void ViewReport() { ServiceContracts.DataContract.ReportDTO report; String filename; this.Cursor = Cursors.Wait; try { // Download the report. report = _reportService.GetReport(this.SelectedReport.ID); // Save the report in the temporary directory filename = Path.Combine(Path.GetTempPath(), report.FileName); try { File.WriteAllBytes(filename, report.Report); } catch (Exception e) { string detailMessage = "There was a problem saving the report as '" + filename + "': " + e.Message; _userInteractionService.AskUser(String.Format("Saving report to local disk failed."), detailMessage, MessageBoxButtons.OK, MessageBoxImage.Error); return; } } finally { this.Cursor = null; } System.Diagnostics.Process.Start(filename); // The OS will figure out which app to open the file with. } </code></pre> <p>That lets you keep all report definitions on the server and dumbs the WCF interface to your client down to supplying a PDF byte array.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload