Adding parameters to crystal reports dynamically

Hi,
I am creating a report for employee salary where Basic,HRA,etc fields are shown.Now if a new field is added to database say Medical Allowance,then how to add the field in report without changing the report.i.e. all the fields in the database added to the database should be printed in report without modifying the report.
Please reply.Thanks.

Hi
Without placing the field in report how that will be printed ?  Once you add the new field, unless you click on Verify Database, it will not be shown under Field explorer.
I don't think you will be able to do this using tables..
May be you can create a stored procedure and concatenate all field to a string and pass that string to report and print it.
In this case also you need to modify the stored procedure.
-Sastry

Similar Messages

  • Crystal Reports Dynamic Parameters with SAP Business One

    Okay, I've got this very strange issue with dynamic parameters in Crystal Reports connected to SAP Business One.
    Let's start with the software versions:
    - Crystal Reports 12.3.0.601
    - SAP Business One 8.8 (8.80.231) SP: 00 PL: 13
    - Windows XP SP3
    (SBO Server on Windows 2003 and SQL 2005)
    What I'm about to describe is something I've tried in several reports and for which I created a very, very simple test report to see if it was reproducible in a very simple situation.
    - I connected to a Business One server through CR's SBO connection type. Logon is successful, tables are shown.
    - I pick OCRD and plac CardCode and CardName in the details section on the report. Previewing the report shows data.
    - I create a dynamic parameter on CardCode and in the Select Expert I select the CardCode field and define that that should be equal to the parameter.
    - I preview the report again. Now it asks me in such a parameter screen for logon credentials. It shows the server and database it tries to connect to and in the username it shows the SQL Server username I used to connect to the SQL Server in the first place. However, the password for that user is not accepted. I also tried to login with the Windows administrator user and with the SBO manager user, but no success with any attempt.
    I also tried to add a static parameter and add all database values to the list. Same screen, different result:
    Crystal Reports 2008 wrote:
    Logon Failed.
    Error in File UNKNOWN.RPT:
    Unable to connect: incorrect log on parameters. (rptcontrollers.dll)
    (On a side note: the report is saved as report1.rpt)
    Anyone else got similar issues and found a solution?

    Hi,
    When you have fixed your crystal installation following the note posted earlier, please take a look at the [how to guide|http://service.sap.com/sapidb/011000358700000882232009E.pdf] and also at the [e-learning|http://service.sap.com/sapidb/011000358700001370262010E] about SAP Business One 8.8 and Crystal Reports.
    There are so called "tokens" which you need to use instead of dynamic parameters.
    Dynamic paramters don't work in SAP Business One 8.8, if they are not defined as a static paramter with token.
    Best regards,
    Darius

  • "Date / Date Time" type parameters in crystal reports 2008

    i am using parameters in crystal report to select records. one of the parameters is "From Date" of type Date Time.
    i mapped this parameter to a field "DateIn" of type smalldatetime in my sql table.
    Now, when i open the report it asks for "From Date" but b y default it sets the time to current time so i have to change it to 00:00:00 manually. i want it to show 00:00:00 by default. which means i don't want time here.
    For this if i select the datatype of parameter "From Date" as Date only then i am not able to map it to the "DateIn" field of the sql table.
    Please help me out of this.
    Edited by: rohit0825 on Jun 2, 2010 2:25 PM

    >
    Deepravs wrote:
    > Hi Rohit,
    >
    > Change the Parameter to Date Datatype and use this formula in the "Record Selection Formula " (Report Tab -> Selection Formulas -> Record)
    >
    > = CDateTime ({?From Date})
    >
    > Though the parameter is date datatype it converts to datetime datatype amd maps to the desired column.
    >
    >
    > Thanks,
    Great !!!
    this is working.
    i found another way, i changed the datatype of parameter to Date and click ok and everything was good, it doesn't require any conversion to date time.
    Thank You so much. All Points You.
    Edited by: rohit0825 on Jun 3, 2010 10:47 AM

  • Default Parameters in Crystal Report

    Hi all visitors
    I have created one crystal report and now i want to set the parameters to my report by using parameters in Crystal Report(  the parameters not from sql).My parameters are datetime datatype. in my report, i create one formula( get date from DocDate field from sql).How can i set the default "Todate" parameter as current date?
    Best Regards,

    Hi,
    So all of the seleciton is done using selecct expert.  They have alot of default values there...but if you go to advanced then you can do much more still.  So if you just want to only use the currentdate then you can just do something like
    date({IT_ChangeManagement.Deployment Date/Time}) = currentdate
    In the above case there would be no parameters needed and would show the currentdates information. You could of course do a varity of >= or <= using the above method. 
    If you want more flexability then you could create a parameter or two . Here is an example.  This is again done in select expert....
    if {?Start Date} <= date("01/01/2000") then
    date({IT_ChangeManagement.Deployment Date/Time}) = currentdate
    else
          {IT_ChangeManagement.Deployment Date/Time} >= {?Start Date} and
          {IT_ChangeManagement.Deployment Date/Time} <= {?End Date}
    The above defaults to the current date if the start date is older than 2000, otherwise it uses the start & end date parmeters.
    Make sense?

  • Q: Added benefit of Crystal Reports when using WebI?

    Hi Experts,
    I have a question regarding added benefit of Crystal Reports if we already have WebI.
    Seem to me that it is possible to customize the design quite much in WebI, and as I understand it the publishing/publication is the same for WebI and CR.
    Thank you in advance,
    Best regards,
    Mikael

    Hi Mikael,
    Please refer the link provided below,
    http://www.forumtopics.com/busobj/viewtopic.php?p=219787
    Hope this helps you.
    Regards,
    Abhijeet T.

  • Creating Crystal Reports Dynamically from an incoming SQL query

    Hi,
    I have a requirement where a sql query will be entered by the user in a text box and in the back end java code, i have to create a crystal report dynamically based on that sql query and show it in the crystalviewer object.
    For example if the user writes "select x,y from xtable ", i should be able to create a report with 2 fields, and if the user says "select x,y,z from xtable" then i should be able create and show a report with 3 fileds...thsi report creation should be done in the click event.
    Is this possible in java? I have found something similar in .NET... pls have a look at this 
    http://vb.net-informations.com/crystal-report/dynamic_crystal_report_from_sql_query_string.htm
    Thanks,
    Preethi

    Hi Preethi,
    Can you please share the steps with me? I am also looking for dynamic SQL being applied to the crystal report.
    Thank you so much for your help in advance.
    Regards,
    Janakiram D.

  • PASSING PARAMETERS TO CRYSTAL REPORTS THRU FORMS!

    Hi! all,
    Is there someone who passed parameters to crystal reports from
    forms 5.0?
    The problem is when I call the report executable from the form,
    its giving a login prompt again which is not desirable as @ this
    stage the user has already logged in once. So is there a way to
    pass this as a parameter to crystal or may be any better way???
    Thanx for the solution,
    Hima
    null

    First make sure you are on SP 3:
    https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
    SP 3 msi     
    https://smpdl.sap-ag.de/~sapidp/012002523100007123592010E/cr2008sp3_redist.zip
    SP 3 msm     
    https://smpdl.sap-ag.de/~sapidp/012002523100007123582010E/cr2008sp3_mm.zip
    Have a look at [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23]
    (The above does apply to your version of CR also)
    Have a look at the samples:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    And look at the Developer Help file:
    http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm
    And don't forget to use the search box at the top right corner of this web page. It will bring up KBases, blogs, wikis, articles and more. Searching these forums is also a good idea.
    - Ludek

  • Dynamic Parameters in Crystal Reports

    Post Author: Suresh Babu
    CA Forum: General
    Hi,
    Iam working in Business Objects Crystal Reports XI.
    I faced a problem when dealing with the multi value parameter.
    Iam taken a parameter it allows to choose multiple values from user.
    after selecting the values how to send these values to stored procedure.
    if iam selecting one value it retrieves the data perfectely. But if we select more than one value it does not retrieves any rows.
    ex: iam taking a parameter name @AlgorithmCode
    if iam select AlgorithmCode it retrieves the the data, if iam select more than on e AlgorithmCodes as  parameters its not working.
    If any one knows please help out.
    Thanking You
    Suresh Babu

    Hi,
    assuming all what you are using in the Crystal Report are tables using the OpenSQL connection (Table, ..) then you should be able to create the parameters as dynamic in Crystal Reports.
    Ingo

  • Problems using Dynamic parameters with Crystal Reports and SBO 8.8

    Has anyone been able to successfully use a dynamic parameter in Crystal Reports with 8.8 using the Business One connector? When we try we get an additional logon to the database that pops up and the logon fails.
    We need this because we want to return live lists of PO documents from the server for selection. We are also trying to use nested dynamic parameters, because we want to first return the PO document based on the PO number, and then chose specific rows based on a field value in POR1.
    It works if we don't use the Business One connector, but then the report doesn't function properly inside of SAP.
    Any ideas would be appreciated.

    I have tried using tokens but they are too simple. I need something like a subselect where you first select one value and then another that is a subset of those values. Apparently the tokens can't even use a "where" clause.
    SAP dances around Dynamic parameters, but won't come out and say that they can't be used with the B1 connector. If that is the case then they should just say so and stop wasting our time. Apparently Crystal is not truely interfaced with B1, just sort of hanging out with it.
    I don't really care other than I have to do this select, subselect. If someone has a way to do that with tokens I would love to hear it.
    Thanks,
    Roy

  • Crystal Reports dynamic parameters data source

    Database: Sybase ASA 9
    Crystal: Developer 11 SP4 , activex viewer
    Application: Powerbuilder 11
    I am embedding crystal reports into a powerbuilder 11 application. The crystal reports (.rpt files) are created in Crystal reports developer 11 sp4. The application programmatically change the DSN for the crystal reports to connect to the database that the customer is using. This works fine except when the report contains dynamic parameters (parameter select values from table in database to select from). The dynamic parameter(s) still references the DSN used in development as appose to the new (changed) DSN , although the rest of the report use the "new" DSN. I have spend many many hours on this and are at a lost on how to fix this ?
    Following is in short the code I use:
    FOR li_table = 1 TO iole_crx_report.database.tables.count
    // get connection properties collection for this table
    iole_crx_connection_info = iole_crx_report.database.tables[li_table].connectionproperties
    iole_crx_connection_info.DeleteAll()
    iole_crx_connection_info.add("DSN",itrx_database_info.Lock )
    iole_crx_connection_info.add("User ID",itrx_database_info.userid)
    iole_crx_connection_info.add("Password", itrx_database_info.dbpass)
                                                  iole_crx_connection_info.add("UseDSNProperties",TRUE)
                                  iole_crx_connection_info.add("AllowCustomConnection", TRUE)
    NEXT
    iole_crx_Database.Verify()

    Hi, Johan;
    There is no SDK option to change the datasource that the dynamic parameters are based on. Your only option would be to change the DSN itself to point to the new database. Or, not use dynamic parmeters.
    Regards,
    Jonathan

  • Crystal Report Dynamic Creation

    I have come up with the need for the dynamic generation of report depending upon the user selection. actually the number of columns in the table keep varying thus the schema of the table is also not fixed. thus table is also to be generated dynamically, i have been able to make a data table dynamically, thinking that it may be given as the report source to the report but have not been able to achieve it. so what i need is the way by which i can provide the schema for the same to the report and fill in the data that i have in my table dynamically.

    hi Siva,
    there is a way to do this but if you're new to crystal it may not be something that you want to do yourself.
    as Sastry mentioned above there is an option to add a Command object to use as your datasource. creating a Command like the following, where there are a bunch of parameters can create a dynamic field report. so if you're good with sql then writing out the command should be no problem.
    SELECT
    {?Field1} AS Field1,
    {?Field2} AS Field2,
    {?Field3} AS Field3,
    {?Field4} AS Field4,
    {?Group1} AS Group1,
    {?Group2} AS Group2,
    {?Summary} AS Summary
    FROM
    ((((`Customer` `Customer` INNER JOIN `Orders` `Orders` ON `Customer`.`Customer ID`=`Orders`.`Customer ID`)
    INNER JOIN `Employee` `Employee` ON `Orders`.`Employee ID`=`Employee`.`Employee ID`)
    INNER JOIN `Orders Detail` `Orders_Detail` ON `Orders`.`Order ID`=`Orders_Detail`.`Order ID`)
    INNER JOIN `Product` `Product` ON `Orders_Detail`.`Product ID`=`Product`.`Product ID`)
    INNER JOIN `Product Type` `Product_Type` ON `Product`.`Product Type ID`=`Product_Type`.`Product Type ID`
    i had originally written something like this out, i.e. an ad hoc report, in the webelements library but it is a very old sample and will probably no longer work. it uses the above syntax with a dynamic filter passed from a main report to a subreport. if you go to the above blog there's a sample report you can download. you'll be on your own to get it to work though as i mentioned it is quite old.
    and attached is an example of a report where the end user can quickly switch up the fields that are on a report. it does not use dynamic sql though, but is an example of formatting a report to switch the fields. if you want to view it extract the contents and change the .txt extension to .rpt.
    so, if you create a Command object that dynamically assigns the schema.table.fields then you can use the attached sample report as a guide on how to do the formatting piece.
    -jamie

  • Create Crystal Report Dynamically using XML based design metadata

    Hi,
    I have a CR Report Development environment. Please refer to workflow and requirement description below;
    I have a Java application(Report Customization Tool), which allows users to dynamically select structure and content for a report.
    The process goes as follows:
    1. In Java Application, user first gets option to select Report Header, Page Orientation, Font etc for master report.
    2. User can select a sub-report (pre-developed report frames. Not Sure about tool.) and apply the same format option (mentioned in step 1, except orientation) to it.
    3. User can select individual row/data cell to be displayed on the report through reference to DB tables in sub-reports.
    4. There can be N number of sub-reports each with independant formatting, data and data layout that could be integrated in single report.
    5 Once all selection is done, Java code generates an XML with all this info.
    Now, my requirement is dynamically write CR report based on this XML. I am not using BO enterprise, hence RAS SDK is out of scope. This report will be called thorough stand-alone .NET application in CITRIX environment.
    Can we do it in CR XI/CR 2008?
    Please feel free to comment in case you need more info. But I won't be able to post screenshots. NDA of course!
    Thanks in advance.

    I moved your post to the NET - SAP Crystal Reports forum.
    To start, you have a fair bit of work ahead of you. The Crystal reports SDK will not do the job. You will have to use the InProc RAS SDK which is included in both CR XI and CR 2008. I'd recommend going with CR 2008 as CR XI R1 (11.0) is out of support now and CR XI R2 (11.5) will be out of support come June of 2011. Next, make sure you have applied SP 3 for CR 2008:
    https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
    As an FYI, all files can be found on the downloads page:
    http://service.sap.com/sap/bc/bsp/spn/bobj_download/main.htm
    Next, you want to read up on RAS. I suggest the following:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10b840c0-623f-2b10-03b5-9d1913866b32
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b050afe0-2fa5-2b10-658d-98f214ba6a4a
    http://help.sap.com/businessobject/product_guides/boexir31/en/rassdk_net_dg_12_en.chm
    Samples are here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples
    and here:
    http://www.sdn.sap.com/irj/boc/samples?rid=/webcontent/uuid/80774579-b086-2b10-db91-ed58c4dda375 [original link is broken]
    I also find this 3rd party link useful:
    http://book.soundonair.ru/sams/
    And as always, search these forums. Lots of info here. E.g.;
    Programaticaly add Table in CR database fields
    InProc RAS Issue
    Adding the columns dynamically in crystal report
    Also, see the search box at the top right of this page. It searches blogs, wikis, Kbases, articles and more - all in one go.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • How to Pass parameters to Crystal report 10 based on Oracle Stored Procedur

    Hi,
    I use the following code to pass the parameters:
    Rep.Tables[0].ConnectBuffer := Connection_Str;
    Rep.Tables[0].AliasName := 'REP';
    Rep.Connect.Propagate := True;
    Rep.ParamFields.ByName('Lang', '').CurrentValue := IIF(BiDiMode = bdRightToLeft, '2', '1');
    Rep.ParamFields.ByName('SESSION_ID', '').CurrentValue := IntToStr(Session_id);
    Rep.WindowState := wsMaximized;
    Rep.Show;
    The 1st parameter 'Lang' which created from crystal report pass well,
    but the 2nd parameter 'SESSION_ID' which created from Oracle Stored Procedures give the following Error:
    Error: 202 Parameter Name could not be found u2013 ParamFields.ByName
    However in MS SQL Server the above code work fine with the 2 Parameters.
    Any one has solution,

    Hello,
    Click on the businessobjects Tab above and then select Samples and dowload the sample app you for your SDK. There are a few samples for changing/setting Parameters.
    The Parameter collection has all parameters.
    Thank you
    Don

  • Displaying a user logo in a Crystal Report dynamically at run time

    Using Visual Studio 2010, CR for VS 2010 on a Win 7 64 bit dev machine.  The software app that I'm creating is a full Windows application (not for the web).  Compiling my app for .NET 4.0.
    Actually, in January, 2012, we purchased the CR 2011 full version and subsequently installed this version for use within the development environment (VS 2010).  References that I use show (for example) CrystalDecisions.CrystalReports.Engine version 13.0.2.
    I have hundreds of hours of experience using Crystal Reports within VB, dating back to VB 6 and CR 8.5.  In a software app that I am currently writing, (where I am using VB in VS 2010 and CR 13.0.2), the Graphic Location formula within a picture "placeholder" is not working.  I am using a parameter called pUserLogo to set the path to the graphic location at runtime, but to no avail.  The picture that I'm using as a placeholder is not changing at runtime.
    I have scoured the internet for solutions to this problem.  I have also attempted to upgrade both the CR for VS 2010 (a.k.a. CR developer version) as well as the CR runtimes (both the 32 bit and 64 bit versions), but this has not helped.  The picture is never replaced at runtime while working within the IDE (i.e. running the app from VS, nor after compiling and then running as a full-blown application).  I have also tested this on another development machine.
    I eventually gave up trying to use the Graphic Location formula method, and instead went with a method that uses a DataSet within a DataTable to set the image (of an image column) as posted online.  This method actually works within the IDE.  However, if I then install my app to another PC (Win 7 64 bit as well), the CR crashes the app.  After extensive searching online, I found that referencing a DataSet in VS 2010 inside a CR, led to many other issues, such as having to use the 'useLegacyV2RuntimeActivationPolicy=true' statement in app.config.
    Further, I read that using a DataSet within CR in VS 2010 meant that you had to compile for .NET 3.5, rather than 4.0.
    Eventually, I created restore points on both PC's and then upgraded everything to 13.0.6.  But this did not help either method.
    All I am trying to do is 1) let the user of my app select an image before the report is created, and then 2) display that image on the report.  This particular report doesn't even need to reference any database, as all of the numbers that I'm displaying in the report are simply parameters that I update during the report's creation.  It is a very simple, straight-forward report.
    I would be happy to setup a GotoMeeting so that someone at support could see what is happening and could also review the code.  There are many more details, such as what errors I've encountered along the way, and what web sites I've been to in researching these issues, but I will leave that for continued discussion.
    Regards,
    Dominic

    An older discussion on this issue can be found at:
    http://stackoverflow.com/questions/2548723/unable-to-programically-set-graphic-location-in-crystal-report
    Since I couldn't get this method to work, I then tried the method as described here:
    http://adf.ly/91637/banner/aspalliance.com/1097_Importing_Dynamic_Images_to_the_Crystal_Report_without_Database_Overhead_using_Visual_Studio_2005.all
    The second method, which uses a DataSet within a DataTable as described in the above link, does work, and it correctly displays the image, but only in the IDE.  When tested on a "client" machine, opening the report causes my app to crash, with no exception or error message except for the "...has caused the application to stop working".  Previously, before introducing said DataSet into the report, the report loads and displays fine on my client machine.
    Further research led me to these two threads concerning the usage of the crdb_adoplus.dll which is necessary when using a DataSet in VS 2010 with CR.  It seems that the folder dotnet1 is not accessible, and thus there are workarounds for this issue.  See these two threads, below:
    http://scn.sap.com/thread/1802638
    http://scn.sap.com/thread/1665437
    Again, I followed the recommendations that I needed to set the Startup flag 'useLegacyV2RuntimeActivationPolicy=true' in app.config.  However, the workaround where I should target .NET 3.5 instead of .NET 4.0 is not reallly an acceptable option to me (and I don't know if it will work, anyway).
    So my question remains; Can anyone please tell me if A) They have any issues using the "picture placeholder/formula" method for loading a picture at runtime, and/or B) If there is a fix for the DataSet issues apparently inherent in using VS 2010 with a Crystal Report?
    Thanks in advance, for your reply.
    Regards,
    Dominic

  • Crystal Report Dynamic Parameter for SAP B1 version 8.8

    Hi, does anyone have problem with the dynamic parameter prompt for Crystal Report in SAP B1 version 8.8?
    For example:
    1. For static parameter that allows multiple value --> In SAP B1 v8.8, there is a check-box and a "..." button next to it. When you click the "..." button, a new window appear with a list of values to choose.
    2. For static parameter that does not allow multiple value --> In SAP B1 v8.8, there is one field with a drop-down menu.
    3. For dynamic parameter that allows multiple value and does not allow range values --> In SAP B1 v8.8, just one field for us to key in the value. Shouldn't this be the same as No. 1?
    4. For dynamic parameter that does not allow multiple value  and does not allow range values --> In SAP B1 v8.8, same as No.3 above. Shouldn't this be the same as No. 2?
    How do I get no. 3 dynamic parameter that allows multiple value and does not allow range values  to have a check-box and a "..." button next to it to allow us to select multiple values?

    Hi Shwu Hua Gan,
    Thank you for your reply.
    Please forgive me as I don't really understand what you are saying here. To be honest, I'm very new to Crystal Report and my understanding of CR is just the very basics. I'm actually not from a technical background which makes it more difficult.
    In your reply:
    Ie, you create a parameter in Crystal report, and by using the token eg:Mytest@select * from OCRD, it gives you the benefits of selecting the list from the database.
    How do you do this by using the token? All I did is just select the parameter type (dynamic) and then select the table. When I preview the report in SAP B1 8.8, it doesn't prompt me like how I expect it to be. It is a blank field that I have to key in the value myself and then only the report will generate. Sometimes I don't remember what value to key in, so I have to do a formatted search for the blank field. After the report is generated, I can reselect the value (multiple values) from the CR viewer panel toolbar and refresh the report.

Maybe you are looking for