Passing Formula field to Subreport

Hi All,
I have a date parameter in my main report and in a formula field I am changing the format to string. Then I am linking this formula to the subreport parameter, but when i refresh this report I am not able to see the subreport data unless I click on the subreport. I want that the subreport should be displayed when I open the main report and pass the parameter value to the main report.
Please suggest how can i achiev this.
Thanks in advance!!

I think you have inserted an on demand sub report. Try to right click on the sub report and go to format sub report and in the sub report tab unchek the option "on demand".
Regards,
Raghavendra.G

Similar Messages

  • Accessing formula field in subreport..

    Post Author: kior
    CA Forum: Data Connectivity and SQL
    Hi,
    I'm new in Crystal report and need help on my problem "how to access the formula field i have created in subreport to my main report". Thanx in advance..

    Post Author: DubbleOh7
    CA Forum: Data Connectivity and SQL
    I haven't tested this but is should look something like this(VB.NET code)
    Dim mainreport As CrystalDecisions.CrystalReports.Engine.ReportDocument
    Dim subreport As CrystalDecisions.CrystalReports.Engine.ReportDocument
    Dim formulaField as FormulaFieldDefinition
    subreport = mainreport.Subreports(SUBREPORTNAME) ' Or index
    formulaField = subreport.DataDefinition.FormulaFields(INDEX OR Formula Field name)
    hope this helps.

  • Using formula field as parameter to subreport fails

    Anyone passing formula fields to subreport to feed into a SQL stored proc?  I'm using Crystal XI to develop the report and I haven't consistently been able to get it to work. 
    The main report is essentially a shell to call the subreport.  I have created a variable to store the currentceusername value so it can be passed to the subreport as a parameter.  This doesn't work immediately since I get the error message "Database connector error '42000:[Microsoft][ODBC SQL Server Driver][SQL Server]Procedure or Function 'usp_PG0123...' expects parameter '@username', which was not supplied. [Database vendor code: 201]
    But I have set up that parameter in the Subreport Link.  My workaround is to edit the subreport, refresh the report and enter the parameters to the subreport to retrieve data.  Close the subreport and the main report will now function properly and pass the data to the subreport.
    After it is working locally in my CR XI, I save the report to the BOE XI server.  Running the report on the server I get "Error in file reportnamerpt: Database Connector Error".  My local copy of CR XI is patched with the latest SP and hotfixes.  Our BOE XI server is on SP3 with hot fixes. 
    I can't figure out what I'm not doing right... I have been constantly removing and re-creating the subreport and re-creating the sublinks.  This error does not occur if I replace the formula field with a regular parameter in the main report to feed to the subreport.
    Anyone have any suggestions?
    Thx.
    Patrick

    I know this can be done, because that's basically how I pass multiple-selection parameters to an SQL Command.
    The only thing I can think of is if the data types of the formula field is not exactly the same as the database parameter, Crystal may drop the link or something.  That's pretty much a WAG, but it's something...
    HTH,
    Carl

  • How can we pass a formula field of Main report to SubRepor's Parameter. in CryastlReport 11

    Post Author: Nikhil
    CA Forum: General
    Hi
    Crystal Report version : 11.0.0.1282 Standard
    There is MainReport1. Other is Subreport1
    Scenario : 
    MainReport1 having paramater PdateMain1 as dateTime.
    SubReport1 having parameter dateSub1 ,dateSub2.
    datesub1 is used for One datasource1 (DataSource- XML -from webApplication)  , dateSub2 is used for datasource2 (DataSource-SQl Procedure ) ( This is requirement as i need to used two datasource )
    Value of datesub1 and datesub1 is same (it is created automatical as it is part of SQLProcedure and XML Query ) but get prompted twice for the same valuewhich  is not desirable. so for that i have created main report and calling this subreport in main report.
    Now i want's to pass PdataMain1 to Parameter datesub1  and datesub2. I am able to pass  PdataMain1 to datesub1.  through Change Sub report link ( Option on right click of report).and it is working fine,
    Problem : 
    But Subreport link Menu does not allow to bind PdateMain1 to datesub2 as it is allready bind with datasub2.
    to overcome this i created one Formula field in main report as fMaindate1 which copy date from Parameter PdateMain1.and bind ( link) the  fMaindate1 to datesub2.  when i link this , subreport does not display any thing at all. It it a limitation of crystal report or i am missing some thing , Is it like that we can pass formula of ,main report to subreport Paramater in Crystal 11 Standard , if we can anyone please Provide help on this.
    This can be easily achieve through application programming but my need to get this done in Report itself.Thanks
    Nikhil Patel

    Post Author: Jagan
    CA Forum: Crystal Reports
    Shared variables. Looked in the help at variables - shared

  • Error when embedding a formula field in a text box in a subreport

    I am rewriting an application that merges data from a .net application into a Crystal Report template and displays it in the application.  In VS2003, I have had no problems with the reports as they are written.  In VS2010, I get an unusual error on some reports with subreports. 
    In one report I have multiple subreports.  In those subreports, I have formula fields.  If I take one of those formula fields and embed it into a Text Box and attempt to generate the report through the application, I get the following error:
    This field name is not known.
    Details: errorKind
    Error in File Confirm {20564DCB-5CA4-4832-8931-DF1CC6C54784}.rpt:
    Error in formula  optionStrike:
    '{Command.OPTIONSTRIKETIME}'
    This field name is not known.
    Details: errorKind
    If I take the very same field out of the text box and put it directly on the report, the report will generate without error.
    In the case above, OPTIONSTRIKETIME is a string field.  This rules out any conversion errors from a date/number/etc to string for the text box.
    Has anyone else encountered this error?  If so, what can be done to avoid it?

    Hello,
    Thank you for the info.
    Which driver are you using for the dataset?
    If you are using ADO.Plus add this to your App.Config file:
    <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
    Thank you
    Don

  • Passing value to formula field in CR XI from vb6

    currently using vb6 and testing CR XI.  Attempting to pass a value to a formula field in a CR XI report and getting the an "invalid use of property"  How do you pass a value from code in vb6 to the formula in the report?
    current code is as follows:
    Set app = New craxdrt.Application
    Set cr = app.OpenReport("test.rpt")
    Dim crystalFormFieldDefns As craxdrt.FormulaFieldDefinitions
    Dim crystalFormFieldDefn As craxdrt.FormulaFieldDefinition
    Set crystalFormFieldDefns = cr.FormulaFields
    Set crystalFormFieldDefns.Item(0).FormulaFieldName = ("{@InvList}")
    crystalFormFieldDefn.Text = Chr$(34) & selFormula & Chr$(34)
    crvInvoice.ReportSource = cr
    crvInvoice.ViewReport

    Hi, Gerry;
    I think the logic is off a bit.
    Instead of:
    Set crystalFormFieldDefns.Item(0).FormulaFieldName = ("{@InvList}")
    Try:
    For Each crystalFormFieldDefn In crystalFormFieldDefns
    If crystalFormFieldDefns.Name = "{@InvList}" Then
    crystalFormFieldDefn.Text = Chr$(34) & selFormula & Chr$(34)
    Regards,
    Jonathan

  • Passing optional parameter to subreport

    Hi,
    I am having a CR 2008 report based on BW query.  The query has optional parameter (the value can be set to NULL).  When I try to use this report as subreport in my main report, I am unable to pass Null(equivalent to set to NULL) to my subreport using subreport link.  I tried blank and "" in a formula field and try to link it to the subreport parameter but it doesn't work.  Kindly guide me in this regard.
    Thanks and Regards,
    Subbu S

    Hi Subbu,
    Try to create a formula and pass the formula value to your sub report parameter and in sub report record selection based on main report formula value try to filter the records.
    Ex: Main report create the following formula :
    Whileprintingrecords;
    Shared Stringvar x;
    If not hasvalue({?Optional}) then
    x:='No Value'
    else
    x:={?Optional}
    Now link this to your sub report parameter
    In sub report record selection
    If {?parameter} = 'No Value ' then true else {?Parameter} =  FieldValue.
    Thanks,
    Sastry

  • Not able to clear out a formula field value when variables are equal to 0

    I am trying to calculate the difference between a formula field from a main report and a formula field from a subreport. When i run the report i get a correct difference calculation only when both formula fields have a value different than 0. When both values are 0 then the difference calculation shows the last item quantity from the formula field in the subreport that had different values than 0.  It looks like the difference calculation is not being clear out before jumping to the next value calculation.

    try to clear the variable values once done with calculation like
    whileprintingrecords;
    shared numbervar i:=0;
    regards,
    Raghavendra

  • Working with 3 Reports -- How to Display Summary/Formula field in Each Repo

    I have 3 Report that represent three Company.
    Each Company/Report has their report Details and field totals at the bottom.
    Now what I am trying to accomplish is that I need to add all three companies grand total and sum it up and display at the bottom of each reports.
    FYI, I have created matrix report and i pass user parameter where user can choose which company's report him/her would like to run so for example: if user run Company_1 then at the bottom i want to display all the companies Grand Total.Each reports have 6 columns and all the columns are same in each report except the data change by company. and with the same thing with Company_2, and Company_3
    Now, I tried to use create a separate query and tried to use DATA LINK but it didn't work due to very awkward report design.
    Is there a way where i can create a formula field and write PL/SQL and display at the bottom of my report.
    Please let me know if its possible I will very appreciated.
    Thank You

    Thanks for your reply,
    Actually, I would done that before taking Company's parameter off but i have to send out this report to all three companies thats resoan why I put companies paramters.
    Also, I have solved that problem by creating new query that will give me total off each company so in my Data Model. I have Q_1 (main query), Q_2 (Company 1 query which give me total for each field), Q_3 (Company 2 query....), Q_4
    and call those all fields and RESET AT REPORT level.
    so, no mather which company i choose in my parameter field it will give me final total at the bottom of my report for all the departments.
    Thank You,

  • How to set a new value for formula field in crystal reports xi?

    <p>How to set a new value for formula field in crystal reports xi?</p><p>//formula</p><p>{@description}</p><p> </p><p>exemplo in VB6</p><p>crxSubreport.FormulaFields.Item(1).Text =  "&#39;Subreport Formula&#39;"  or</p><p>crxSubreport.FormulaFields.Item("description").Text =  "&#39;Subreport Formula&#39;"</p><p>How to in JRC?</p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p>

    Hi,
    This functionality is known to be very important and is a key part of the next major release of the JRC planned for the first half of 2008.
    Regards,
    <p>Blair Wheadon</p>
    <p>Product Manager, Crystal Reports</p>

  • Why do I only have the option to summarise some of my formula fields?

    Hi.
    I'm trying to create a running total but when I look for the formula filed that I want to summarise, it's not there. There are some other formula fields that it tells me that I can summarise but not the one that I want. Any ideas?
    Thanks in advance.
    Graham

    There are are certain functions that can only be executed during the "WhilePrintingRecords" pass of the report execution. Any formula that uses one of these functions cannot be summarized.
    Also any formula that is is based on aggregated values cannot be summarized.
    HTH,
    Jason

  • Select records based on formula field

    I have a formula field that I am trying to sort data by. I want to eliminate records that come up with a 0 in this formula field. I tried select expert, but it doesn't recognize the field.

    Hi Steve,
    You cannot sort on a formula field that uses printime functions or executes in the 'whileprintingrecords' phase - example would be running totals or formulae based on shared variables from the subreport.
    What you can however do is, suppress records where the formula returns zero.
    To do this, go to the Section Expert > Select the section you wish to suppress > Click the formula button beside 'Suppress' and use this code"
    {@Formula_name} = 0
    -Abhilash

  • Passing data from one subreport to another subreport

    Post Author: GISGuy
    CA Forum: Formula
    I have a report which is really a series of subreports with very few actually requiring a direct link to another.  What I am trying to do is compare dates between different subreports and do conditional formatting to highlight where a dependant data source has an older date than the parent data source.
    We use Crystal Reports XI release 2, and the data resides in ArcSDE & Oracle 9.
    Any suggestions would be greatly appreciated.
    Eric Andersen
    Woodlands Information Management Technician
    Canadian Forest Products Ltd.
    Prince George, BC

    Post Author: synapsevampire
    CA Forum: Formula
    When your tagline is about the size of your post, you probably didn't convey much.
    You can pass values from one subreport to the next in the order they are placed in the main report by using shared variables, as in:
    //1st subreportwhileprintingrecords;shared datevar MyDate := {table.date}
    //2nd subreportwhileprintingrecords;shared datevar MyDate;if {table.date} = MyDate thencryellowelsecrwhite
    Covers the theory, for specifics you have to be in your post.
    -k

  • Sorting on a Formula field

    Everytime I try to do a sort on the formula field below, I can't sort on the field.  It doesn't even show the field in the explorer window to sort on.  The formula is below.
    Sum ({fct_CurrentSales.Cases}, {@upc}) /
        (tonumber(Maximum ({vw_dim_Product.CA_MPN_JMelBoxesPerPallet}, {@upc}))) / {Command.Previous Fiscal Month}

    Sorting is done at record level and you're using a sum in your formula as well as a maximum value.  Not sure about what is being done in the {@upc} formula but it may be affecting it as well.
    Look at your user guide and look up the multiple passes CR makes and what is done in each pass.
    (I used to keep a copy of the multiple pass flowchart on the wall above my computer as it contains good information on what can be done and when during the report generation.)
    Sum ({fct_CurrentSales.Cases}, {@upc}) /
    (tonumber(Maximum ({vw_dim_Product.CA_MPN_JMelBoxesPerPallet}, {@upc}))) / {Command.Previous Fiscal Month}

  • How to appear a formula field for once at a fom-like report?

    Hi All,
    I have created a formula field and then set the property "Maximum Records per page" to the value 12 for the repeating frame containing this field and all other fields.
    Now I want to make an exception for that formula field
    I want it to be appeared only for one time not 12 times!
    how to do this Plz?

    Hi,
    I assume that your formula column is at a higher level than your repeating frame (in other case it's not clear which value you want to display). Bring the filed representing the formula column behind the repeating frame, then it's diplayed only once.
    Regards
    Rainer

Maybe you are looking for

  • Iphone 4s wont power on, im just getting a blank screen with battery charging on front screen

    iphone 4s wont power on, im just getting a blank screen with battery charging on front screen>>>>becouse it is after damage water

  • Using an Iphone as a remote desktop

    Does anyone know of an application that will allow you to connect an iphone to a windows machine and use the iphone as a remote desktop unit. If I have to use a wireless router that is fine, I am not able to use internet as an option however. Thank y

  • Error in F-44

    When I am trying to do F-44 for a vendor I am getting following error. Payment with residual items in invoices with defer $1 Message no. FF804 PWe are using derrered tax

  • How to Use Flat File As source in operation mapping?

    Hi dont want to use an FCC. I have written an JAVA Mapping to convert a flat file to XML. But in Interface Mapping How i can test this?

  • How to set default folder view to "list"

    Hi guys, This is regarding Tiger. I poked around in the Finder forum to no avail. Have any of you come up with anything that would force the default folder view to "list" view? Um, folders, they are found in the gui. Thanks for any thoughts, scripts,