How to include Time Interval in crystal report

Hi All,
       I have to create a  crystal report in  XI release 2. In the report I have 2 query side prompts "FromDate" and "ToDate" and one report side prompt "Time Interval". I have to show the data for each time interval between the two dates. means suppose if my "Fromdate" is 23 March 2010 and "Todate" is 25 march 2010 and time interval is 1 hour then I have to show data for each 1 hour time gap. means suppose my data in Db starts from 23 march 2010,11:25:25 then I must show data between 11:25:15 to 12:25:15 and so on...upto 25 march 2010.
     I am not able to retrieve the data accordingly. And how to use the timeinterval to retrieve data from db for that particular time interval.Please reply asap.
Edited by: anushree2187 on May 21, 2010 7:28 AM
Edited by: anushree2187 on May 21, 2010 7:37 AM

you can create a group on the date field and then select how to group it by date, you can go up to the second.

Similar Messages

  • Step- by- Step on How to Load Excel data into Crystal Reports?

    Hi Friends,
                      Can anyone send me a Step- by- Step on How to Load Excel data into Crystal Reports? Pls help me. Thanks in Advance.
    Vijay

    It's also important to 'prep' the excel file prior to connecting to it.
    Give the data tab a meaningful name
    Make sure the column headers are unique and that every column has a header
    Delete any blank tabs
    If you have trouble with Excel changing the data type of a field (say, a social security number you want to be a string value rather than a number so you don't lose leading zero) an alternative would be to save the spreadsheet file as a CSV, create a schema.ini to specify the data types for each column (example below) and use the same steps to connect except instead of choosing Excel 8.0, scroll to the bottom and choose Text.  You have to make sure the CSV file is in the same folder as the schema.ini file that defines the columns.
    Schema.ini example:
    200912PUSD.csv
    ColNameHeader=True
    Format=CSVDelimited
    MaxScanRows=25
    CharacterSet=OEM
    Col1=SSN Char Width 9
    Col2=LAST_NM Char Width 25
    Col3=FIRST_NM Char Width 25
    Col4=DOB Date
    Col5=STDNT_ID Char Width 10
    Col6=SORTKEY Char Width 10
    Col7=SCHOOL_NM Char Width 30
    Col8=OTHER_ID Integer
    Col9=GRADE Char Width 2
    The filename in the first line needs to have the []  brackets around it, but I couldn't get it to display in this forum correctly.
    Edited by: Eric Petersen on Jan 27, 2010 9:40 AM

  • How to hide Group Tree in Crystal Report Server.

    Hi all visitors
    i have created one crystal report and my report use group to summary the amount of each day.
    after i use group to summary, i used text box cover the group. so my group can't click anything.
    After that i upload my report to crystal report server, when i viewed my report and when i click on Group Tree, it will show the list of group (group date in crystal report) and it also can click. I don't want to show the Group Tree in Crystal Report Server.
    Anybody know how to hide group tree in crystal report server?
    Best Regards,

    Are you talking custom application, or infoview?  If it is custom app, you would have to look at the setToolPanelViewType method.  if its infoview, no direct way to change this that i know of.

  • How to center the content in crystal report viewer?

    open crystal report viewer in winform, default at the left top
    after maxmium the winform window, content become at the center
    another odd thing is that i set window winform size 1208*1024 and crystal report view is fill
    then tried, content is not center any more
    How to center the content in crystal report viewer in code?
    Edited by: Mathew_666 on Oct 6, 2011 5:20 AM

    Since there is no control for center you'll need to do the math on your own. This is just a rough draft, but you'll get the idea.
    One of the things you'll need to figure out is your buffer to help you give a centered feel. We'll say that value is 50 in this case.
    Height
    int buffer = 50;
    int formHeight = 1000; // we'll assume a height of 1000 in this case
    int crystalTop = buffer;
    int crystalViewerHeight = formHeight - (buffer * 2); // buffer is at the top and bottom
    Width
    int formWidth = 1000; // we'll assume a width of 1000 in this case
    int crystalLeft = buffer;
    int crystalViewerWidth = formWidth - (buffer * 2); // buffer is at the top and bottom

  • How to retrieve Statistics info from Crystal Report file

    In Crystal Reports designer,  if you go to File|Summary Info that dialog has two tabs. The second tab is called "Statistics" which contains the following:
    Last Saved By
    Revision number
    Total Editing Time
    Last Printed
    Created
    Last Saved
    How can I retrieve this information via either the .NET SDK or the RAS SDK?

    Hi David,
    Actually I did understood your question. I did say that some of that info is available from the hard drive file system.
    Use the Object Browser and find this source:
    public System.DateTime CreationTime { set; get; }
        Member of System.IO.FileSystemInfo
    Looking at the properties you'll see all the info you are looking for is there. As I said, some of the info is available from the Summary API's and some are available from the file system. The file system is not CR but basic Microsoft API's. Search their help for more info on how to use them.
    Thank you
    Don

  • How to create a lookup in Crystal Reports or SQL Server

    I need to create an Operating Statement report.  The problem is that I need to create a lookup or something to satify a requirement that even if there is no data in the system it will still bring back a description.
    Example:  01 = Income, 02 = Expense, 03 = Labor.. ect(there are 31 of these)
    If there is no data for 03 I still need Labor to print.
    In my SQL I did a CASE statment that said when
    Account = '3001' THEN 01, Account = '3002' THEN 02, Account = '3003' THEN 03 ECT
    Then I created a formula a in Crystal that reads the case Statement to assign descriptions 01 = Income, 02 = Expense, 03 = Labor.
    The problem is when there is no data for Account 3003 then the formula does not know to still bring back 03 as Labor.
    Can I create a lookup to assign the description, I dont care about the values they can come back as zero.
    Is there a formula or can I create a sql statement to pull back a derived table anything but to create a physical table?
    Any help would be great.
    Application is Crystal Reports XI 2 SP2
    SQL Server 2005
    Peoplesoft 8.9 Financials.

    Thank you Ludek for answering my post.  That was just the information I needed.  I inserted a formula field and then changed the font to Wingdings and that gave me my checkbox.    Not being familiar with Crystal Reports I had a devil of a time just figuring out how to insert a formula field as the field explorer is not easy to find.  The following link will help any developers who might have that problem too.
    http://aspadvice.com/blogs/rjdudley/archive/2005/08/09/2642.aspx
    Lastly Iu2019ll add the part of my formula which gives you a checked or unchecked check box in a Windings font:
    --For Check box checked
        Formula = Chr(254)
    --For Check Box unchecked
        Formula = Chr(168)

  • How to close database connections in Crystal Reports

    I am using the following code to connect to database. I can either pass JNDIName or I can provide values for others by leaving JNDI name empty.
    If i use JNDI name, it will use a connection from the connection pool of App Server (in my case Weblogic), but it is not releasing the connection after use. Connection remains even if I logoff from the application. If i keep my max connections as 15 in weblogic, after clicking the page with crystal report 15 times all will remain active and users will not be able to login to the application.
    If i use connectionString and others without using JNDI Name, it directly connects to database. So it creates a connection in database server directly without using connection pool of weblogic. If i check weblogic, it shows no connection in use as expected, but if i check database, i can see the no. of connections increasing everytime a user clicks a crystal report page.
    When the connection touches the maximum allowed connection in server, every application using the same server goes down
    How can I close the connection which was created for the viewing the report?
    String reportName = "/reports/BankBalance.rpt";
    ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute(reportName);
    if (clientDoc == null)
             clientDoc = new ReportClientDocument();
             clientDoc.setReportAppServer(ReportClientDocument.inprocConnectionString);
            // Open report
            clientDoc.open(reportName, OpenReportOptions._openAsReadOnly);
           String connectString = ""; // jdbc:sybase:Tds:DBSERVERNAME:9812/DBNAME?ServiceName=DBNAME
           String driverName = "";    // com.sybase.jdbc3.jdbc.SybDriver
           String JNDIName = "DS_APP";
           String userName = "";
           String password = "";
           // Switch all tables on the main report and sub reports
           CRJavaHelper.changeDataSource(clientDoc, userName, password, connectString, driverName, JNDIName);
         // logon to database
          CRJavaHelper.logonDataSource(clientDoc, userName, password);
    // Store the report document in session
    session.setAttribute(reportName, clientDoc);
                   // Create the CrystalReportViewer object
                          CrystalReportViewer crystalReportPageViewer = new CrystalReportViewer();
         String reportSourceSessionKey = reportName+"ReportSource";
         Object reportSource = session.getAttribute(reportSourceSessionKey);
         if (reportSource == null)
              reportSource = clientDoc.getReportSource();
              session.setAttribute(reportSourceSessionKey, reportSource);
         //     set the reportsource property of the viewer
         crystalReportPageViewer.setReportSource(reportSource);
         crystalReportPageViewer.setHasRefreshButton(true);
         crystalReportPageViewer.setToolPanelViewType(CrToolPanelViewTypeEnum.none);
         // Process the report
         crystalReportPageViewer.processHttpRequest(request, response, application, null);

    the sample shows how to clear RAS and Enterprise resources after viewing report.
    1. If you use unmanaged RAS - as I can see you using setReportAppServer, then remove the enterprise related stuff : instantiating and cleaning code.
    The sample code is meant to give you an idea on how you can release the resources after done with viewing report. In your case all you need to do for cleaning is call close() on ReportDocumentObject. The sample will need to be modified for your requirements.

  • How to get select query for crystal report in c# code

    In C#, (Visual Studio 2008 ) I need to use the native Crystal Reports objects to get the complete SQL statement as it appears when you view it in Crystal Reports.
    In Crystal Reports 12.0, Go to "Database > Show SQL Query..." ... That is what I need to get via C# code. I can get bits and pieces of parameter info etc but I just want the whole SQL statement.
    How to get this?

    Hi Ganesh,
    It's simple to use RAS, include the assemblies and use this to open your report document:
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    using CrystalDecisions.ReportAppServer.ClientDoc;
    using CrystalDecisions.ReportAppServer.Controllers;
    using CrystalDecisions.ReportAppServer.ReportDefModel;
    using CrystalDecisions.ReportAppServer.DataSetConversion;
    using CrystalDecisions.ReportAppServer.DataDefModel;
            CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            ISCDReportClientDocument rptClientDoc;
    To open the report use:
         object rptName = openFileDialog.FileName;
                    rpt.Load(rptName.ToString());
                    rptClientDoc = rpt.ReportClientDocument;
    Then to get the SQL set the log on info:
                rptClientDoc.DatabaseController.LogonEx("10.50.212.77,1433", "xtreme", "sa", "password");
                GroupPath gp = new GroupPath();
                string tmp = String.Empty;
                rptClientDoc.RowsetController.GetSQLStatement(gp, out tmp);
                MessageBox.Show(tmp, "Data Source Set and SQL Statement", MessageBoxButtons.OK, MessageBoxIcon.Information);
    Thank you
    Don

  • How to set printersettings for the crystal report viewer in SAP BI dynamically

    Hello
    I have set the URL method for my crystal report and with parameter passing as shown below, it was displaying the crystal report viewer by connecting to the SAP BI 4.0 server with this method.
    http://cr:port/businessobjects/enterprise115/desktoplaunch/opendoc/openDocument.jsp?sDocName=CRLabelParam&sType=rpt&lsSnPrinted=0&lsSsTestProjectNr=1
    This URL will be called from Web application by different users, i would like to set the printer settings differently for different users for this crystal report viewer how shall i need to set the printer options?
    shall i need to set the printer settings programatically for each user. Please advise me how do i need to proceed.
    Thanks & Regards,
    Rajeswari.

    There are no BI / CR APIs that would do this for you. The way I see it, you'll have to have your own print button and populate it with the correct printer information for each user as they request the report. Of course, alternatively, use the viewer printer button and get the users to choose the correct printer.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • How to get actual error from Crystal Report

    We are using Crystal report in web service.
    We faced some problem due to crystal report unexpected error.
    Refer the below error message.
    Xception E NSF NSFZ1100 20100608 145511565 GPRAB0 : GPRZ10 GUEC0001 [1] AbstractService Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
    Xception E NSF NSFZ1100 20100608 145511972 GPRAB0 : GPRZ10 GUEC0001 [1] AbstractService at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
    at System.Windows.Forms.MessageBox.Show(String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon)
    at CrystalDecisions.Windows.Forms.CrystalReportViewer.HandleExceptionEvent(Object eventSource, Exception e, Boolean suppressMessage)
    at CrystalDecisions.Windows.Forms.CrystalReportViewer.HandleExceptionEvent(Object eventSource, Exception e)
    at CrystalDecisions.Windows.Forms.ReportDocumentBase.GetLastPageNumber()
    at CrystalDecisions.Windows.Forms.ReportDocumentBase.GetLastPage()
    at CrystalDecisions.Windows.Forms.DocumentControl.ShowLastPage()
    at CrystalDecisions.Windows.Forms.PageView.ShowLastPage()
    at Biz.Nissan.Cats.CORE.REPORT.LibCrystalReport.TotalPageCount(ReportDocument Rpt)
    at Biz.Nissan.Cats.CORE.REPORT.LibCrystalReport.Print(BaseReport RptDefinition)
    at Biz.Nissan.Cats.CORE.REPORT.MCTLIST260Print.Print(IFData ifData)
    at Biz.Nissan.W3.CATS.BC.Service.DistributeService.ExecuteMpp()
    How we get the actual error from crystal report?
    Thanks in Advance

    Same as
    crystal report unexpected error in Web service (IIS)
    Closing this thread.
    Ludek

  • How to optimize the performance of crystal report?

    Hi,
    -I have to design a crystal report with best possible optimization. Optimization is main concern since report will run against 1-2 million data set. Though I am using parameter to fetch only the required data, required data can go till 1 million records.
    -Based on the input passed by the user I have to group the data in report. And for each selected parameter the Detail section I am printing is different. For example:-If user selects store then detail section is different and if user select Host then detail section will be different.
    -Report can be grouped by Time Field also. So to full fill this requirement I would have to create a sub report since other parameters are of string type and can be used in one formula to get parameter based grouping in report. However If I try to return Time filed from the same formula I get the errors the "Return type should be of String typeu201D. This forces me to create sub report for Time based grouping. If user selects Time Field to be grouped on, all the information in the main report gets suppressed and only the sub report gets printed.
    If user select store, Host and User in parameter to be grouped on, sub report gets suppressed.
    Now with the above mentioned points I tried to optimize the report in following way.
    -Printing 1 million records in the report does not make sense; hence we wanted to show the summary of all the records in chart section but wanted to print just 5000 records in detailed section. Suppressing detailed section after 5000 records does not help much since suppressing just saves the time in printing and does not limit the number of records to be fetched from the DB.I have a subreport also so it fetches the data 2 times from the DB hence makes the performance of the report worse.
    To solve this problem I used command object and put the charts in the subreport and detail in main report.
    In main report's Command Object I limited the number to records to be fetched from the DB to 5000 using rownum<5000 but in subreport's Command Object I did not set any limit in the query but I am doing all my aggregation in SQL which means do summary operation in DB and get only summarized data from DB.
    -To solve section problem I am using Template object (new feature added in CR 2008).In which I am returning the field based on the "Group By" parameter selected by user.
    -For time Field I have created two sub reports, one for chart and other one for details in the same way described in point one(Printing 1 million recordsu2026u2026).
    After implementing these points my crystal reports performance improved drastically. The report that was taking 24 minute to come back now taking only 2 minutes.
    However I want my report to come back with one minute. It returns if I remove the sub reports for Time Based Grouping but I can not do so.
    My questions here are,
    -Can I stop Subreport from fetching the data from DB if itu2019s suppressed?
    -I believe using Conditional Template Object is a better option rather than having multiple detailed sections to print the data for a selected Group. However any suggestion here to improve the performance will be appreciable.
    -since crystal report does not provide any option to limit the number of records to be fetched from DB, I am forced to use command object with rownum in where condition.
        Please let me know about other option(s) to get this done...If there is any.
    I am using Crystal report 2008.And we have developed our application the use JRC to export crystal report in PDF.
    Regards,
    Amrita
    Edited by: Amrita Singh on May 12, 2009 11:36 AM

    1) I have to design a crystal report with best possible optimization. Optimization is main concern since report will run against 1-2 million data set. Though I am using parameter to fetch only the required data, required data can go till 1 million records.
    2) Based on the input passed by the user I have to group the data in report. And for each selected parameter the Detail section I am printing is different. For example:-If user selects store then detail section is different and if user select Host then detail section will be different.
    3) Report can be grouped by Time Field also. So to full fill this requirement I would have to create a sub report since other parameters are of string type and can be used in one formula to get parameter based grouping in report. However If I try to return Time filed from the same formula I get the errors the "Return type should be of String typeu201D. This forces me to create sub report for Time based grouping. If user selects Time Field to be grouped on, all the information in the main report gets suppressed and only the sub report gets printed.
    If user select store, Host and User in parameter to be grouped on, sub report gets suppressed.
    Now with the above mentioned points I tried to optimize the report in following way.
    1) Printing 1 million records in the report does not make sense; hence we wanted to show the summary of all the records in chart section but wanted to print just 5000 records in detailed section. Suppressing detailed section after 5000 records does not help much since suppressing just saves the time in printing and does not limit the number of records to be fetched from the DB.I have a subreport also so it fetches the data 2 times from the DB hence makes the performance of the report worse.
    To solve this problem I used command object and put the charts in the subreport and detail in main report.
    In main report's Command Object I limited the number to records to be fetched from the DB to 5000 using rownum<5000 but in subreport's Command Object I did not set any limit in the query but I am doing all my aggregation in SQL which means do summary operation in DB and get only summarized data from DB.
    2)To solve section problem I am using Template object (new feature added in CR 2008).In which I am returning the field based on the "Group By" parameter selected by user.
    Edited by: Amrita Singh on May 12, 2009 12:26 PM

  • How to protect ECC performance from Crystal Reports execution?

    Hello,
    We built Crystal Reports (CR) which reports from SAP FI InfoSets. These reports may take a long time to execute and potentially can impact all ECC users.
    AFAIK CR are executed in dialog mode on ECC.
    We know that from CR perspective we can only limit the number of records returned.
    One of the options is to create a dedicated application server instance for CR. But it looks like a costly one.
    Other options:
    Move data to BW every 15 minutes and execute reports from there.
    Schedule reports at night to minimize users impact.
    We are using ECC 6 EP3, BW 3.5, BOE XI 3.1 (with SAP Integration Kit) and Crystal Reports 2008.
    Can you please let me know if any of you have the same challenge.
    Thank you,
    Serge

    Hi Ingo,
    I'm using [BusinessObjects XI Integration for SAP Solutions Installation and Administration Guide|https://websmp209.sap-ag.de/~sapdownload/011000358700001646962008E/xi3-1_bip_sap_install_en.pdf] (from 2008-12-02). There are some references to batch publishing from BW. The same applies to your document [BusinessObjects Integration Kit for SAP - Installation and ConfigurationSDN Community Day - BusinessObjects Enterprise with SAP|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a00ee3b2-5283-2b10-f1bf-8c6413e0898f].
    When we schedule CR in BOE it still runs in dialog mode on ECC.
    Could you please be more specific where we can define switch to make it run as background process on ECC.
    Thank you,
    Sergey
    Edited by: Sergey Vlasov on Apr 16, 2009 11:56 AM

  • How to use email function in crystal report ?

    Post Author: kudo
    CA Forum: .NET
    Hi I'm a novice by touching .net not more than 2 months. Can somebody guide me how to use email function provided in crystal report components?(Better put a sample code so that I can understand well.)  ps: I'm using VS2005 VB.net.Thanks.

    Post Author: mewdied
    CA Forum: .NET
    'EXPORT to EMAIL        ''' Code for exporting the report to Mapi (.Net Windows application)        ''' *For a Web application you must export to disk as a PDF file first.
            crReportDocument.Load(Application.StartupPath + "\World Sales Report.rpt")        crMicrosoftMailDestinationOptions = New MicrosoftMailDestinationOptions        With crMicrosoftMailDestinationOptions            .MailCCList = "[email protected]"            .MailToList = "[email protected]"            .MailSubject = "Attached exported report"            .UserName = "admin"            .Password = "password"        End With
            crExportOptions = crReportDocument.ExportOptions        With crExportOptions            .DestinationOptions = crMicrosoftMailDestinationOptions            .ExportDestinationType = ExportDestinationType.MicrosoftMail            .ExportFormatType = ExportFormatType.PortableDocFormat        End With
            'Add some error handling        Try            crReportDocument.Export()            MsgBox("Report exported successfully.")        Catch err As Exception            MessageBox.Show(err.ToString())        End Try
    Hope this helps

  • How to use the DLL in crystal report (Additional applications)

    Hi,
    i have created a win32 dll, and now i want to use that dll in my crystal report how can i do so?, what i tried is i went to to Addntional functions catagory in formula workshop, and there i can see some dlls listed, similary i put my dll in the same path like "C:\Program Files\Common Files\Crystal Decisions\1.0\Bin" and other folder too. but i am not able to see that dll in "Addtional functions". can you plesase tell how can i achive this.
    Regards,
    Prabhakar J.

    Please re-post if this is still an issue to the .NET Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • How to use functional module in crystal report

    Hi all,
          I have imported my functional module to crystal report,
          but when i am previewing it  i am not getting data in that, according to my functional module.
          how to run my functional module through crystal report.
    thanks in advance

    Post Author: mewdied
    CA Forum: .NET
    'EXPORT to EMAIL        ''' Code for exporting the report to Mapi (.Net Windows application)        ''' *For a Web application you must export to disk as a PDF file first.
            crReportDocument.Load(Application.StartupPath + "\World Sales Report.rpt")        crMicrosoftMailDestinationOptions = New MicrosoftMailDestinationOptions        With crMicrosoftMailDestinationOptions            .MailCCList = "[email protected]"            .MailToList = "[email protected]"            .MailSubject = "Attached exported report"            .UserName = "admin"            .Password = "password"        End With
            crExportOptions = crReportDocument.ExportOptions        With crExportOptions            .DestinationOptions = crMicrosoftMailDestinationOptions            .ExportDestinationType = ExportDestinationType.MicrosoftMail            .ExportFormatType = ExportFormatType.PortableDocFormat        End With
            'Add some error handling        Try            crReportDocument.Export()            MsgBox("Report exported successfully.")        Catch err As Exception            MessageBox.Show(err.ToString())        End Try
    Hope this helps

Maybe you are looking for

  • I cannot install Virtual PC 7.0 onto PowerPC G5 iMac using OS 10.4.6

    Hi, I probably should try asking someone at Microsoft this question, but then I woud have to pay them, and I already did when I bought VPC 7. I had VPC 7.0 installed on a computer using OS 10.3.x and it worked fine. I got a new computer and am now un

  • When i plug my ipod in it tries to sync but gets stuck on the back up stage.  HELP

    When i plug my ipod in itunes loads etc then it states syncing, but it gets to stage 2 which is back up and wont get past that, ive left it on over night, reinstalled, checked my firewall etc and phones up itunes support with no success, Can any one

  • Side speakers on p7800 7.1 won't work with my 7.1 pcie soundblaster x-fi xtreme au

    I'm sure it's probably a dri've problem with my sound card because I bought it oem but I am not sure what to do. I followed all the troubleshooting tips i could find on this website and thought this forum would be my last resort. I have managed to ge

  • Query about EWA reports

    Hello, Most of our users log into the system using HTTP login. The "dialog steps" of HTTP task type is much greater than Dialog Tasks. However in the Trend Analysis part of the EWA, the graphs system activity and response time are only shown for Dial

  • No fax number could be determined for partner

    Hi, I received this message when I was trying to see output type after creating, saving sales activity (VC01N), then come back to this sales activity > Goto> Output. My output type is not shown here. So I went to Determin Analysis, I found 3 messages