Crystal Reports Field Loop

Hi Guys,
I want to add a field in my report, by the name of week number.
Obviously I need it to repeat 52 times in either the details or group header section.
So I created a formula field with a loop, and I want it to print out from 1 to 52 (i.e. there will be 52 detail sections, from 1 all the way to 52).
This is the code I got now:
Local NumberVar i;
For i := 1 to 52 Do
   If i <= 52 Then
      {@Week Number} = i
      Exit For
   End If
Next I
Its not working, saying that the remaining text does not appear part of the formula (highlighting from "Exit For" line).
Any help or alternative ways I can get this done?
Thanks
Regards
Dario

Hi There
Please try this
Local NumberVar i;
For i := 1 to 52 Do
If i <= 52 Then
{@Week Number} = i  ;
Exit For
Regards

Similar Messages

  • Crystal Reports Field Explorer not showing

    Hi,
         I am using Visual Studio 2003 with the bundled version of Crystal Reports.  It has always worked fine until recently the Field Explorer tool bar does not show up anymore when I open a Crystal Report for development.  I have uninstalled the entire Visual Studio and reinstalled the Visual Studio but it still will not show the Crystal Reports Field Explorer.  However, if I install the Visual Studio on a completely different computer it works fine.  Anyone have any idea what could be causing this problem on my main computer?  Could it be a setting somewhere in the Visual Studio?  I cannot find any information on this problem.
    Thanks,
    Razzle

    Ok, I figured out what the problem was.  It was something wrong in my Windows profile.  So I deleted my Windows profile and created a new one and it is working now.
    Razzle

  • Dynamically modify the crystal report field size based on Paper size in C#

    Hi,
    I need to modify the Crystal Report field size dynamically based on the paper size using C# .Net. According to the paper size, crytal report field width should be increase or decreae.
    Kindly suggest any solution on this.
    Thanks

    Moved to .NET SDK forum
    See these RAS samples:
    http://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples#NETRASSDKSamples-Exporting%2FPrinting
    Don

  • Crystal Report Fields Ungrouping

    I am working with existing crystal report and at the moment I am totally helpless to un-group two fields added in Text object.
      Basically I want to add formula to one of the embedded field and I can not select that, below is the image
    Here you can see two fields are embedded in a Text control, I wanted to select the Top (Extra_Merch_Desc...) field, Kindly help in this regards.
    I have done this so far.
    Select the required field(s)
    From the Format menu select the Format Field option
    Click on the Font Tab
    Press the [x+2] button to the right of the Size drop down
    Enter the following formula:  IF Len({Customer.Customer Name})>15 Then 8 else
    IF Len({Customer.Customer Name}) in 10 to 15 Then 9 else 10
    Press the Save and Close button
    Reference Link
    I have double clicked the Text box and found two options :
    Text Formatting...
    Format Embedded Field...
    When I do modify the Formula and "Save & Close Option Press" , it saves and I can see Formula in the Formula box, but after exiting from Formatting Box next time that formula disappears.
    Below is the formula for the font change:
    if Length({myfield}) < 50
      then 16
    else if ((Length({myfield}) >= 50) AND (Length({myfield}) < 80 ))
      then 13
    else if ((Length({myfield}) >= 80) AND (Length({myfield}) < 100 ))
      then 11
    else
      10

    Hi Qadeer,
    Have you tried this:
    1) Drag and drop the first field on the report
    2) Right click the field and insert the formatting formula
    3) Do the same for the next field
    4) Insert a text object and place these two fields in the text object.
    -Abhilash

  • Crystal report field in Infoview with hyperlink to .exe needs to pass param

    I believe I have exhausted my searching and could not find an answer to this.
    I have a CR that will eventually need to be published in InfoView.  One of the fields has a hyperlink that points to a .exe.
    The problem is that I need to have CR pass the data in the field as a command line parameter, but InfoView is treating the formula I used to generate the hyperlink as one link, so of course "the address could not be found". The .exe is on a network share drive.
    This works fine in CR stand alone, but not in InfoView.
    If the answer is obvious I apologize.  I just began using both of these apps a month ago.
    Thank you in advance for any information/help.
    Ed

    Please re-post if this is still an issue to the Business Objects Forum or purchase a case and have a dedicated support engineer work with your directly

  • Crystal Reports Visual Studio 2010 SP2 Fixed issues

    Hi All,
    Here is the list with fixed issues in Crystal Reports Visual Studio 2010 SP2
    http://www.crystaladvice.com/crystalreports/crystal-reports-2010-sp2
    The following list with issues is fixed:
    1566763 - CRVS2010 WPF Viewer error; "System.NullReferenceException was unhandled" PageControl.OnMouseMove
    1540637 - Error: External component has thrown an exception. Launching the Database Expert in the embedded Crystal Reports designer in Visual Studio
    1544675 - Error; 'Object reference not set to an instance of an object' when using the CR WPF viewer in VS2010
    1578823 - CRVS2010; "Load Report Failed" error when Report is open in any full version of the CR Designer
    1638191 - Using RTL language (Arabic) the CR viewer Group Tree Panel does not display RTL
    1631283 - Error; 'Failed to load database information' when reporting off of file system data
    1553469 - How to enable Database logging in Crystal Reports for Visual Studio 2010
    1299185 - Error: Operation not yet implemented or Failed to Export, when exporting a Crystal Reports to Text format
    1451960 - Null or empty values are not surrounded with delimiter when exported to CSV format
    1659185 - The special Crystal Reports field, 'File Name and Path' shows temp path and temp name when viewing a report
    1452648 - Dynamic Cascading Parameter prompts two times when using the Crystal Reports in VS .NET
    1580338 - When refreshing a report that contains a linked subreport report takes long time to execute
    1659111 - GCHandle left in memory for each open and close of a Crystal Report in VS2010 application
    1356672 - Crystal Reports special field "File Path and Name" displays incorrect information in a Visual Studio .NET application
    1593658 - Impersonation of database Log On credentials failure in report generation when set at runtime in a .NET application
    1661239 - Summary fields are converted to String fields
    1661276 - Using the Crystal Reports SetTableLocation method in VS .NET causes long report processing delays
    1661200 - Not able to copy text from report objects using the Crystal Reports WinForm viewer for VS .NET
    1631722 - Date function in a Selection Formula is removed when running a report in a VS .NET application
    1525822 - Exception "Object reference not set to an instance of an object." thrown when clicking on Parameter Panel button in Crystal Report .NET Windows Form Viewer
    1603082 - Cross-tab background colors not retained when exporting a report to PDF format
    1603154 - Shared variable display the incorrect value in Crystal Reports
    1427747 - Why does a CR .NET SDK web app have problems running on IIS 7 in integrated pipeline mode?
    1545536 - Alignment set to Justify causes broken underline
    Source: Resolved Issues in Service Pack 2 for Crystal Reports for Visual Studio 2010
    With kind regards,
    Pieter Jong
    Crystal Advice
    http://www.crystaladvice.com

    Many thanks for the link Pieter.
    I recently created a wiki that lists all of the fixes, their tracking numbers, associated Kbase numbers, Kbase titles and links to the kbases:
    http://wiki.sdn.sap.com/wiki/x/tgK3Dw
    It's 90% complete. I think I have a few Kbases to do to complete it.
    Now that I think about it, I'll also add the link to the [sticky thread|SP 2 for Crystal Reports for Visual Studio 2010 released!; re. SP2 release.
    - Ludek

  • How to use Dynamic cascading parameter in crystal Report XI ?

    Hi,
    I want to use Dynamic cascading parameter in crystal Report XI which is to be viewed through the infoview without using the Business View.Is it possible?
    I could implemented Dynamic cascading parameter using the CR XI developer without using Business View, but cannot view the report when uploaded it to BOXI, through infoview.
    Please suggest..
    Thanks in advance..
    Rajneesh

    In the crystal reports field explorer>right click on parameter field>create new-->name the parameter field and select the type as dynamic. Now in the value field click the row and add the database field also add another field below that by clicking on the next row so..on. The order should be like this parent field first and then child field next...... Also click on the last column to add parmater for each level.
    Regards,
    Raghavendra

  • Using Crystal Report Data Connection in Xcelcius 2008

    The documentation does not explain how data to populate row, column and details is passed to SWF.
    Can some-one please point how CR Data Connection when created in Xcelcius 2008 is used in Crystal Report Design time ? Is it through Flash variables? Basically more details are needed for "when setup properly" clause. How to map Crystal Reports Fields to Xcelcius Definitions.
    Thanks
    Harish Tejwani
    From Doc:
    "With the release of Crystal Reports 2008, it is now possible to embed an Xcelsius-generated SWF file into a Crystal Report and have the SWF consume data from that report. When set up properly, refreshing the data in your Crystal Report will update the embedded SWF.
    To configure your Xcelsius SWF to consume data from its Crystal Rport source data, you must open the Data Manager in Xcelsius and add a new Crystal Report Data Consumer connection. After adding the connection, bind the following ranges to your spreadsheet:  Row Headers, Column Headers, Data"
    "Using Crystal Reports 2008, embed the SWF file into the Crystal Report source data file. When designing your Crystal Report, you will determine what fields/data populate the Row Headers, Comumn Headers, and Data ranges that were designated in your Xcelsius SWF. When set up properly, refereshing your Crystal Report will also refresh the data being sent to and consumed by the embedded SWF. See"

    <div class="content">
    <p>
    Please check the following post to see if there is a solution to the issue you are experiencing:
    </p>
    <p>
    <a href="/node/19014"><span style="color: #0063af">http://diamond.businessobjects.com/node/19014</span></a>
    </p>
    </div>

  • Crystal reports hierarchy issue

    Hello Experts,
    I am working on crystal reports 2008 on top of BW queries, I have product hierearchy untill 5levels.
    But in crystal i cannot see all the detail attributes of hierarchy, meaning,  i cannot see product key and medium name for level3,level4 and level5.I have built universe using same bw query, i can see L02,L03,L04,L05 levels material key and material medium name.
    Please let me know if i am missing any patches from BW side.
    Thanks.

    Hello Ingo,
    Thanks for reply, my issue is in the crystal reports field explorer , i am unable to see all the attributes of the hierarchies, example for level 3,level 4,level5 i am unable to see all attributes like key and medium name.
    Thanks.

  • Crystal Report on BW Query

    Hello,
    Weu2019re on BI 7, Crystal Report 2008 V1 and SAP Integration Kit 3.1.
    Query is created in BEx Query Designer, with Variable. In Crystal Report, I have set to use the MDX driver u2013 recommended by SAP.
    I have created the Crystal Report on top of this BW Query. When I click on Preview, I have Variable screen appeared. I have 5 Variables on the screen:
    1) I noticed that we MUST enter the value into the Variable (all of them) else I got nothing to display on the screen. Why? The Variable is configured as u201COptionalu201D in the BEx Query.
    2) I have entered the specific value for the Varible i.e. Product = A001, but I still have other Product being display on the screen. Why?
    3) And I dont see to have the option to select all value (*) for each of these Variable. Why?
    4) In Crystal Report ->Field Explorer ->Parameters, I can see that the Variables defined in BEx Query is there. What can we do with these Paramaters?
    Please advise, thank you.
    Edited by: lynn on Feb 4, 2010 4:34 AM

    Hi,
    Weu2019re on BI 7, Crystal Report 2008 V1 and SAP Integration Kit 3.1.
    Query is created in BEx Query Designer, with Variable. In Crystal Report, I have set to use the MDX driver u2013 recommended by SAP.
    I have created the Crystal Report on top of this BW Query. When I click on Preview, I have Variable screen appeared. I have 5 Variables on the screen:
    1) I noticed that we MUST enter the value into the Variable (all of them) else I got nothing to display on the screen. Why? The Variable is configured as u201COptionalu201D in the BEx Query.
    >> in case the variable is optional then you will have a "set to null" checkbox in Crystal Reports for the prompt
    2) I have entered the specific value for the Varible i.e. Product = A001, but I still have other Product being display on the screen. Why?
    >> did you actually add the value to the list of values ?
    3) And I dont see to have the option to select all value (*) for each of these Variable. Why?
    >> in case the prompt is optional using the option "set to null" means you getting all values because you not setting a value.
    4) In Crystal Report ->Field Explorer ->Parameters, I can see that the Variables defined in BEx Query is there. What can we do with these Paramaters?
    >> not sure what you mean here.
    Ingo

  • RE: What's database field are used in crystal report file?

    Hi all
    Please help me a C# code that using Crystall Report API (Crystal Report XI- Develop license) to get the list of database fieldname that using in crystal Report file. (What's database field using in header section ,group section , detail section of report.....)
    We looking forward to hearing from you
    Thanks
    Son

    Hello Son,
    please use this code below to get a list of used database fields in a report :
    //File Name:          CS_Get_report_data_out_inproc.sln
    //Created:            April 11, 2008
    //Author ID:          FLI
    //Purpose:            This C# .NET sample Windows application demonstrates
    //                  how to retrieve report data and put the into a XML file
    //                  using unmanaged RAS.
    // Note this is available without a dedicated RAS with SP2 for XI R2
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.ReportAppServer.ClientDoc;
    using CrystalDecisions.ReportAppServer.Controllers;
    using CrystalDecisions.ReportAppServer.DataDefModel;
    namespace CS_Get_report_data_out_inproc
        public partial class Form1 : Form
            // CR Declarations
            ReportDocument boReportDocument;
            ISCDReportClientDocument boReportClientDocument;
            public Form1()
                InitializeComponent();
                //Create a new ReportDocument
                boReportDocument = new ReportDocument();
                // load the RPT file
                boReportDocument.Load("..
    ReportData.rpt");
                // show in reportviewer
                crystalReportViewer1.ReportSource = boReportDocument;
            private void button1_Click(object sender, EventArgs e)
                //Access the ReportClientDocument in the ReportDocument (EROM bridge)
                boReportClientDocument = boReportDocument.ReportClientDocument;
                // Retrieve the Rowset Controller
                RowsetController boRowsetController = boReportClientDocument.RowsetController;
                // Retrieve the metadata (column headers) - this allows you to only retrieve the data that is on the report.
                RowsetMetaData boRowsetMetaData = new RowsetMetaData();
                Fields boFields = boReportClientDocument.DataDefinition.ResultFields;
                boRowsetMetaData.DataFields = boFields;
                // Now print out the data in XML file
                //(Note: This will print out the results of formulas too)
                StreamWriter sw = new StreamWriter("C:
    ReportData.xml", false);
                sw.WriteLine("<?xml version='1.0' encoding='utf-8'?>");
                sw.WriteLine("<ReportData>");
                sw.WriteLine("<Reportheader>");
                // Print out the titles
                for (int i = 0; i < boFields.Count; i++)
                    String boFieldName = boFields<i>.Name;
                    sw.WriteLine("<ReportheaderDetail>" + boFieldName + "</ReportheaderDetail>");
                sw.WriteLine("</Reportheader>");
                //Create the cursor which lets us loop through the data
                RowsetCursor boRowsetCursor = boRowsetController.CreateCursor(null, boRowsetMetaData, 1);
                Record boRecord;
                while (boRowsetCursor.IsEOF == false)
                    sw.WriteLine("<Customer>");
                    boRecord = boRowsetCursor.CurrentRecord;
                    for (int j = 0; j < boFields.Count; j++)
                        try
                            sw.WriteLine("<Detail>" + (String)boRecord[j].ToString() + "</Detail>");
                        catch (Exception err)
                            sw.WriteLine("<Error>" + err.Message + "</Error>");
                    sw.WriteLine("</Customer>");
                    boRowsetCursor.MoveNext();
                sw.WriteLine("</ReportData>");
                // CLose the file
                sw.Close();
                MessageBox.Show("XML File 'ReportData.xml' successfully created on C:");

  • Crystal report - how to split a field into more fields

    Hello,
    I`m new to Crystal reports and I`ve got a trouble. I have field which contains an address - street, city, zip code. The example is:
    STEHLIKOVA 977 165 00 PRAHA 620 - SUCHDOL 165 00.
    What I need to achieve is to split this string into three separated fields. I`ve trouhg a couple of forums but haven`t been able to find a proper answer. The problem is that the addresses differ so I can`t use an absolute defining of a start position. Looking at the DB (HEXA code) the parts in the string are divided by two dots:
    STEHLIKOVA 977..165 00 PRAHA 620 - SUCHDOL..165 00
    I`ve been able to work out this solution:
    stringVar array x := split({cparty.STREET_ADD},"..");
    Local numberVar i;
    Local stringVar outputString := "";
    For i:=1 to Count(x) do
    outputString := outputString + x[i] + Chr(10)
    outputString;
    It splits the string into three rows:
    STEHLIKOVA 977
    165 00 PRAHA 620 - SUCHDOL
    165 00
    And I don`t know how to find the end of each row so to be able to separate the strings and report them as three different fields.
    Would be anyone so kind and help me out with this?
    Thank you.
    Petr

    Hi
    Actually using a for loop is not necessary here. All you need to do is to add several formula fields: one for street, one for city and one for zipcode. In @street field you add formula:
    stringVar array x := split({cparty.STREET_ADD},Chr(13));
    x[1];
    Then you drag such formula field to details section of your report and watch preview to check if everything looks alright. Repeat for every formula field that you'd like see in your report.
    In @city you add almost identical formula but you change index, i. e. instead of x[1] you need to use x[2]. Then for @zip x[3].
    You may need to check if your address has all three parts - for example if you want to use formula in the second part of your address field you may need check first if there are at least two parts after split:
    stringVar array := split({cparty.STREET_ADD},Chr(13));
    numbervar c; 
    c := count(x); 
    if 2 <= c then 
    x[c]; 
    Var 'c' is used to store the number of elements in array after split. Then I'd like to check if the part (second) actually exists. So I try to check if number of part that I want to refer to is not bigger than the number of elements in array after split (here stored in var 'c').
    Actually the code presented above is not enough since you have no guarantee that you'll always get address structured in the very same way. For example in demo PL database I have zip code and city in the same row after split with Chr(13) as delimiter.
    You'll need to experiment or ask someone to prepare correctly structured data coming from B1 to your report.
    Kind regards,
    Radek

  • Get the parameter fields defined in crystal report

    I am porting my application from crystal 8.5 written in C++ to crystal 2008 in .net.
    Here I am not making use of crystal report viewer neither I am creating .rpt in .net code.
    I have a set of already created .rpt files.
    I have written a function in .net to export the crystal report.
    Its a generic function and will be called for multiple crystal reports.
    I am passing the parameter values to the report by making use of the following function :
         ReportDocument repDoc;
         repDoc.SetParameterValue(APPTYPE, strNextToken[0]);
         repDoc.SetParameterValue(COMPORROLETYPE, strNextToken[1]);
    Similarly I are setting other parameter values.
    The problem here is that, all the reports do not have parameter fields defined that I am trying to set.
    They may be present for one report and absent for another. In this case , if the report does not have a particular parameter
    field, then it gives error on setting parameters and subsequently fails.
    Now I want to find out through code what all parameter fields are defined in the report. Then I will only set those
    parameter fields?
    Please guide how can this be done.
    Thanks
    Sonam

    Not as trivial as you might think. You will have to loop through all the sections of the report looking for the objects you need. I don't have a code specific to parameters, but looping through al the sections would be something like the code below. But... this will only show you parameters in a section. It will not show you parameters used in a formula, record selection formula, group selection formula, text field or a conditional formula. In order to get those parameters, you's have to parse out each of those objects looking for parameters. And this is probably not an exhaustive list of places to look for a parameter in the report.  I get a headache just thinking about this...
    Dim crSections As Sections
    Dim crSection As Section
    Dim crSubreportObject As SubreportObject
    'set the crSections object to the current report's sections
    crSections = crReportDocument.ReportDefinition.Sections
    'loop through all the sections to find all the report objects
    For Each crSection In crSections
    crReportObjects = crSection.ReportObjects
    'loop through all the report objects to find all the subreports
    For Each crReportObject In crReportObjects
    If crReportObject.Kind = ReportObjectKind.SubreportObject Then
    'you will need to typecast the reportobject to a subreport
    'object once you find it (***you'd go to setting the parameter here - or not...)
    crSubreportObject = CType(crReportObject, SubreportObject)
    'open the subreport object
    crSubreportDocument = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName)
    'set the database and tables objects to work with the subreport
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • While generating a crystal report can we edit database fiels in field explorer (at middle can we edit database fields)

    while generating a crystal report can we edit database fiels in field explorer (at middle can we edit database fields)

    Wrong forum to post the question, try to post the question in crystal reports community.
    Its not possible to edit the database fields while creating the reports, its only used to call the rows of values in it. Can you explain me in detail what are you actually looking for .
    --SumanT

  • While generating a crystal report can we edit database files in field explorer ?

    Hi,
    while generating a crystal report can we edit database files in field explorer (at middle can we edit database fields)
    Regards,
    Mahendra

    Wrong forum to post the question, try to post the question in crystal reports community.
    Its not possible to edit the database fields while creating the reports, its only used to call the rows of values in it. Can you explain me in detail what are you actually looking for .
    --SumanT

Maybe you are looking for

  • Not getting data in cube from lookup DSO

    Hi guys, I have a transformation with source DSO and the target Cube. In which I have a look-up from another DSO to the cube in this transformation, end routine. But I am not getting the records I needed in the cube, which are supposed to flow from a

  • PSCS6 Stalls When Trying to launch from Bridge

    When I attempt to launch PSCS6 from Bridge, it hangs and I get a Run Time error... R6034. At that point all I can do is restart my computer. CS6 works fine as long as I don't try to get into it through Bridge. How to fix?

  • Lost iPhoto Library due to system wipe

    I had to wipe my Mac due to a hard drive problem. I lost all of my iPhoto pictures from a year back in time. I had iCloud turned off on my phone because I didn't like how every single picture (even deleted pictures) were added to my library. My photo

  • Reason for errors in IDOCS ? pls tell small scenarios

    hi pls tell practical scenarios reason for errors in idocs? all ale configuration are done.

  • Sharing certain files

    I am pretty new to using networks and am wondering how can I share certain files but have others inaccessible? I am under the impression that once Personal File Sharing is turned on then ALL files are accessible; is this accurate? Any help would be a