This is a migrated thread and some comments may be shown as answers.

Report Viewer WPF witch cod reader HTML

3 Answers 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Grzegorz
Top achievements
Rank 1
Grzegorz asked on 24 Jun 2013, 07:43 AM
Hi, I have the following problem with the Report Viewer for WPF control . I read the HTML code returned by 'Render' metod next i want to set this code to the reportviewewr control , How can I do it ??

This metdo that i use to get HTML code:

 Dictionary<string, object> lParameters = new Dictionary<string, object>();
 lParameters.Add("IDKON", 101);
var lResult = ReportServiceContext.I.Render("HTML", lRaporty[0].FullName, null, lParameters);

 if (lResult.Error == null)
{
       sring str = System.Text.Encoding.Default.GetString(lResult.DocumentBytes);
 }

Thank for help.

Gregor

3 Answers, 1 is accepted

Sort by
0
Squall
Top achievements
Rank 1
answered on 24 Jun 2013, 03:28 PM
Hi,

Why you have to pre render the report, when you can directly set the report to the viewer and let it render the report directly:

public partial class Window2 : Window
{
    public Window2()
    {
        InitializeComponent();
    }
 
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        var instanceReportSource = new Telerik.Reporting.InstanceReportSource();
        instanceReportSource.ReportDocument = new  MyReport();
 
        this.reportViewer1.ReportSource = instanceReportSource;
    }
}

SN
0
Grzegorz
Top achievements
Rank 1
answered on 25 Jun 2013, 06:55 AM
I can not do this, because the report is changing several times a month and I'd prefer to download it from wcf service than to have it in a WPF application on a permanent basis. That's why I wanted to get it in the form of HTML, from the WCF service and view the preview.

This can be done?

Gregor
0
Squall
Top achievements
Rank 1
answered on 27 Jun 2013, 04:12 PM
In your case you will have to use another control because the report viewers don't work with pre rendered HTML. Instead you can pre render the report in PDF and show it in control like http://www.telerik.com/help/wpf/radpdfviewer-overview.html
Tags
General Discussions
Asked by
Grzegorz
Top achievements
Rank 1
Answers by
Squall
Top achievements
Rank 1
Grzegorz
Top achievements
Rank 1
Share this question
or