none
RepeortViewer, sub report, error RRS feed

  • Question

  •  
     Here is the situation:

    Report A contains a sub report B.
    Both are deployed to a deployment folder that ordinary user cannot access.
    Both are linked in the user folder, which ordinary user can access.

    I am using the ReportViewer control, and the server report is set to report A in user folder.  User can see the report A fine, however they only see "Error: Subreport could not be shown." for the sub report.  They have permission to access both report in the user folder, which is a linked copy.

    Since I have right to the deployment folder, I can view the report A and sub report B fine.  However, I think it is using the report B in the deployment folder (because it is where it got deployed?)so ordinary users can't view it.  Is it why and how do I correct this?  We cannot just give user permission in the deployment folder.
    Friday, January 9, 2009 7:54 PM

All replies

  •  Here is the situation:

    Report A contains a sub report B.
    Both are deployed to a deployment folder that ordinary user cannot access.
    Both are linked in the user folder, which ordinary user can access.

    I am using the ReportViewer control, and the server report is set to report A in user folder.  User can see the report A fine, however they only see "Error: Subreport could not be shown." for the sub report.  They have permission to access both report in the user folder, which is a linked copy.

    Since I have right to the deployment folder, I can view the report A and sub report B fine.  However, I think it is using the report B in the deployment folder (because it is where it got deployed?)so ordinary users can't view it.  Is it why and how do I correct this?  We cannot just give user permission in the deployment folder.
    Friday, January 9, 2009 7:41 PM
  • I also used a test account (which has access to the link folder but not the deployment folder) and access the report directly, and it shows the same error.

    This leads me to believe: a linked report will always use the subreport (and its security setting) from where it was deployed, instead of a linked from the same folder.

    The question is. how can I change that behaviour?

    Friday, January 9, 2009 9:22 PM
  • Hi eqs,

    On the main report, you can attach to its SubreportProcessing event. The event handler will be handed a SubreportProcessingEventArgs, which contains the path to the subreport. You can use that to verify where it's actually getting the subreport from.

    It sounds like you are using absolute paths for the subreport path? Have you tried a relative path that would work for both the deployment folder and the user folder?
    http://blogs.msdn.com/magreer
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, January 9, 2009 10:56 PM