Crystal Reports

35K

Solutions

15K

Contributors

Crystal Reports is a business intelligence application from SAP SE. It is used to graphically design data connections and report layouts from a wide range of data sources including Excel spreadsheets, Oracle, SQL Server databases and Access databases, BusinessObjects Enterprise business views, and local file-system information. Report designers can place fields from these sources on the report design surface, and can also deploy them in custom formulas (using either BASIC or Crystal's own syntax), which are then placed on the design surface. Crystal Reports also supports subreports, graphing, and a limited amount of GIS functionality.

Share tech news, updates, or what's on your mind.

Sign up to Post

I am at the final stage of  getting crystal report to work

in my c# application.

I got to the stage of dragging the CrystalReportviewer to the Report Screen
but found out that the CrystalReportViewer is greyed  out (Not Active)  and simply
gives me a circle crossed red  when dragged  which does not get the viewer dragged

See attached screen below:

Crystal Report Viewer Greyed Out  . WHY ???
I believe i have followed all the steps by emoreau  except for the fact that this
time around my datasource is not inline but from a database

What do i need to do,  to get the Tools/Reporting/CrystalReportViewer  active and
selectable

Thanks

Olukay
0
I have this script below in my c# application
Its under a click button and its supposed to run a crystal report


[] private void button3_Click(object sender, EventArgs e)
        {
           
            var results = GlobalConfig.Connection.GetStateCode_All();
            CrystalReportProcessor processor = new CrystalReportProcessor();
            LoginDetails._dsData = processor.ToDataTable(results);

            DataTable dataTable = new DataTable { TableName = "stateorigin" };
            string strFullPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "StateCodes.xsd");
            LoginDetails._dsData.WriteXmlSchema(strFullPath);
           
            _rptDoc.Load(System.IO.Path.Combine("c://TournamentTracker//ReportLibrary//StateCodes.rpt"));
            //Pass the dataset to the report
            _rptDoc.SetDataSource(LoginDetails._dsData);
           
            //Pass the Report Document object to the viewer
            crystalReportViewer1.ReportSource = _rptDoc;
         
        }[/code]

The first 3 lines executes without error and gets data from a table in database. (see previous post if required to see the data retrieved from database)

However when i got to the line   " LoginDetails._dsData.WriteXmlSchema(strFullPath);"below I got an error

See error screen below:

Error Screen while writing a Crystal Report
Grateful for your  help

Olukay
0
In Crystal Reports 2008  I have Crosstab simple layout where I present top 10 of manufacturers of 25 and totals of sold items.

Manufacturer             Number Of Items       Sold
R                  35                        
S                  22                        
C                  18                  
D                  16
N                  14
P                  12
M                  10
B                  9
A                  8
T                  6
TOTAL                  150
Total number of Items for those 10 manufactures is 150.

What I need is to add next column in my cross tab as percentage as below.
 
Manufacturer             Number Of Items       Sold       %
R                  35                        23.33
S                  22                        14.66
C                  18                        12.00
D                  16                        ...      
N                  14                        …
P                  12
M                  10
B                  9
A                  8
T                  6
TOTAL                  150
0
I understand that this is not easy to debug and help with but I'm posting some screenshots...hopefully someone can give me an idea where to look and how to do this...

(My first day of working with Crystal Reports and I'm not a CR developer )

1. The report looks like this. You see the tab "Main Report"? I want to add another tab but I don't know how this tab is built. I did a search in the code for "Main Report" and I don't find it. Did a search in stored procs and I don't see "Main Report". Did a search in our Web Services code and I don't see the word "Main Report"
EE-CR.png
2. The report itself looks like this and I see the file

EE-CR-2.png
3. This is the Windows Forms that's the container. Maybe I need to check all the User Controls but still....where is that tab coming from?

EE-CR-3.png
It's ok if no one can help.  I know it's hard to debug it without the code. I can ask my manager if it's ok to give the code and someone here could tell us how this all comes together.
0
Working on my first Crystal Report code. It was done by another developer and now I have to make changes to it.

The datasource is a stored proc. I added a new column.

How can I bind the column from the stored proc to the field? The other fields are already there. It's the Phone field I need to add.

EE-CR.png
0
Hello, can you please help me set criteria on the crystal form to suppress any line item from printing (in the body) if the quantity equals zero?
The form is attached with saved data.

Thank you.
PurchaseInvoiceDias.rpt
0
Error while publishing  report with dynamic cascade params in CR Enterprise  . Error:The server with kind rptappserver returned an error result. Failed to copy the report file to the report object. Refreshing the report object properties might have failed. Failed to read data from report file . Reason: Failed to read parameter object

Report runs OK in developer .  Also  when first published, ensured "Update Repository" box on the Save As is selected. User is added to admin group as last resort.No effect.
Also
-Verified the database

- File--> printer-->Ensured 'No Printer' is checked
Restarted RAS server and also all the servers . Since this did not fix, when to CCM and restarted Apache TOmcat & application servers.
What could be the soluction ? CR enterprise  BO 11 4.1 . BVM isn't available because its CR enterprise ?
0
I'm working on a Windows Forms application/desktop written in 2002. Yes, you read that right.... Windows Forms that uses Crystal Reports.

We can't upgrade the code to web at this time. Too many clients on it and the owner doesn't want to invest in a web application.

We want to replace the Crystal Reports section of this application.

These are some of the options we've been talking about:

1. SSRS (a developer here said SSRS is being replaced)
2 . Power BI - how would this work with an old code like the one we have?
3. A developer here said we can write the stored procs and have one of the web developers design and code the pages. Custom web pages that act like reports. Don't think we can do this because clients are not setup for web. They all use our desktop application.

A developer here is pushing for Power BI. I don't know how it would work with Windows Forms/desk top.

Any ideas?
0
I am trying to rebuild a computer that crashed.  The old computer was Win7 Pro, new computer is Windows 10.
I had a couple of versions of Crystal Reports as well as Visual Studio 2005 and Visual Studio 2010.  I have re-installed these (CR XI, CR
I was able to save all the data files, including all the source code for all the projects I was working on but had to re-install apps/compilers/etc.

When I open VS2005 to be able to modify/re-compile an app that worked on the old computer, I get this error:
Warning      1      Cannot load type library for reference "CRAXDRT". Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))      CD_Main

in trying to research the issue, it seems that the problem is that I need to register the Craxdrt.dll.  (not sure if this is the real solution or not).

I opened a cmd window in Administrator mode and changed directory to the path where the .dll file is (c:\Program Files (x86)\Common Files\Business Objects\2.7\Bin)
I type "Regsvr32  craxdrt.dll" and I get this message:
The module "craxdrt.dll" failed to load.  Make sure the binary is stored at the specified location... The specified file could not be found.

I did a "dir" and it shows the craxdrt.dll file.

Suggestions?
Thanks!
1
Hello,

I am trying to join two tables and I am not sure if I wrote the command right.

  SELECT "PRT_CURRENT__TIME"."Period_End_Date", "PRT_CURRENT__TIME"."Units", "PRT_CURRENT__TIME"."Pay_ID", "PRT_CURRENT__TIME"."Job", "JCM_MASTER__JOB"."Description", "PRT_CURRENT__TIME"."Amount", "PRT_CURRENT__TIME"."Employer_Taxes", "PRT_CURRENT__TIME"."Fringes", "PRT_CURRENT__TIME"."Cash_Fringes", "PRM_MASTER__EMPLOYEE"."Employee_Name", "JCM_MASTER__JOB"."Cost_Account_Prefix"
FROM   ("\\TEST\Timberline Data\TEST\"."PRT_CURRENT__TIME" "PRT_CURRENT__TIME" INNER JOIN "\\TEST\Timberline Data\TEST\"."JCM_MASTER__JOB" "JCM_MASTER__JOB" ON "PRT_CURRENT__TIME"."Job"="JCM_MASTER__JOB"."Job") INNER JOIN "\\TEST\Timberline Data\TEST\"."PRM_MASTER__EMPLOYEE" "PRM_MASTER__EMPLOYEE" ON "PRT_CURRENT__TIME"."Employee"="PRM_MASTER__EMPLOYEE"."Employee"
WHERE  "PRT_CURRENT__TIME"."Period_End_Date">={d '2019-12-12'} AND "JCM_MASTER__JOB"."Cost_Account_Prefix"='20'
ORDER BY "JCM_MASTER__JOB"."Cost_Account_Prefix", "PRT_CURRENT__TIME"."Job", "PRM_MASTER__EMPLOYEE"."Employee_Name"
 UNION
 SELECT "PRT_EXECCURENT__TIME"."Period_End_Date", "PRT_EXECCURENT__TIME"."Units", "PRT_EXECCURENT__TIME"."Pay_ID", "PRT_EXECCURENT__TIME"."Job", "JCM_EXECMASTER__JOB"."Description", "PRT_EXECCURENT__TIME"."Amount", "PRT_EXECCURENT__TIME"."Employer_Taxes", "PRT_EXECCURENT__TIME"."Fringes", "PRT_EXECCURENT__TIME"."Cash_Fringes", "PRM_EXECMASTER__EMPLOYEE"."Employee_Name", "JCM_EXECMASTER__JOB"."Cost_Account_Prefix"…
0
I am trying to create a new definition for 'previous month' from a dropdown parameter selection. The typical solution = 'LastFullMonth' but I need it to be from the first day of the previous month 03:00:00am to the first of the current month 02:59:59am
0
I need to create a Virtual calendar that defines starting and ending hours different to a standard day. A standard day, today, for example, December 20, 2019, started from 00:00:00 to 23:59:59. The new virtual 12-20-2019 should start from 12-19-2019 03:00:00 to 12-20-2019 02:59:59.

The month of November should include 11-01-2019 03:00:00 to 12-01-01 02:59:59 and each day should be defined as above with the exception of the 1st which always starts from 03:00:00 and the 30th includes the 3 hours of December 1st.

The year (2019) should include 01-01-2019 03:00:00 to 01-01-2019 02:59:59 with the months and days defined as mentioned above.

Even though I'm using Crystal reports it probably would be easier creating the mentioned in SQL.
0
I am trying to create a dataset which I will  then will feed into crystal report
with the script below

[private void button2_Click(object sender, EventArgs e)
        {
       
            CreateDataSet2();
            // MessageBox.Show("The dataset is created and filled");

            if (_dsData == null)
            {
                MessageBox.Show("You first need to create the data source");
                return;
            }

            string strFullPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "StateCodes.xsd");
            _dsData.WriteXmlSchema(strFullPath);
            //MessageBox.Show($"The schema has been created as >>{strFullPath}<<");

            //Load the standalone report
            // c://TournamentTracker//ReportLibrary//StateCodes.rpt
            //_rptDoc.Load(System.IO.Path.Combine("c://DotNetReports//StateCodes.rpt"));
            _rptDoc.Load(System.IO.Path.Combine("c://TournamentTracker//ReportLibrary//StateCodes.rpt"));
            //Pass the dataset to the report
            _rptDoc.SetDataSource(_dsData);
            //Set values of some objects dynamically
           // ApplyTextObject("txtTitle", "Title of the report provided dynamically by the application");
            //Set the values of the parameters
            //_rptDoc.SetParameterValue("PopulationThreshold", 5000000);

            //Pass the Report Document object to the viewer
            crystalReportViewer1.ReportSource = _rptDoc;…
0
We have been using Crystal Report within our company for several months now with excellent results.    We are also using the Datalink viewer on many of our employees desktops.

Our weak link is exporting these reports into Excel.     Lots of extra columns and rows are inserted during the export and columns and rows  just don't line up well.   Are there any tools out there that would do that better?
0
Hi there,  I have an excel file connected to a crystal report.  This file has a date/time field called gift date.  When the data is extracted on one machine, the field is recognized as date/time, as it should be.  When the data is extracted and merged with the report on another machine it is a string field. The exported file is an Excel 97-2003 (options are limited in this older software) - do you have any ideas on how to work around this?

thank you -
0
In my c# application I need to read a set of data  from a table "stateorigin"
and get it ready as a dataset  for preparing a crystal report

I have 2 scripts

My first script defines the  fields in the dataset ( see script below)

  //Creates a new dataset, 2 datatables and adds data to them
   _dsData = new DataSet("TestDataSet");

  private void CreateDataSet2()
        {
            //Creates a new dataset, 2 datatables and adds data to them
            _dsData = new DataSet("TestDataSet");

            //byte[] arrBytes;
            //System.IO.MemoryStream ms;

            using (DataTable dt = new DataTable("stateorigin"))
            {
                dt.Columns.Add("stateid", typeof(int));
                dt.Columns.Add("statedescription", typeof(string));
              
                GlobalConfig.Connection.GetStateCode_All();

                _dsData.Tables.Add(dt);
            }
         
        }

Open in new window


So basically I want to read 2 fields  stateid and statedescription  from stateorigin table

Already during the creation of my application i have  a script that get a list of these same fields BUT

into a list.  ( See  script below )

[public List<StateOriginModel> GetStateCode_All()
        {
             List<StateOriginModel> results = new List<StateOriginModel>();

            using (var conn = new NpgsqlConnection(pgrstring))
            {
                using (NpgsqlCommand command = new …
0
I'm grouping by UserID and trying to pass running totals from a subreport into each associated UserID, not certain if this is possible in Crystal Reports 2016
0
Can anyone tell me if there is a way to export the information from a crystal report into specific cells in an excel worksheet?  If so, how would I do that?
0
I'm monitoring traffic into a facility in real-time and events typically occur in a specific sequence [1-15-10-3] Please refer to insert below. My goal is to group (isolate the mentioned 4 events) so I can determine the total time each transaction took. i.e. referring to the first transaction from below, the vehicle was detected @ eventid1 ( (12:04:05am) and completed his transaction @ eventid3 (12:05:24) = 1min19seconds). There are instances where the sequence is only [1-10-3] and also as visible things can go wrong and you see a [1-1-15-10-3].

The challenge is that I have no field available that identifies a specific transaction and all I have is the expected sequencing of eventid's.  I need assistance grouping/isolation a set or completed transaction so I can do the math.

Typical event sequence
0
I am trying to create a .NET report  using Crystal Reports.

The 3 steps required  to create the report is as shown in the screen below

Crystal Report Generation Screen
The first step is to create the DataSource  as in the 2 steps below

STEP1  Defining the Report  Content

  private void CreateDataSet()
        {
            //Creates a new dataset, 2 datatables and adds data to them
            _dsData = new DataSet("Employee");

            byte[] arrBytes;
            System.IO.MemoryStream ms;

            using (DataTable dt = new DataTable("Employee"))
            {
                dt.Columns.Add("Staff_no", typeof(string));
                dt.Columns.Add("Surname", typeof(string));
                dt.Columns.Add("Firname", typeof(string));
                dt.Columns.Add("midinit", typeof(string));
                dt.Columns.Add("DepartmentID", typeof(string));
                dt.Columns.Add("Sex", typeof(string));
                dt.Columns.Add("GradeID", typeof(string));

                GlobalConfig.Connection.CreateEmployeeDataTable((DataTable)(dt));

                _dsData.Tables.Add(dt);


            }

            ////Creates a relation between the 2 DataTables
            //_dsData.Relations.Add("relCountryStates",
            //    _dsData.Tables["Countries"].Columns["ID"],
            //    _dsData.Tables["States"].Columns["IDParent"]);
        }

Open in new window


Using the debugger  Step1 above appears ok and I am able to go into the method below that actually
writes the dataset.

In STEP2 below the stored procedure  tested separately  works selecting 2 records from the database (see  records below)

Stored Procedure Execution extracting the 2 records  required
STEP2  Loading the DataSet


Open in new window

0
I have a report with a single description field in it. At the moment I need a way of controlling what gets printed from the field in the details section. The contents of which are details from a Job Number. Each line of details has a Sequence Number or a Detail_ID field which I think I can use to suppress those lines not needed.

One problem is I need to suppress all blank sections. I know this is under the Section Expert. The fields that I think can be used are Sequence & Detail _ID both are numbers. A "0" in the sequence field is an empty value as is the lowest number in Detail_ID can be an empty value but not always. Sometimes there are no empty values.
There is a group on Job Number and I think by using the Sequence or Detail_ID field I can create a formula that will suppress rows conditionally?
If the Sequence field is used they print in the details section of Crystal like this:
Detail        0                                                         0     suppress all zero value line    
Detail        1                                                         1   .... this would be the one to display if only 2 in a sequence
Detail        2  .... this would be the one to display if the 3 are in sequence
(Sometimes the order of values are ( 0, 2, 1 ),  ( 1, 0 ) or even just ( 1 ) from top to bottom stacked in the details section.)

or Detail_ID  field    ........with the Detail_ID it should be the largest number.

15401    ......... Suppress
15402    …
0
I am currently running Crystal Reports 2008 and this is the error that I am getting: "A subscript must be between 1 and the size of the array"

This is the data:
Last_Edit = ABERN,11/11/19,16:44,ABERNARDI

I want to just grab the last piece of information after the comma "," which is "ABERNARDI"

This is the code that I have that works but seems like its not perfect.

Split ({Contacts.LAST_EDIT}, ",") [4]

Please advise
0
Hello, I am wondering if it is possible in Crystal Report to automatically consolidate the same product sold on a line item but only increment the qty value?
EG If I sold the following product:

Product Code            Quantity
ABC                                  1
ABC                                  1

Crystal Reports would display it as:

ABC                                 2
0
Hello, I have a client using the 3 attached crystal report forms (Sales Orders).
When the data is entered in their accounting system the text is displayed in the correct way.
However, when the output is displayed on the forms the text is not in the same order.

Are you able to assist please?

I have attached the 3 files and a screen shots where you can see the data on the screen and the data on the forms (out of order)

Thanks.
SalesOrder.png
SalesOrderLandscapeAWW.rpt
SalesOrderLandscapePCI.rpt
SalesOrderLandscapeTWW.rpt
0
I am trying to create a formula that checks two date fields and calculate the dates.  The field will be null if no date was entered and a blank string if it is set then removed.

SQL Code snippet Used in a query:
CASE
           WHEN(bp.ReleaseTime IS NULL
                OR bp.ReleaseTime = '')
           THEN DATEDIFF(d, bp.BookedDateTime, GETDATE())
           WHEN bp.ReleaseTime IS NOT NULL
           THEN DATEDIFF(d, bp.BookedDateTime, bp.ReleaseTime)
           ELSE ''
       END AS 'Days Incarcerated'

Open in new window


Crystal Reports Formula:
SELECT {BookedPerson.ReleaseTime}
CASE ISNULL (({BookedPerson.ReleaseTime}) OR {BookedPerson.ReleaseTime} = ''): DATEDIFF(d, {BookedPerson.BookedDateTime}, GETDATE())
CASE IS {BookedPerson.ReleaseTime} IS NOT NULL: DATEDIFF(d, {BookedPerson.BookedDateTime}, {BookedPerson.ReleaseTime})
DEFAULT: ''

Open in new window

0

Crystal Reports

35K

Solutions

15K

Contributors

Crystal Reports is a business intelligence application from SAP SE. It is used to graphically design data connections and report layouts from a wide range of data sources including Excel spreadsheets, Oracle, SQL Server databases and Access databases, BusinessObjects Enterprise business views, and local file-system information. Report designers can place fields from these sources on the report design surface, and can also deploy them in custom formulas (using either BASIC or Crystal's own syntax), which are then placed on the design surface. Crystal Reports also supports subreports, graphing, and a limited amount of GIS functionality.