SSRS report integration into CoT App

Hi All,

I've built a stand alone report in SSRS using two parameters as filters. The report is multi-dimensional and consumes data from 4 different views, which is filtered by two parameters, EventID and SiteID. It works perfectly.

I've spent over a week already trying to incorporate this into the CoT App, but simply cannot get a single model to correctly contain the data. I've tried custom controller with dataviews which also did not work.

I've tried to use the Event model as a base and added more datasets to the report (using VS), but this broke the app complaining something about serialisation that's already implemented...

Is there a way to get this report to operate by passing the two parameters from the app?

Any advice / guidance would be appreciated.
1 person has
this question
+1
Reply
  • 1
    I been working with SSRS with multiple datasources and multiple datasets and multiple matrix and tablix on a single interactive sheet for a while now and got it to work real smoothly with COT . COT has an unrealistic and primitive way of doing real reports. You are only limited to one dataset. The very first and foremost thing you need to do is abandon COT's way of doing it.

    Once you erased all their ideas out of the way create your SSRS report independently, have your parameters and pass the parameters via querystring from COT.

    The construct of passing SSRS parameters is very cryptic and no documentation for it. Here is the SSRS querystring parameter construct that you will need to construct in COT via actions from a dataview or whatever.

    http://[yourserver]/reports/[SSRS Folder]/[your rdl]?rs:command=Render&[YourSSRSParameterName]=[YourSSRSParameterValue]&rs:embed=true
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • Hi Paul,

    Noted; thanks for the info. Your suggestion looks promising, I will give it a try just now.

    Will this allow me to extract the report and "Save as PDF", or render it into an iframe?

    The client is very adamant that all functionality and reporting should be contained within the app. They do not want to hop between sites. So this is a critical success factor for the project.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • ReportVIewer is monolithic in the sense that you can't interact with it using rdlc. To streamline the packaging you must make RDL work autonomously without IIS. That will be a show stopper based on the client's requirements but there's a way around that. You just need to configure your SSRS report to native mode instead of Integrated mode. in Native Mode it will just use http.sys and IIS is out of the picture. You'll have a self-contained app with no loose dependency.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • Yes you can save as PDF, PNG, TIFF, HTML, Excel... whatever. You can also do drill through reports from SSRS
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • 1
    You can use an Action to create a report button and a corresponding c# business rule to intercept the default reporting process and call SSRS directly with your parameters. I have a shared business rule for handling the nuts and bolts of running the report and return the PDF as a byte[]:


    public byte[] ExportReportPDF(string reportName, string reportPath, string[] paramNames, List<ReportParameter> paramList)
    {
    // Variables
    Warning[] warnings;
    string[] streamIds;
    string mimeType;
    string encoding;
    string extension;

    ReportViewer rv = new ReportViewer { ProcessingMode = ProcessingMode.Remote };
    rv.AsyncRendering = false;
    ServerReport sr = rv.ServerReport;
    sr.ReportServerUrl = new Uri("http://{REPORTSERVER}/reportserver");
    sr.ReportPath = reportPath + reportName;

    sr.ReportServerCredentials = new CustomReportCredentials("[SSRS Username]", "[SSRS Password]", "[Domain]");

    if (paramList.Count != 0)
    {
    rv.ServerReport.SetParameters(paramList);
    }

    return rv.ServerReport.Render("PDF", null, out mimeType, out encoding, out extension,
    out streamIds, out warnings);
    }


    Then in the business rule replace the response stream with the PDF bytes:


    Context.Response.Clear();
    Context.Response.ContentType = "application/pdf";
    Context.Response.AddHeader("Content-Disposition",
    String.Format("attachment;filename={0}", filename));
    Context.Response.AddHeader("Content-Length", report.Length.ToString());
    Context.Response.OutputStream.Write(report, 0, report.Length);
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited