Help converting a bigint to a DateTime in Crystal Reports 2008

The data in a table contains a bigint which needs to be displayed in DateTime in the Crystal Reports.  Can someone please describe what I would need to do within the Formula to make this happen?
thank you.

I need to figure out the same thing:  How do I get this into a Crystal Reports Function and call it?
I have this in SQL and need to run it in Crystal Reports Language as a function
Create Function dbo.GetTimeFromTicks(@Ticks BIGINT)
Returns DateTime
As
Begin
Declare @Days BIGINT
Declare @DaysBefore1753 BIGINT
Declare @TimeTicks BIGINT
Declare @Seconds BIGINT
Set @Days = @Ticks/Convert(BIGINT, 8640000000000)
Set @DaysBefore1753 = Convert(BIGINT, 639905)
Set @TimeTicks = @Ticks % Convert(BIGINT, 864000000000)
Set @Seconds = @TimeTicks/Convert(BIGINT, 10000000)
Return DateAdd(s, @Seconds, DateAdd(d, @Days - @DaysBefore1753, Convert(DateTime, '1/1/1753')))
End
thanks,
Mike

Similar Messages

  • How to set Default DateTime values in Crystal Reports 2008

    Hi All,
    I'm using Crystal Reports 2008. I have two fields FromDate and ToDate in reports. While running report, FromDate field should be displayed with CurrentDate + 00:00:00 in the UI and for ToDate it should be displayed with CurrentDate + 23:59:59 format.
    I have tried the below things, But still I want to set CurrentDate + 00:00:00 time in DateTime field.
    "In CR 2008 you would set the time portion to 00:00:00 in this way:
    1) Edit the date/time parameter and look for the 'Default Value' option; it would be blank
    2) Set this to 00:00:00
    This would default the calendar to 12/30/1899 00:00:00. The only worry here is, when you click on the calendar icon you would be presented with the calendar for the year 1899 and it is painstaking to scroll all the way to the current year."
    I found one solution in SAP forum and I have added the below lines in Record Selection formula,
    {@FromDate} = date(@CurrentDate)+time(00,00,00)
    {@ToDate} = date(@CurrentDate)+time(23,59,59)
    When I run the report, I still getting the empty values in the input parameters screen.
    Am I missing anything? Kindly help
    Thanks,
    Ramesh Kumar G.

    See the following for samples:
    Java (Crystal Reports for Eclipse) SDK - Business Intelligence (BusinessObjects) - SCN Wiki
    BusinessObjects Enterprise / SAP BusinessObjects Business Intelligence Platform 4.x Java SDK Applications
    Business Objects / BI Unmanaged Java RAS SDK Sample Applications
    Developer Help Files:
    Crystal Reports SDK
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Converting a binary string into a JPEG image in Crystal Reports 2008

    Hi Gang
    Iu2019m having problems converting a binary string into an image in Crystal Reports 2008
    I have JPEG images stored in ECC.  ECC stores the data in binary format.
    Iu2019m using the ECC function module SKWF_PHIO_CONTENT_ACCESS_GET to retrieve the data.  This function module has an export table, FILE_CONTENT_BINARY, which returns several lines of data.  Each line contains a maximum of 1,024 characters.
    When I drop the T_ FILE_CONTENT_BINARY.LINE field into my Crystal Report detail section, I wind up with a report that displays all the lines in FILE_CONTENT_BINARY table.  (in my case, 19 lines are displayed.)
    I created a formula to collect all the data into a single string.
    whileprintingrecords;
    stringvar data:= data & {SKWF_PHIO_CONTENT_ACCESS_GET.T_FILE_CONTENT_BINARY.LINE}
    I added the formula to the detail section and itu2019s doing a great job collecting the data.
    I then inserted a picture object in the report footer, opened the format editor, navigated to the u201Cpictureu201D tab, and inserted a formula for the u201Cgraphics locationu201D.
    whileprintingrecords;
    stringvar data:=data;
    data
    My clever idea turned out to be a disappointment . . . . my picture object is blank.
    Does anyone have a solution for converting a binary string into a JPEG image?

    Save the JPEG in a format CR supports. Refer to the help file for the file types.

  • Converted to Crystal Reports 2008 and now have an issue with deployment

    Post Author: lwager
    CA Forum: Deployment
    I have converted my application to Crystal reports 2008 and I have that as a prerequisite in my set up program but everytime I try to install the software package on the client's machine I get this error when it is trying to install Crystal Reports
    Verifying file integrity of C:\DOCUME1\lauriew\LOCALS1\Temp\VSD1B7B.tmp\CrystalReports 12.0\CRRuntime_12_0_mlb.msiWinVerifyTrust returned 0File trustedError: Setup has detected that the file 'C:\DOCUME1\lauriew\LOCALS1\Temp\VSD1B7B.tmp\CrystalReports 12.0\CRRuntime_12_0_mlb.msi' has changed since it was initially published.
    Does anyone know why I am getting this error?  Thanks in advance for your help.

    I'm having the same problem ! Can someone help me with this problem ????

  • Help required in embedding flash file object into Crystal Report file.

    Hello,
          I use the default version of Crystal Report (i.e.'Crystal Report Basic For Visual Studio 2008 - version 10.5' ) which is the part of 'Visual Studio 2008', to create and display the Report. Further, as a requirement, I have to show 'Event Video' into the Report. But, as this default version of Crystal Report does not support Flash File, I uninstalled it and downloaded and installed the 30 days trial version of the Crystal Report (i.e. Crystal Report 2008 - version 12.0).
          Then, I created a new Crystal Report File using 'Crystal Report 2008 Designer', embedded the video as a Flash File(i.e. SWF file) into it. Now,  when I add this newly created Crystal Report File into my sample application, which is created using VS 2008, it does not shows the embedded video.
          So, can anybody please tell me, how can I embed the Flash File into Crystal Report, so that it will be visible in the sample application?
    I would like to appreciate your help and support.
    Thanks,
    -Yogesh.

    Symptom :
    When embedding a pdf document into a Crystal Report, only the one page shows.
    Reproducing the Issue
    Environment:
    Crystal Reports OLE object
    Cause
    An OLE object only displays the first page.
    Resolution
    Embed multiple objects, one for each page
    Or
    Use a hyperlink to the object instead
    Hope this helps!
    Regards,
    Vinay

  • Crystal Reports 2008 in Windows Vista x64 + IIS7 DOESNT WORK!!!!!! HELP!

    Hi,
    I´m developing an application with Microsoft Visual Studio 2008 and Crystal Reports 2008 Professional
    (i´m not using the Crystal Reports 2008 for .Net basic)
    As I have Windows Vista x64, my ASP.NET applications run under IIS7, but for my surprise, Crystal doesn´t work under Vista x64 + IIS7. I got the following error:
    An error has occurred while attempting to load the Crystal Reports runtime. Either the Crystal Reports registry key permissions are insufficient, or the Crystal Reports runtime is not installed correctly. Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required.  Please go to http://www.businessobjects.com/support for more information.
    When I run the same routine in an Windows Application the error doesnt occur. It only happens under Web Applications.
    I tested in a Windows Vista 32 bit and there´s no error....
    Crystal Reports 2008 does not work in II7 x64 ?
    Is there any solution?
    Please.... help me!!!!!

    Hi Fernando,
    Please read and follow the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] for future topic posts as yours violates the current policy.
    You will need to build your application to run in 32 bit only mode. This note explains how to do it:
    [Set app to 32 bit mode|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    Jason

  • Need help with adding formatted text and images to Crystal Report?

    Here's my scenario:
    I have a customer statement that's generated as a crystal report and that has a placeholder for advertisement. The advertisement is mixture of formatted text and images. Until now we only had one advertisement that was always used on the report. The new requirement is that we would have a pool of hundreds of advertisements and would need to display one specific advertisement on the customer statement based on various marketing criteria. They key is that the advertisement content will be determined programmatically and cannot be hardcoded into the report. I'm using Crystal2008 with .net SDK.
    Here are the solutions I thought of, but I'm still rather lost and would appreciate your help/opinion.
    1) Pass HTML or RTF to the report
    Not really sure if this is possible and how to get it done. Also how would I pass in images? Would display formatting be reliable when exporting to PDF?
    2) Create each add as a subreport and append it programatically
    I actually have this working, but I only know how to append a new section to the end of the report and then load the subreport to the section. I have no other controll of the placement. Is there a way to dynamically load a subreport to a predefined section in the main report? How about adding a dummy subreport in the main report as a placeholder and then replacing it with a different subreport? How could I do this?
    3) Pass an Image to the report
    I would create each advertisement as an image and then would somehow add the image to the report. How would I load the image and control the placement? Could I somehow define a placeholder for the image in the main report-maybe a dummy image to be replaced?
    Thank you.

    Hello Pavel,
    I would got the third way.
    You can use dynamic images in your report.
    Just by changing the URL to the image the image can be changed.
    Please see the [Crystal Manual|http://help.sap.com/businessobject/product_guides/cr2008/en/xir3_cr_usergde_en.pdf] and search for images.
    or directly here
    [Setting a Dynamic Graphic Location Path on an Image Object|https://boc.sdn.sap.com/node/506]
    [Dynamic image and HTTP://|https://boc.sdn.sap.com/node/3646]
    [codesample for .NET|https://boc.sdn.sap.com/node/6000]
    Please also use
    [Crystal Reports 2008 SDK Documentation and Sample Code|https://boc.sdn.sap.com/developer/library/CR2008SDK]
    [Crystal Reports 2008 .NET SDK Tutorial Samples|https://boc.sdn.sap.com/node/6203]
    Hope this helps
    Falk

  • Need help converting to bigint

    HI,
    I need to update a field based on 3 string concatenated together that need to be converted to a bigint:
    SET
    ReferenceNumber =
    CAST(CONVERT(varchar(10),
    CheckDate, 112)
    + string1+ string2
    as
    bigint)
    string 1 and string 2 are numbers with leading zeros
    I have tried many different syntax but getting the arithmetic overflow error converting to bigint
    Any Idea why?

    Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
    to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. 
    >> I need to update a field [sic] based on 3 string concatenated together that need to be converted to a BIGINT: <<
    Columns are not fields; this is a fundamental concept in RDBMS. Why are you using BIGINT? What math are you doing on it? What math do you have that requires a number greater than the atoms in the Universe? 
    You do not understand  that SQL is a database language, so you treat it like COBOL, or VB or whatever you learned first. That mindset is why you said “field”! Think in terms of  data, not computations and concatenations. 
    If you want to locate something in time and some kind of space, why not use three columns? My guess, since you did not bother with DDL or even sample data, is this: 
    CREATE TABLE Foobar
     check_date DATE DEFAULT CURRENT_TIMESTAMP NOT NULL,
     string_1 CHAR(5) NOT NULL
       CHECK (string_1 LIKE '[0-9][0-9][0-9][0-9][0-9][0-9]'),
     string_2 CHAR(5) NOT NULL
       CHECK (string_2 LIKE '[0-9][0-9][0-9][0-9][0-9][0-9]'),
     UNIQUE (check_date, string_1 , string_2),
    If you wish, you can add a computed column with the concatenation, but I would tend to think it belongs in a VIEW or query. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Converting Crystal Report 2008 report into webi

    BO XI R2 SP1
    Crystal 2008
    Windows 2003
    I was wondering if it is possible to convert reports built in Crystal 2008 into webi using some mechanism within BO. Please help if  you know how to do that.
    Thanks!

    Sorry.There is no way to do this. The RCT only converts Deski documents to Webi.
    PS: This question was previously asked and answered [here|Converting Crystal Reports to Webi;.

  • Crystal Reports 2008 - help with formula to retrieve lastfullmonth

    Hi, I'm new to this forum.  First post.  I have a SQL query where
    :month(CAST(a.LAST_MOD_DT / 86400 AS datetime) + CAST('01/ 01/1970' AS datetime)) = (MONTH(getdate())- 1)
    I need to create a CR formula that will pull in data from last month as this report will be run on a monthly basis.  If I use 'getdate() -31' there will be a problem with the months that don't have 31 days.
    I'm also very new with creating formulas so including an explaination would be helpful.  Thanks,
    Joyce

    Sorry for the slow repsonse in getting back to you.
    I wasn't able to get the SQL query to work.  I did find one that does work except I need to find out how to pull in the minimum date and the maximum date of the records into the report.
    Here's the SQL query:
    --to query for the prior month,  if January then month = 12 else month = (current month - 1 month).
    and
    month(CAST(a.LAST_MOD_DT / 86400 AS datetime) + CAST('01/ 01/1970' AS datetime)) =
    CASE WHEN cast(DATEPART(Month,GETDATE()) as datetime) = 01
                          THEN month(cast((str(12)+'/'+ str(01) +'/'+STR(YEAR(Getdate())-1)) as datetime))
                          ELSE MONTH(cast((str(DATEPART(Month,GETDATE())-1)+'/'+ str(01) +'/'+STR(YEAR(Getdate()))) as datetime)) END
    --to query for the proper year, if January then year = (current year - 1 year) else year = current year.
    and
    year(CAST(a.LAST_MOD_DT / 86400 AS datetime) + CAST('01/ 01/1970' AS datetime)) =
    CASE WHEN cast(DATEPART(Month,GETDATE()) as datetime) = 01
                          THEN year(cast((str(12)+'/'+ str(01) +'/'+STR(YEAR(Getdate())-1)) as datetime))
                          ELSE year(cast((str(DATEPART(Month,GETDATE())-1)+'/'+ str(01) +'/'+STR(YEAR(Getdate()))) as datetime)) END

  • Help Needed in Crystal Reports 2008 Charting - XY Scatter

    Hi,
    I need to create a XY Scatter plot using CRYSTAL 2008.i have to create 7 graphs of same XY Scatter plots in one single report.the 7 graphs i said because i have a Cost category object which will have 7 categories.so for each category i have to show one XY Scatter plot.
    However the data only changes between  each category. i have to use the same objects for all the 7 plotters.
    there will be a 1 dimension object and two measure objects in this.
    So how to develop the report for this requirement?
    Urgent help is needed.
    Regards,
    Kishore. .
    Edited by: NandaKishore A.V on Feb 23, 2012 8:30 AM

    hi Kishore,
    if you Insert another Group on Category, and then move your chart into the Category Group Header, does that solve the issue?
    jamie

  • Crystal Reports 2008 Can not edit in the formula editor? Help?

    I just used Crystal 2 weeks ago just fine. Now when I go into a report and then into the select expert then into the formula editor it will not let me edit my formulas. The cursor is there, but I can do anything. I tried to find and replace, but I get the text is read-only. How the heck do I fix this? It's pretty urgent.
    Edited by: Ludek Uher on Jan 6, 2012 8:58 AM

    Hi,
    The only time I've seen formula grayed out is when I go into a conditional formatting formula and try to edit other formula fields on the Report.
    What formulas are you trying to edit? The best place to edit a formula is from the 'Formula Workshop'.
    Report > Formula Workshop; you can edit any formula from here.
    Hope this helps!
    -Abhilash

  • Crystal Reports 2008 SP3 with Visual Studio 2005 help !!

    Have application that uses reports developed using CR2008. The reports in question are created from an XML datasource and are populated at runtime with a dataset.
    The reports work fine on developement machine but the client machines keep displaying the database login prompt.
    What do I need to do to fix this

    Something is not right here. If you are looking at assembly versions, then there are versions 12.0.200.0 and 12.0.1100.0 - framework 2 and framework 1.1 respectively. These do not change from SP to SP.
    File versions do change. So, the assemblies for CR 2008, SP 3 would be 12.3.2000.601. Version 12.3.1100.601 is not familiar to me...
    So, what libraries are you refering to? What is the version of the crpe32.dll?
    BTW., sharing of log files is typically reserved for [phone|http://store.businessobjects.com/store/bobjamer/en_US/pd/productID.98078100?resid=S6I@hgoHAkEAAGsiyVkAAAAR&rests=1282226845369] cases.
    - Ludek

  • Help ! Crystal Reports 2008 for Visual Studio Hangs

    I am using CR 2008 in VS 2008. When I try to set a data source in a crystal reports viewer the first time it hangs. This only occurs on the very first viewer that gets set. Once the first one works, I never have a problem again.
    This has been a problem through a number of CR releases. It is not a new issue.
    Thanks.

    And like all other releases the delay is due to the first time your app loads CR runtime is takes time do so, all programs do this. CR simply doesn't load in your memory space until it's called.
    Load a dummy report on the Main Form when your app is loading then close the dummy report, it will add additional time to load your main app but it appears then CR loads the reports quickly.
    No way around this. Also, make sure your reports have the Verify Database on first load or any of the Verify options, CR will try to connect to the DB and verify which can also take time.
    Don

  • Help - Crystal reports 2008 - will not work

    I am a Systems Administrator for a small company of 450 users.
    I am unfamiliar with Crystal reports
    We have a recent problem with Crystal Reports 2008, only 1 user in the company uses it.
    Since I recreated a windows profile on this users PC who has Crystal installed. 
    She is using .CSV files as her data sources. These CSV files are on her local machine. 
    She is trying to load an RTM template file, then do a refresh, and it asks for a datasource? 
    We try to select Excel, but it asks for a username and password to connect to the excel Datasource, and anything we type in fails. 
    Previously a refresh just worked. 
    I uninstalled reinstalled, still asking to select datasource. 
    I installed this originally 4 months ago and we did not have this problem. 
    Can you please assist?

    Hello,
    Sounds like possibly a Microsoft update which altered the security settings either on the CSV or the folder where it's located.
    Can she create a new report off the CSV if she copies it locally? I assume the csv is on a network share?
    Don

Maybe you are looking for