Reports on IFrame RRS feed

  • Question

  • HI,

    I the CRM system we use in our company the client notes are entered under Activities-> Tasks. However when viewing them the user cannot see the entire note as the view appears on a grid and filed space cannot be extended more than 300px. I know if I go into the code level I can increase the field width to more than 300 px  but that is not a supported method by Microsoft. What I have done now is I have created a report in the CRM that shows all the Activity tasks on a particular contact once we give contact name.

    My question is I want to add this report to an Iframe so that on form load the client's name will be passed to the report automatically and the Task  description will appear.

    Please help me with this.

    Tuesday, April 28, 2009 10:26 AM


  • OK, first thing, you have to publish the report directly to the report server, and in your report include a parameter for the contactid.

    What I like to do is set the parameter to allow null values, and in the report set the visibility of the report table to hidden if the parameter is null.

    Then I put the following code on load and onsave.  The following is an example from the case entity, but you can adapt to the contactid.

    if (crmForm.all.customerid.DataValue == null)
      crmForm.all.IFRAME_Customer_information.url = "http://localhost/reportserver?/dashboard%20folder/contact_details&rc:Toolbar=false";
      crmForm.all.IFRAME_Customer_information.src = "http://localhost/reportserver?/dashboard%20folder/contact_details&rc:Toolbar=false";
      var customer = new Array;
       customer = crmForm.all.customerid.DataValue;
       var newTarget = "http://localhost/reportserver?/dashboard%20folder/contact_details";
       newTarget = newTarget + "&contact=" + customer[0].id; 
       newTarget = newTarget + "&rc:Toolbar=false";
       crmForm.all.IFRAME_Customer_information.url = newTarget ;
       crmForm.all.IFRAME_Customer_information.src = newTarget ;
    The result is that if the contact id is blank (such as on create or when the contact gets deleted in the case example), the iframe will be blank.  In the example, replace the report server URL and report names with your report server.

    Make sure that you include the "&rc:Toolbar=false", otherwise the srs menu bar will display, and it won't look very good.

    Also, consult the style guide that comes with the SDK--make your background and fonts consistent with the crm form, and it will be almost indistinguishable from the rest of the form.
    Tuesday, April 28, 2009 10:41 AM