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

Custom Wcf Service to generate PDF Report for Silverlight

1 Answer 88 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
leblanc
Top achievements
Rank 1
leblanc asked on 13 Jun 2011, 08:54 AM
Our current reports look something like:

public partial class AlertProgressReport : Report
{
    private readonly AlertProgressReportModel _model;
    public AlertProgressReport()
    {
        InitializeComponent();
    }
    public AlertProgressReport(AlertProgressReportModel model) : this()
    {
        _model = model;
        table1.DataSource = _model.Rows;
    }
    private void textBoxTitle_ItemDataBinding(object sender, EventArgs e)
    {
        textBoxTitle.Value = _model.DateColumnNames["AlertName"] as string;
    }


The empty constructor is so that the report works in design mode.

We have only used telerik for its design surface to create awesome reports in  PDF.

Our app is in ASP.NET MVC so in our controller action we create the viewmodel that we send to the report using the overloaded constructor and then send the "Report" object to our custom action result which forces the user's browser to download the generated pdf.

System has worked well, however, now we need this in Silverlight also.

Do you have a sample on how I can implement my own ReportService this way I can use ServiceHostFactory to inject our dependencies and do exactly like we do in ASP.NET MVC?

We understand this approach might require we create an Svc per report. 




 

 

 

 

1 Answer, 1 is accepted

Sort by
0
leblanc
Top achievements
Rank 1
answered on 13 Jun 2011, 06:12 PM
I'm not going take this approach anymore.  Since reports come from a specific database I'm just going use the following post:
http://www.telerik.com/community/forums/reporting/telerik-reporting/use-web-config-for-sql-connection.aspx
so we can support our various build environments.


Tags
General Discussions
Asked by
leblanc
Top achievements
Rank 1
Answers by
leblanc
Top achievements
Rank 1
Share this question
or