locked
SSRS How can I align a subreport with corresponding row in main report? RRS feed

  • Question

  • Hello,

    I am just learning to how to create reports in SSRS after doing most of my development in Crystal Reports. 
    (I am using Visual Studio 2013 to create the reports).  
    I have a subreport that feeds a total revenue value to main report.  The sub report is linked to the main report by a key value and a start and end date parameter.  I cannot seem to get the total report value that is passed from the sub to the main report to align with it's corresponding row on the main report!!  I tried placing a rectangle object, into the location I need, then placing the sub report in the rectangle and using CTRL to temporarily turn off the snap to grid function... but this isn't helping. :(   If I move the sub report further up to align better, I receive an error about the expression used in the subreport.  I think it gets confused because it does not know which dataset to get the linking field from.  (I have 2 datasets in the main report)
    Does anyone have any other ideas I can try??  

    (My account is not yet verified so it won't let me attach a jpg of my reports)

    Thanks!!
    Heidi's Mom

    Thursday, May 19, 2016 11:35 PM

Answers

  • Update: I gave up on the subreport and was able to rewrite the SQL for my main query to include the total revenue amount I was trying to pass to the main report. 

    Still don't know if what I was trying to do was not possible in SSRS but for now - my issue is solved!!

    Friday, May 20, 2016 10:38 PM

All replies

  • Hi Heidis_Mom,

    I just vote for your question please now try to upload picture for your question

    Thank your

    Friday, May 20, 2016 7:15 AM
  • Thanks for trying to help me but it's still not letting my upload my jpg.

    I get the message:

    social.msdn.microsoft.com says:
    Body text cannot contain images or links until we are able to verify your account. 

    Friday, May 20, 2016 8:00 PM
  • Unfortunately I can't upload an image of my reports... but for example, if I attempt to place the subreport in a rectangle and align it where I think it should be I get the following error:

    "An error occurred during local report processing.  The definition of the report '/XXXXXXXXXXX' is invalid.  The SubreportParameter(prmFK_STUDY).Value expression for the subreport 'subXXXXXX' refers directly to the field 'PK_STUDY' without specifying a dataset aggregate. When the report contains multiple datasets, field references outside of a data region must be contained within aggregate functions which specify a dataset scope."

    PK_STUDY is only in one dataset - Dataset1 and not in Dataset2.  I'm guessing I need to specify that the subreport will use the PK_STUDY that is in Dataset1 but I'm not sure how to do that.... 

    Entering =Fields!PK_STUDY.Value, "DataSet1"  in the parameters of the subreport does not work... 

    Friday, May 20, 2016 9:51 PM
  • Update: I gave up on the subreport and was able to rewrite the SQL for my main query to include the total revenue amount I was trying to pass to the main report. 

    Still don't know if what I was trying to do was not possible in SSRS but for now - my issue is solved!!

    Friday, May 20, 2016 10:38 PM