Variable or Subreport Conundrum

I currently have a very simple report setout as follows:-
Category (Group A)
     Consultant A (Group B)     1st    £X,XXX
     Consultant B (Group B)     2nd   £X,XXX
     Consultant C (Group B)     3rd    £X,XXX
The position of the consultant is based on the value (using group sorting expert). So in theory this shows who has sold the most revenue for that category. The report is fixed to show a 9 month period from the currentdate the report is ran.
I have now been asked to show the information in a different way. I need to show each Consultant (as Group A), with a grouping of the categories showing revenue, and also showing the position they are in for that category (i.e. 1st, 5th etc).
Consultant A (Group A)
     Category  A    1st    £X,XXX
     Category  B     5th   £X,XXX
Is this possible with either a sub-report or a global variable that records the position in the first report for the particular consultant and category and then is able to re-sort/re-group it in another report?
Hope you can assist.

What you are trying to achieve is not easy. How many consultants and categories do you have.
if you were to run the category report as a hidden sureport for each consultant (in consultant group header) would that be a massive and unacceptable over head on the database and report server.
You would then need to set up shared variables for each category and capture relevent postion and value for each category and then show in the consultant group footer!
Ian

Similar Messages

  • Passing a variable from subreport to the main report

    Hi guys, was unable to google this, so Im urning to you guys:
    I was wondering whether it was possible to do this:
    I have a subreport taking data from a table. In the main report, in the suppres condition of details section containing this subreport, I need to have a variable containing the total count of rows in that table. I know there are shared variables for that, but the problem is, that the variable in the condition is processed sooner than the one in the subreport.
    Any ideas on this?
    Thanks a lot

    To Sharma:
    Hi, unfortunately I can't. The subreport has its specific position in constallation with previous and following sections and must be right there.
    To Raghavendra:
    Hi, that was my first idea, but the problem is as I explained in my first message.
    To both:
    I have a table in subreport. This subreport is in main report positioned in details section "x". and I want to use that shared variable in the suppress condition of section "x". The problem is that the formula in suppress condition is processed sooner than the formula assigning a value to the shared numbervar inside the subreport.
    and thats what im looking for - a workaround for that. btw im using CR 8.5
    thanks again guys

  • Pass variable to subreport

    I'm using SQL Server 2014 and Reporting Services and I've got a report containing a number of linked subreports. The main report I have will be different for each customer I produce the report for and will contain different text, but I need to pass a customerID
    to the subreport in order to filter the following query:
    SELECT V.vCenterName,
    COUNT(DISTINCT M.VMName) *1.0/COUNT(DISTINCT M.Hostname) AS VMsPerHost
    FROM
    dbo.VMs M INNER JOIN dbo.vcenters V ON M.vCenterID = V.vCenterID
    WHERE M.vCenterID LIKE V.vCenterID
    GROUP BY V.vCenterName
    ORDER BY VMsPerHost DESC
    If I can declare a VARCHAR variable before the query and then pass the customerID from the main report to the subreport, I can filter the data by the specific customer only and do this for each main report. How would this be done though. I know there's an
    option to work with parameters but I don't understand how it works.
    Thanks in advance
    Adam

    Hi Adam,
    create customerid parameter in sub-report.
    In main report use subreport control and provide the subreport.
    in subreport properties go to parameter section.set parameter value from your main report parameter which will give the customer id.
    If you want to pass the value by dataset you can give the dataset field value.
    Thanks
    Prasad

  • Orphaned Group Headers in Variable length Subreports.

    I have a report is composed of a number of subreports that each have 3 nested groupings.  I am trying to figure out how to keep the subreports from printing GH1 on a page when GH3 will not fit on that same page of the main report.  I have read the knowledgebase articles and forum posts about preventing widowed headers when your results are in the details.  Unfortunately, for the purposes of our reports, these do not apply because we have to put our "details" data in GH3 and supress the actual Details section.  As a further complication, I cannot uncheck "Repeat Group Header On Each Page" or check "Keep Group Together" for GH1 within the subreport because it is appropriate for these headers to repeat most of the time and each subreport is of variable length and keeping the group together could leave too much white space between subreports when the each GH1 has to start on a new page.  For similar reasons, I cannot use "Keep Object Together" on the subreport.
    Any help is appreciated.

    Post Author: hamish_sco
    CA Forum: General
    In Design View, right-click on the group header area on the left of the screen (in CR10 it is grey and has a list of page sections - RH, PH, D etc)Choose 'Change Group' optionOptions tab - Tick the 'Keep Group Together' option.When I did this I also had all the 'Keep Together' options in the Section Expert unchecked.  This may or may not make a difference.CheersHamish

  • Passing Shared Variable from subreport to main report

    Hello,
    I am having difficulty passing the shared variable from the subreport to the main report.  For some reason, when viewing the data, the value for the very first row is returning a 0 but the second row is returning the value that should be in the first row.   Does anyone have an idea of what I'm taking about?
    Thanks.
    Z

    In Subreport there is a group based on the client.  There is a summarized amount field in this grouping.  I placed a formula in the grouping and suppressed it.  The suppressed formula is listed below.
    {@ store client payments}
    WhilePrintingRecords;
    Shared CurrencyVar cRelatedPayments;
    cRelatedPayments := cRelatedPayments+Sum ({amount.amt}.{client.client_number});
    cRelatedPayments;
    In the main report, there is 2 groupings, first grouping is the client and second is the invoice.  The client grouping is displayed while the invoice grouping is suppressed.
    The following is the formula in the main report to get the shared value.
    WhilePrintingRecords;
    Shared CurrencyVar cRelatedPayments;
    cRelatedPayments;
    This is placed in the client grouping.
    I hope this helps.
    Z

  • Passing a variable from subreport to main report

    Hello,
    Was hoping to get some assistance on this issue I'm facing.  I've got a sub-report that calculates a monthly goal based off the date selection criteria. And I'd like to pass this goal back to the main report.
    In my sub-report, I created a new formula named ProcGoalVariable:
    WhilePrintingRecords;
    Shared Numbervar ProcedureGoal := cdbl({#ProcGoal})
    While {#ProcGoal} is a running total I created for the sub-report and now I'd like to pass it back to the main report.
    In the main report, I created a new formula named ProcGoalVariable:
    Shared NumberVar ProcedureGoal;
    ProcedureGoal;
    But when I drop this into my report, it is returning a value of 0.  In the screen shot, the Proc. Needed should actually equal the Proc Goal:
    Any suggestions on how to pass this correctly?

    Thanks for the advice,
    I want to rewind a bit to make sure I am explaining myself clearly.  My sub-report is pulling the correct numbers and it is located in GF#3 and contains two values that fall under "Proc Goal" and "Prod Goal". These are being calculated correctly and I would then like to pass them back to the main report for additional calculations done on this.
    In the sub-report, a formula was created "ProcGoalVariable":
    WhilePrintingRecords;
    Shared Numbervar ProcedureGoal := cdbl({#ProcGoal})
    In the main report, a formula was created "ProcGoalVariable"
    Shared NumberVar ProcedureGoal;
    ProcedureGoal:=ProcedureGoal;
    Would having the same name inside the formulas being causing the issue? And I've tried inserting a new section below the section where my subreport lives and I still get a value of 0.
    Not sure what else to try at this point.

  • Supress Group Header in Report when Subreport is blank

    well the title says it all.
    I want to supress the main report group header when the subreport (is in details) is blank.
    I'm stuck on this:
    I'v created a shared variable in both report and subreport and it gives me the number I want but not where I wanted to appear. If I put the variable on the group footer it shows me the correct value but if I put it in the group header it shows me the previous group footer result.
    This is what I got:
    Group Header
    Client 1
    Shared Variable=0
    Details
    Contract 01
    Contract 02
    Group Footer
    Shared Variable=2
    Group Header
    Client 2
    Shared Variable=2
    Details
    Group Footer
    Shared Variable=0
    This is what I want:
    Group Header
    Client 1
    Shared Variable=2
    Details
    Contract 01
    Contract 02
    Group Footer
    Shared Variable=2
    Group Header
    Client 2
    Shared Variable=0
    Details
    Group Footer
    Shared Variable=0
    Can I do that?
    Edited by: Pedro Pinto on Jul 29, 2008 2:47 PM

    I'm going to try my best. This is what I get:
    Main Report
    Group Header
    Client 01   --    0->shared variable
    Details
    Subreport 1
    Group Footer
    2->Shared Variable
    In subreport for client 01:
    Detailsa
    Contract 01
    Contract 02
    Detailsb
    Total of contracts = 2->Shared Variable
    Main Report
    Group Header (supress this section)
    Client 02   --    2->shared variable
    Details
    Subreport 1
    Group Footer
    0->Shared Variable
    In subreport for client 02:
    Detailsa
    Detailsb
    Total of contracts = 0->Shared Variable
    For Client 03 it doesn't show anything but if Client 04 if it has contracts it only shows the contracts but not the name of the client.
    I've already did supress when is blank but in the details.

  • How to know how many rows including headers and footers does subreport has from Main Report

    Hi, we are sturuggling with subreports. Main report has 3 subreports, each subreport is inplmented in a group header(3 subreports and 3 group headers). We would like to print a group header under subreport as a column header every page, and need a page break when group number is changed. This report exports a MS Excel(97-2003) report file.
    In main report, [New After Page] is checked under Group Header #1d from [Section Expert]
    In each subreport, [Repeat Group Header On Each Page] is checked under the highest group from [Group Expert]
    Here are two issues;
    Since Crystal Reports has more rows than Excel in one page, colmun header in each subreport is being printed in the middle of the page. It should be printed at the top of the page
    When Subreport has many rows and has to be printed in more than 1 page, a page break is automatically inserted before column header. It should be printed right below column header which is Group Header #1
    We have been trying to pass row counts(count of group header because group header is used as the details) using a shared variable from Subreport 1 to Subreport 2 via main report since Subreport2 cannot predict how many rows Subreport 1 has.
    Here is what we are trying but we are getting an error which is "A constant expression is required here" under main report
    - In Sunreport 1
    whileprintingrecords;
    shared numbervar SubGroupCount := DistinctCount({Table.Field});
    - In Mainreport
    shared numbervar SubGroupCount;
    if(pagenumber) = 1
    then (SubGroupCount)
    else 50
    Is there any solutionss or better ways other than above?
    Thank you,
    Main Report: Group Header #1a --> as Page Header
    Run Date: mm/dd/yyyy                                                                 Report Name
    Main Report Group Header #1b --> Subreport 1
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6
    Main Report Goup Header #1c --> Subreport 2
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6
    Main Report Froup Header #1d --> Subreport 3
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6

    Thank you for your reply and sorry for my complicated explanations. The report has confidential information, so I replaced to some fake data but I believe you can still see what I am trying to do..
    Main Report
    Subreport 2
    Output1
    Output2: the following page
         --> more rows are printed..
    We have two problems;
    1. The column header in Output2 is supposed to be pronted right below the last row in Output2, however, a page break is automatically inserted. But even in the same output document, it works for some group when it has a few rows..
    2. Since Crystal Reports prints more rows in one page than MS Excel does, Column header is not be printed at the top of the page.
    I tried the way you advised me but it did not work..

  • Group based on Shared variable

    Hi Experts,
    Can we create a Group based on Shared variable in subreport?

    Hi Praveen,
    A shared variable evaluates in Pass 2 and hence No!
    You can't create a group on such formulas in the Main Report or the Subreport.
    -Abhilash

  • Passing Parameters to anf from Sub-Reports

    I have a report with two subreports in it, and I want to be able to tell the main report about the data in the sub-report so I can supress a detail section if the sub-report contains certain data.  How do I pass a parameter from the sub-report to the main report?

    Passing a variable from subreport to main report and vice versa
    Declare a variable as shared in the subreport.
    Shared numberVar NoOfrecords;
    Assign some value to this variable,
    Shared numberVar NoOfrecords :=Count()
    Then in the main report, create a formula and in that formula again declare the vairable and use it as u like
    //Declaration
    Shared numberVar NoOfrecords;
    //If you want to supress a section based on this count,then
    if NoOfrecords = 0 then TRUE
    click ok..
    NOTE:
    For the shared variable to return the correct value in the main report, you must place @MainFormula in a main report section that is beneath the section containing the subreport. This ensures Crystal Reports evaluates the @SubFormula before @MainFormula.
    Very Important : Dont just create the formula, u have to place this forula somewhere as mentioned above. If u dont want to show this formula value,then hide it by changing its colour to white or by some other way. If u dont place the formula in the report,it wont work.
    and same thing applies when passing values from main report to subreport.
    In this case define the @MainFormula first and then @SubFormula.
    I have used this successfully in my report.

  • Get data in a subreport based on a shared variable from the main report.

    Goodd morning,
    My question/problem is how to manage this scenario.
    I am transfering 2 shared variables (pereiod from /period To, ) from the main report to a subreport and now  i would like to get data in this subreport based on these 2 variables...
    The problem is that i can not find the shared one in select expert icon...
    Could anyone point me to solve this issue?
    Thks for any help.
    Jose Marin
    Crystal Report XI SR3

    Hello Jos,
    I recommend to post this query to the [Crystal Reports Design|SAP Crystal Reports; forum.
    This forum is dedicated to topics related to the creation and design of Crystal Report documents. This includes topics such as database connectivity, parameters and parameter prompting, report formulas, record selection formulas, charting, sorting, grouping, totaling, printing, and exporting but also installation and registering.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all Crystal Reports Design queries remain in one place and thus can be easily searched in one place.
    Best regards,
    Falk

  • Troubles with linking subreport with an SAP Query variable

    Hi there
    I have a main report mith a subreport placed in the detail section.
    Both reports base on an Bex Query and have Query-variables. While linking the subreport i can not select the parameter which is based on the Bex variable in the subreport.
    While connecting other parameters /variables i learned, that Crystal cannot determine the type of data of a Bex variable, right?
    Because of that i built formulas which convert my values into strings and these strings can i connect in the subreport linking.
    Unforntunately this does not work with this on variable. In Bex this is a Number. I tried to link with the corresponding field in the Detail section (which is a number, too) and i tried with the string, but both does not work. I can not select this Parameter.
    Any idea how to determine the datatype of this Parameter (based on Bex Variable) i have to provide?
    Thanks in advance
    Alex

    Hi Ingo
    Well, i knew that thing with the same types already, as i mentioned it in my post.
    In this problematic case I want to connect a field of the detail row to a prameter in the subreport. This Parameter is coming from a Bex Variable. I treid with values of oll types - it doesn't work. How can i determine the type that Crystal assignes to the Be variable?
    Alex

  • How to display variable lenght grid within subreport

    Hello;
    In order to compensate and fill up space of a subreport to make up a full page or even generate a blank page to compensate for duplex printing, we have programmed the data to fill in blank records, as many as we need per invoice. These invoices have variable pages, due to many transactions.
    The idea is to be able to draw grid, lines between the transaction within the subreport but we can't. The reason is because the data is populating blank lines and we only would like to show the grid over the populated fields.
    Is there any control or option in Crystal to control this or handle it some other intelligent way?
    Thanks again!

    hi Nikolay,
    have a look at the attached report. extract the contents and change the .txt extension to .rpt.
    there is a formula there that replicates lines based on the number of lines needed in total less the count of existing records. the formula is also Formatted to Can Grow. the Details B section also has Suppress Blank Section checked so that it doesn't show up when the formula is empty.
    -jamie

  • Sort Main Report on variable passed from Subreport

    Post Author: realw
    CA Forum: Formula
    I'm working on a CR XI report. I want to be able to sort the main report on a value in the subreport. I am trying to create a shared variable to pass that value from the subreport to the main report. So far, however, the formula containing the variable in the main report is not appearing as an option in the Sort dialogue box.
    My first question is, can this be done?
    If the answer is yes, then which sections in the subreport and main report should the formula appear in?
    What I have at this point is:
    In the last Details section of Subreport, formula @ssSubCreator
    WhilePrintingRecords;Shared StringVar Cre;Cre:= {CreCreat_csv.SummaryData};
    In the Report Header of the Main report, formula @ssCre
    Shared StringVar Cre:="";
    In the Details section of the Main report, following the section containing the Subreport, formula @ssCreator
    Shared StringVar Cre;Cre
    I can see that the data is passing correctly to the Main report. I've tried moving the formulas around to different sections in the sub and main reports but haven't gotten the formula to be sortable.
    Thanks in advance for any assistance,
    Will

    Post Author: bettername
    CA Forum: Formula
    How about just grouping the data in the main report on the formula? (Supress group header and footer, obviously)
    I don't have crystal to hand right now to check if that'll work though - you may run into problems with the 'cannot evaluate at this time' issue... but I use this technique for sorting data based on a chosen parameter (say: surname, forenames, age) in this way...

  • Variable numbers of subreports

    Post Author: Gerd
    CA Forum: General
    hey,
    Question for CrystalReport XI for Visual Studio 2005
    I have a main report, with different subreport typs.
    e.g.
    Main report
    - SubreportA
    -  SubreportB
    Problem:
    The subreports can appear in different order and can appear more than one time.
    like
    e.g. 1
    Main report
    - SubreportA
    - SubreportB
    - Subreport A
    or e.g. 2
    Main report
    - SubreportB
    - SubreportA
    - Subreport A
    It is possible with CrystalReport XI to set the subreport "type" at runtime ?
    Or how can i solve this problem ! It is possible at runtime or at design time ?
    thanks

    Post Author: rickcf
    CA Forum: General
    Generally the answer to your question is yes by using the way Guy has described.  Without knowing the details it will solely depend on how your data set will be structured and where you put the subreports.  For example you may have to repeat the subreports in split detal, summary, group or page footer bands and suppress accordingly upong what data is available at run time in that band. 
    If the subreport is dependant on main reports data or on the parameter data being there then obviosly the data must be there at the right time to run the subreport.  In other words if the subreport is in the page footer and it expects detail band data then you may only get the last record data passed to the report which might not work.
    Also if you have a subreport that gets passed a Type field to run it you can create the one subreport and insert it twice into the main report into different bands.  Then use variables or fields within the report to run (or suppress) those bands according to the data.
    If your subreports are mostly independant of the main reports data then you can basically do what you want as you described.
    The key is to use the section expert to insert bands for the subreport and suppress accordlingly and getting the data set right behind the scenes to drive the subreorts in the right way.   Without knowing how your subreports are 'dancing' with the main reports data that is all I can tell you. 
    Everything I see can be done at design time.
    Good luck!
    Rick

Maybe you are looking for

  • How to get the homedirectory of nis users while they login

    HI, I am having a solaris nis server and a file server running on solaris (pre installed).I need to add new workstations (linux) to this server, i stopped firewall and selinux on linux pc & configured network.I used authconfig to configure nis client

  • The computer has rebooted from a bugcheck. The bugcheck was: 0x0000003b...

    Hi All I formatted and installed Win8.1 (64-bit) recently on my PC but have constantly had BSOD with faults like: Log Name:      System Source:        Microsoft-Windows-WER-SystemErrorReporting Date:          27/11/2014 09:40:21 Event ID:      1001 T

  • Alternative account Number in G/L

    Hello experts, We have a company that besides the usual balance structure uses also an alternative one for its country. When I run the Balance sheet query with the normal hierarchy I can see all the nodes correctly. But when I use the one for its cou

  • Indesign pdf form

    I have created a pdf form from Indesign. Is there a way to enable the person filling out the form to then click a button (created in indesign) that collects their answers and exports them in a preformatted pdf? It's not something I'm aware of but a c

  • CRM_IC Language Issue

    Hello Experts,          In my web client CRM_IC while creating the person using creat person there is a field for langauge and if we did not mention any thing in language by default it is taking it as English. I want to change that and has to be made