Display different footer in main report of SSRS based on sub report

I have a main report in which there are two sub reports and then those two sub reports each contain one sub-subreport.
The following will give you an idea
Main Report
----->Sub Report 1
------------>Sub Sub Report 1
----->Sub Report 2
------------>Sub Sub Report 1
I am trying to display name of subreport in footer of main report depending on which subreport user is currently in. So let's say if user is viewing Sub Report 1 then it should display in footer of main report "Sub Report 1" (this is actually coming
from database and is not like displaying some static text but for the time being ignore this)  
If user is viewing Sub Sub Report 1 then footer of main report should say "Sub Report 1: Sub Sub Report 1"  
After searching a bit I found out that:
1. Sub report footer will not be shown in Main report hence this option is ruled out
2. You cannot pass parameter from sub report to main report so this option is also ruled out
But looks like you can use Shared Variables between Sub Report and Main Report. I tried to do this but looks like it doesn't work. Here's what I did:
In my Sub Report 1, I declared a shared variable as below:
Public Shared Dim sharedVariable as String = "Sub Report 1"
Now in my Main Report I wrote the following function in code just to test if it prints it on screen on not.
Public Function PrintSharedVariable() as String
Return sharedVariable
End Function
But when I run this report, it shows error that sharedVariable is not declared in Main Report. How do I use shared variables and will it work in my case?

Hi Frank,
According to your description, you want to show the subreport name in the main report. Right?
In Reporting Services, all the custom code is only work for the current report. The sharedVariable you created in subreport can't be used in main report. That's the reason why it throws the error because there's no sharedVariable in main report. For your
requirement, the most effective workaround is having a textbox with go to report Action and passing the report name as parameter back to main report.
If you have any question, please feel free to ask.
Best Regards,
Simon Hou

Similar Messages

  • Crystal report input prompt..for sub report

    Hi All,
    I developed crystal report and retreived the fields from the exsiting Query.Now for  enhancing the report i must creat a sub report for th eexisting one.In this case iam getting 2 input prompts one for the old report and the other one is for the enhanced sub report .But the requirement is tha t, the report must get only one input prompt for both the reports. Is this can be possible from the Query end or the crystal report end?
    YVL

    Hi Vijayalakshmi
    You can apply just one input parameter for the main report and then link your subreport with this parameter.
    Once you link the subreport, you would get only one prompt for inputting parameter values.
    This way you can optimize the performance of the report as well.
    For more information about linking subreports you can refer to the user guide for the respective crystal reports version you are using.
    Hope this helps!!!
    Regards
    Sourashree

  • Reports with HTML links to "sub-reports"

    I have a main sequence that runs several sequences of tests.  I
    would like to have these tests create separate reports and then link
    them from my main sequence's report.  I have selected HTML
    reporting style.  I have figured out how to link by looking at Teststand\Examples\ModifyingReports\HTMLDiagnosticLinks. 
    The only thing left is figuring out how to create the "sub-reports"
    instead of including the information in the main report.
    Any suggestions?
    Thanks,
    Bob Young
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

    Ray,
    I would like to have the sub-reports be the same format as the main report but it is not important if it has a header like the main report has.  I think that it needs to just make a report that will print on 50 pages into something easily readable.  I have already toyed with the idea of a database, but I would still have to create a report of some sort, so if I can modify TestStand's report sequence to do it, that would be even better.
    So basically I am dynamically calling a series of selectable tests.  If each of the called tests had their own report liked in to the main test where it was called, that would be great. 
    So, I'm looking for something like this:
    Main Report: 
    UUT Report
    Station ID:
    BOBY-L
    Serial Number:
    NONE
    Date:
    Monday, December 12, 2005
    Time:
    4:16:19 PM
    Operator:
    administrator
    Number of Results:
    37
    UUT Result:
    Failed
    Failure Chain:
    Step
    Sequence
    Sequence File
    Numeric Limit Test: Receive 7 bytes
    MainSequence
    Read Test.seq
    SequenceCall
    MainSequence
    testing.seq
    Begin Sequence: MainSequence
    (C:\VSS\Test Driver Code\Tests\Initializing Driver Test\Initializing Driver Test.seq)
    SequenceCall
    Status:
    Passed
    **********************LINK TO TEST****************
    End Sequence: MainSequence
    *****************SUB-REPORT LINKED IN*****************
    Begin Sequence: MainSequence
    (C:\VSS\Test Driver Code\Tests\__TestStand - Common Components\common sequences\Read.seq)
    Read 20 bytes
    Status:
    Passed
    Read the following bytes from Address 0000 of the FLASH:
    46 00 C5 07 00 00 70 00 C3 03 00 00 9A 00 8D 04 00 00 E8 00
    End Sequence: MainSequence
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • Controlling execution of subreport on main Report in ssrs 2008 R2

    Controlling execution of subreport on main Report in ssrs
    Hi,
    Am using more than 100 subreports in my main report using ssrs 2008 R2.
    And given conditional Visibility in sub reports based on the Parameter selection in main Report . But the performance is very very slow in main report.
    While selecting single sub report executes in seconds. The same report in main report executes in hours.
    According to my view,
    All the Sub reports executes and finally conditional visibility is working. Can we Control executing sub reports?
    Regards, Gayathri devi P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)

    Hi,
    I think the time to render 100 report sure will be long time and the main report want to render those reports.
    So first why you do not separate those report on many reports for different purpose.
    second if this is a dashboard report you may use many matrix in the same report and the parameters passed by default or based on expression.
    I really hope if you make your report as dashboard report, many matrix many parameters render it once. As I remember I think SSRS will try to execute your
    DataSets in parallel which will reduce your waiting time.
    I hope this is helpful.
    Elmozamil Elamir
    MyBlog
    Please Mark it as Answered if it answered your question
    OR mark it as Helpful if it help you to solve your problem
    Elmozamil Elamir Hamid
    http://elmozamil.blogspot.com

  • How to hide/show main report footer for a sub report ?

    Need to hide main report footer for a sub report(having more than one page and need to hide footer for all those pages).And again make it visible for another sub report which also have more than one page (and do the same to all of its pages)
    I have tried with formula
    WhilePrintingRecords;
    Shared BooleanVar SuppressFooter := True;
    WhilePrintingRecords;
    Shared BooleanVar SuppressFooter := False;
    with this formula main report footer is shown only on last page of sub report where i need it in all pages.
    Any solution??

    Hi Jinu,
    1) Do some or all of those subreports span multiple pages?
    2) Do each of the Subreports start on a new page?
    If yes, for both, then here's what you need to do:
    1) Create a formula (@True) with this code:
    shared booleanvar SetStatus:= True
    2) Create another formula (@False) with this code:
    shared booleanvar SetStatus:= False
    Drag and drop the @True formula on the details sections for which you want the Page Footer to be suppressed.
    Similarly, drop the @False formula on the details sections for which you want the Page Footer to show up.
    Then, go to the Section Expert > Select Page Footer c > Click the formula button beside Suppress and use this code:
    shared booleanvar SetStatus;
    -Abhilash

  • Is it possible to pass a formula value from a sub-report to a main report

    Hi there,
    Im trying to pass a formula value from a Sub-report back upto into my Main report but the value doesnt seem to be getting passed up. Ive tried it the other way around, that is, passing a value from the main report to the sub-report and that works fine.
    Below is an example of what I am trying to do but it is not working. In my sub-report Ive declared a formula variable as,
    formula name=main_subIntRatePageCount
    Shared NumberVar subIntRatePageCount := TotalPageCount;
    and in the Main report Ive declared the formula variable as,
    formula name=subIntRatePageCount
    Shared NumberVar subIntRatePageCount;
    subIntRatePageCount;
    I want the value assigned to "subIntRatePageCount" in my Sub-Report to be available to my Main report.
    The problem I am trying to solve is that the sub-report is spilling over onto two pages, and I need a way of updating the page display on the main report to reflect this. The page display is of format, "displaying page 1 of  3", but its not taking into account the extra page produced by the sub-report, so it should say "displaying page 1 of 4".

    Also thanks Raghavendra, Asha,
    I've tried adding the "whileprintingrecords" statement but that doesnt seem to make any difference.
    I notice that the subReport is being called from my the GroupFooter section of the main report, and I am trying to reference the variable in the main repot in the Page Footer section. Could it be that the variable hasnt been calculated in the Page Footer by the time I calculate it in sub-Report? I thought Crystal Reports does at least 5 passes over the report evaluating all the formulas before it prints the report?
    The problem Im trying to solve is I need to know how many pages my report will have before its completed, so that i can print the statement "displaying page 1 of X", and X is currently not being calculated correctly because the sub-report is printing onto 2 pages and not 1 so the report thinks I have 1 of X pages and not X+1.
    Regards
    Robert.

  • Resultset of main report passed as parameter to child report stored proc

    Post Author: chicagolad
    CA Forum: Data Connectivity and SQL
    I seem to be in a bind with this issue. I have a main report and sub report. The main report takes in a comma seperated value as a parameter to the stored procedure. The result set of which is used to group 20 sub reports. These subreports use a different stored procedure to which I need to send the group value which is a part of the result set table I get for the main report. Come what may, I am not able to link the main report with the sub report.
    To repeat the question, how do i pass the a result column of the main report as parameter to the sub report stored procedure? Any insight will be much appreciated.
    TIA
    chicagolad

    Raghavendra,
        It seems that no matter what I do, using the parameter ?TagNumber as the item to link from in the main report (Subreport Links) will not give any results no matter which item I link to in the subreport, but if I use the specific data item that the parameter represents, then any of the choices in the lower left "subreport parameter field to use" will work.  So I can simply use the specific data item and everything works fine. It's strange, as last week using the parameter of the main report worked, but as I have a working solution I don't have to resolve that.  (There was data for the parameter value,as I printed the parameter value in the report and the selected value was shown.).
       This is now resolved.  Thanks for your help.
    Don

  • Different Footer on First page and last pages

    Hi
    I am trying to display Continue on first page and middle pages and Total Amount on last page on a multipage PO. I can display different footer page for first page and last page but the middle pages don't have a footer. How to do this if possible. There are so many threads here but not one gives the exact steps.
    first page header footer
    Add Page Break
    2nd page header footer
    Add Section Break => Next Page
    <?start@last-page-first:body?><?end body?>
    last page footer
    Please help
    Thanks

    Did you miss this ?
    http://winrichman.blogspot.com/search/label/different%20page%20header
    http://winrichman.blogspot.com/search/label/element%20in%20header
    http://winrichman.blogspot.com/search/label/diff%20header

  • How can I have Main report with a sub-report with in a sub-report??

    I have a main report that has about 5 subreports, almost like a dashboard.  I need to make one of those subreports contain another subreport.
    I don't have the option to add a sub-report with in my sub-report, so what I thought would work is remove my sub-report from my main report, then add my new sub-report, then add that report back to my main report.
    Everytime I add the sub-report that has a sub-report to my main report I lose the second sub.
    From what I've read on the internet is you can't have a sub-report contain another sub-report.  What some say is you can hyperlink that second sub report.
    When I setup my hyper link to open the second sub-report I'm prompted to re-enter my report parameters.
    Can some help me link a sub-report to a sub-report or show me how to pass a date range parameter in my hyper link so the reports just opens up?
    I'm using CR IX R2
    Thanks

    Nate,
    You are dealing with a product limitation.  Crystal cannot have nested subreports within a sub report. 
    You can generally use shared variables between sub reports to achieve your desired result

  • Same Query for both Main and Sub Report

    I have a report whichs works but I don't think i'm getting the data to both the Main Report and Sub Report in the most effcient manner...  I have a report that totals users call subject counts.  But then end user wishes to see all users total counts and the grand totals of call counts on the first page then then the breakdown of types of calls on subsuquent pages...  so I created a report with a subreport in the report header....  I use the same query in both the sub and main report... however it asks the user to enter the parameters once for the main report and once for the sub report... Parameters are both the same for each; month and year...  so it currently runs the query twice I want to run it once and use the data for both reports...  I group by name and then sum the call subject counts for the user totals... and in the sub report I hide the detail section and I'm just left with the sub total line for each user, then in the main report use the same grouping and suming again and I start a new page for every user... 
    Using CR 9
    Thanks for any advice
    Vincent

    i think you need to link the main report parameter with the subreport parameters inorder to pass the parameter values from main report to subreport. So right click on subreport and go to change subreport links and add parameter fields and select parameter fields from your subreport and un check the databse fields in subreport.
    Regards,
    Raghavendra.G

  • Linking of Main and Sub Reports

    Hi,
    We have a requirement to integrate all the crystal reports (say 10 nos) into one single main report for the statutory purpose as per the client requirement. Basically client would like to view all these ten reports in single file by export them into single PDF. These sub reports are also going to work as an individual reports independently and having their own prompts. The data source for these reports is SAP BEx queries.
    Please let me know best approach for integrating these reports, since user doesnu2019t want to
    pass the values for duplicate prompts. Please note there are common prompts (BEx variables) across these sub reports.
    I have done the PoC for linking single sub report using Xtreme data base and here are my results.
    1.      Create a Blank Main reports and create a Country Prompt.
    2.      Link the sub report with main report using this Country Prompt.
    3.      Link the sub report with main report prompt and edit the sub report selection formula with the main report prompt u2013 u201C{Customer.Country} = {?Pm-?Which Country?}u201D
    4.      While refreshing the report, it will refresh the sub report based on the main report prompt value and shows corresponding data.
    5.      This approach works for single report and gives the expected results and asks only single time prompt selection.
    Challenges On the above approach while implementing using BEx Queries as a data source are:
    u2022      We need to equate the SAP BEx characteristics to this prompt:
    Ex:       = {?Pm-?Which Country?}
    That means we should have set of BEx queries which doesnu2019t have variables. At run time filters will be assign based on the main report crystal reports prompts. Again there could be some mandatory prompts and optional prompts and multi values etc.
    Will it affect the performance of the Crystal report while you apply filters at report level instead of BEx query level?
    u2022      We donu2019t want to modify the individual sub reports selection formulas and queries for linking purpose.
    Please let me know youu2019re best solution approach for the above issue.
    Thanks in Advance
    Regards
    Som

    If I understand correctly the main issue a report running as a sub report being run as a main report.
    I have a solution.
    for each of the sub reports build a new main report
    ie if you have
    sub report 1
    sub report 2
    then youhave a master report that calls them
    you would build
    Main report 1 ( which ONLY calls sub report 1)

  • Sub report using Stored Procedure returns incorrect data

    Post Author: rikleo2001
    CA Forum: Data Connectivity and SQL
    Guys,
    I am using CR 9 in ASP.net application.
    One simple report and one Sub report, sub report is basically linked with Stored procedure accepting one parameter and returns a select query.
    Main report is linked with that sub report using that parameter field.
    Sub report is on demand sub report.
    Now when I execute that main report and click on on demand sub report I am getting Wrong order information.
    Here is out put on main report
    Order 1                                          on demandDetail
    Order 2                                          on demandDetail
    Order 3                                          on demandDetail  
         NOW If I click on Order 3 (On demanddetail link, it displays rondom order details, some time correct on too), I am really stuck and don't know where I am going wrong.
    Please help me to solve this issues.
    Many Thanks

    Post Author: rikleo2001
    CA Forum: Data Connectivity and SQL
    Hi Yangster,
    Thank you so much for your reply.
    On DEMAND Sub report is located in main report, IN DETAIL SECTION
    I am passing Order ID from main report linked to  {?morderid} in subreport under command object, and if I run it in design mode, it works perfectly alright, so problem is isolated to ASP.NET and Crystal report post back method on Crystal report.
    The example I give to you this is a simple example to identify issues in my real application and report.
    My main report contains summary of data base on unique identifier. that summary have 4 differant types of details which has to be on the same report (as Crystal report doesn't provide Nested subreport), so I decided to use 4 subreports on main report and all subreport using Stored procedure command object.(Sub report has it own complex processing requirement to fulfill).
    Please help me with any further ideas? for the sample which I presented to you this is only using one SP on main report with a simple processing.
    Many Thanks

  • Sub-report summary fields

    I have two sub-reports on a report. Each of these sub-reports have a quantity summary on them. I want to find the difference between these two summary totals.
    So let's say Sub(A) total is 200 and Sub(B) total is 25, is there a way to subtract the 25 from the 200 and bring that total to the main report?

    HI SD, 
    1.you have share the value to main report from both sub report by using formula .
    2.Sub Report Formula 
    For A Sub Report  
    shared numberVar Aqty; 
    Aqty := Sum ({Command.Qty})
    For B Sub Report  
    shared numberVar Bqty;  
    Bqty := Sum ({Command.Qty})
    3.Main Report Formula 
    Aqty  
    shared numberVar Aqty; 
    B Qty 
    shared numberVar Bqty;
    4.you can create final formula for different Aqty-Bqty
    5.you should put formula in both sub report and you should place the main report formula in below of sub report then only it will work. -Rajesh N

  • Call BI Publisher Report in APEX, based on R.T.F Template Layout.

    Hi to all respected members of this forum.
    Since 18th May (Saturday), I am trying to connect BI Publisher Reports with Oracle Application Express 4.2.2.
    My APEX Version = APEX 4.2.2
    Oracle BI Publisher Enterprise Edition (Trial) = 11.1.1.6.0
    Oracle BI Publisher Desktop 32 Bit = 11.117.0.79
    For this purpose what I did?
    Firstly I downloaded Oracle BI Publisher Enterprise Edition 11.7 and when I started Installation I came to know that "R.C.U (Repository Creation Utility)" is required during installation and I don't have that so, left this idea.
    Than I downloaded Oracle BI Publisher Enterprise Edition (Trial) from www.oracle.com and BI Publisher Desktop Edition for Templates because there is no facility in BI Publisher Trial Edition to design Report Templates. I have installed both successfully and created a report as per my requirement.
    Now, I want to call that report in Oracle APEX but I am unable to do that.
    I followed http://dgielis.blogspot.de/2007/12/call-bi-publisher-report-from-apex.html but the link which is shown in picture no: 03, is not available, so this didn't help me.
    Then, I followed Oracle BI Publisher Blog https://blogs.oracle.com/xmlpublisher/entry/apex_users_why_not_integrate_w which discuss to call BI Publisher Report in APEX based on "Generic Report Layout". This done successfully but still I am unable to call BI Publisher Report .
    Then I found this type of script
    http://localhost/xmlpserver/Guest/Reporting_Channel.xdo&id=FGFC&password=****&xt=Reporting_Channel&xf=pdf
    to call BI Publisher Report in APEX but this also failed.
    Please help me to understand that how to call "BI Publisher Report in APEX, based on R.T.F Template Layout.
    Thanks in Advance.
    *Regards:*
    *Muhammad Uzair Awan*
    *ORACLE APEX Developer*
    PAKISTAN.
    Edited by: uzairmalik on May 20, 2013 1:32 PM

    Are you trying to have multiple sql queries and have multiple sections displaying different data sets ? Or with one single query but display it in different ways in a single report ?
    You can create one single query as Report Query in APEX and associate it with a BIP report layout. So you can achieve a Dashboard layout with the report query/layout.

  • Crystal Report Hyperlink to Sub-report or other report

    Hi,
    I would like to create a report on which the first part will show project summary page. The second part will have all project detail pages and third part with all project financial informations.
    The report should work in such a way whenever user clicks on any project at first summary page this has to jump to corresponding detail page of projects.
    I have the following question regarding design of this report.
    1. Do I need to create a saparate report as a sub report and then merge with main report in a footer section? Or is it ok to create sub-report within main report through sub-report wizard option?
    2. How can I establish hyperlink between the pages i.e. summary to detail pages?
    3. back hyperlink to first pages.
    I am expecting more information about hyperlink options within Crystal report.
    Thanks
    -Sunil Prasad

    Hi Sunil
    - For your first question: . Do I need to create a saparate report as a sub report and then merge with main report in a footer section? Or is it ok to create sub-report within main report through sub-report wizard option?
    You can create a separate report and then insert it as a subreport in the main report or create it with sub report wizard.
    Once you click on Insert -> Subreport, you can see there are two options, one is to point to an existing report and another is to create it through wizard.
    - 2. How can I establish hyperlink between the pages i.e. summary to detail pages?
    You can use the hyperlink between report objects.  Also you can apply a customized formula for this.
    Check the below SAP Notes:
    [1. 1207011 - How to create an OpenDocument link in Crystal Reports XI/XIR2 |http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes]
    [2. 1212849 - How to pass a parameter value through a hyperlink from one report to another |http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    For detailed information on Hyperlink Click on Crystal Reports Help Help -> Search for the keyword Hyperlink.
    You can also refer to the Crystal Reports User guide for the respective version that you are using.
    Hope this helps!!
    Regards
    Sourashree

Maybe you are looking for

  • How do you use the blue keycap characters to get accents?

    My new Flex 2-15 has blue symbols on some of the keys. For example, the key to the right of "L" looks like: <pre> +-----+ | :   | | ; ~ | +-----+ </pre> where the colon and semicolon are printed in white, and the tilde is blue. Some of the other keys

  • Loop Not Returning All Rows

    I finally need to turn to the forum after trying for a few days to resolve my problem I decide to turn to the Oracle people for help. The following code below does two things: 1. If I have the get_menu_label in side of it's own loop it never returns

  • Envelope Margins on L7580

    I noticed that similar questions have been posted here and never answered, so I thought I'd try again. I have the same problem others have:  when I try to print an envelope, the printer insists on a .665 (or something near that) margin at the top, so

  • I need time machine restore help

    Can someone please tell me what the screen should look like when I do a complete restore onto a new hard drive? The blue candy cane bar is spinning. There is no percent complete or hours until completion showing. It ran all night. 500G hard drive. I

  • "On My Mac" vs "My .Mac Account" in Apple Mail

    Hello Everyone, Since I upgraded to Leopard this weekend, Apple Mail has been acting differently than it used to with my .Mac service. First of all the underlying theory behind IMAP is to keep everything in sync on the server and on the local compute