Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.
Using the QueryString as a Report Parameter

Unanswered Using the QueryString as a Report Parameter

  • Friday, June 01, 2012 12:10 AM
     
     

    I have a SSRS Report that I import into CRM 2011 as an Existing file. The report runs great. But what I want to do is this:

    This is in the Projects Entity of CRM when you click on a project you get the project details and in the toolbar you get a Run Report. This works fine. But when you click run report it open a window with the project id, so you get this:

    https://crmwebsite.com/crmreports/viewer/viewer.aspx?action=run&helpID=ProjectReport.rdl&id=%7b635f1dbf-4d98-e111-9f86-32b731eedd84%7d

    What I want it to do is when you click Run Report it runs the report, but the report uses the id in the querystring (&id=%7b635f1dbf-4d98-e111-9f86-32b731eedd84%7d) as a Report Parameter so it only shows the report data for the project with the id in the querystring (&id=%7b635f1dbf-4d98-e111-9f86-32b731eedd84%7d).

    Is this possible? If so, anyway in the world to do it? I've tried everything I could ever think of over the last month and I'm about to go crazy.

    Thanks!

All Replies

  • Friday, June 01, 2012 4:11 AM
     
     

    Hi,

    There seems to be something I need to clarify. First, the id that you are refering to is the id for the report. this is not the id of any entity record. Let me know in case you need to run your report for any specific entity records.

    If yes, then that parameter has to be appended to the query string as mentioned below:

    if parametername in your report is prjrecordname

    https://crmwebsite.com/crmreports/viewer/viewer.aspx?action=run&helpID=ProjectReport.rdl&id=%7b635f1dbf-4d98-e111-9f86-32b731eedd84%7d&p%3aprjrecordname=prjrecordnamevalue

    usually when we run reports and want run time value to be provided to prjrecordnamevalue, then in workflows you may insert the link and after equal sign you may put the dynamic value in place of prjrecordnamevalue.

    Let me know if this resolves your query / in case you face any difficulty.


    Anubhav Bajpai

  • Friday, June 01, 2012 1:38 PM
     
     

    Hello,

    The value in the id parameter in the URL is provided by CRM when you click the Run Report button. It is the id of a record in the Projects Entity. So I would just want that to be used when the report is run as a parameter.

    Thanks!

  • Saturday, June 02, 2012 12:20 PM
     
      Has Code

    Hi,

    Although in SSRS "reportname" gives the report name, but in crm report output it gives you the report id.

    Globals!ReportName

    For parameter section here is the sample i created, this will give you an idea to start with.

    once you have the value in the parameter, you may use it in your queries/validation etc.

       <ReportParameter Name="prmrecordid">
          <DataType>String</DataType>
          <DefaultValue>
            <Values>
              <Value>=Right(Left(Globals!ReportName,37),36)</Value>
            </Values>
          </DefaultValue>
          <Hidden>true</Hidden>
          <ValidValues>
            <ParameterValues>
              <ParameterValue>
                <Value>=Right(Left(Globals!ReportName,37),36)</Value>
                <Label>report id</Label>
              </ParameterValue>
            </ParameterValues>
          </ValidValues>
        </ReportParameter>


    Anubhav Bajpai