Crystal Reports





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 have Crystal report 2008  Rpt_A that has data source Command_A . Command_A  executes a store procedure  spA against database  DB_Sales on SQL ServerA.
I need to create report Rpt_B that is identical as Rpt_A  with command as data source that excecute store procederue spB  that run against same database DB_Sales on another server -  SQL ServerB.

In need to change location of data source  and If it is possible not doing report from scratch again.
I was thinking to make copy of Rpt_A and  use command_B  to  execute store procedure spB against  DB_Sales on SQL_ServerB.
Store procedure spA and spB are the same, same table names, same parameter only their names are different in those two locations.
 I cannot change name of spB to SpA it has to stay as spB as it is used for other reports.
What I tried up to now:
I made a copy or report Rpt_A to Rpt_B.
Report  is composed of  main report and two sub reports.
I tried to Set new Data Source location with new database and update button ,  I was able to do that then I came to map screen and on that screen I can not do much.  I can not map or change anything, if I click ok it went through but I lost all my fields from report.
How to do this and not creating report again from beginning. I need detail steps if is possible.

Thank you
OWASP: Avoiding Hacker Tricks
LVL 13
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

I am attempting to pull data from an Excel file. There is a column that has values that start with both alpha and numeric. The report only pulls the data that starts with alpha. I have tried formatting the cells in that column every which way but I can't get the report to return the values that are numeric. I have attached a file as an example of the Excel file I am working with. Any help with this would be appreciated.
Hello Experts,
Here is my issue.  I have a MySQL database that a report is being derived from. There is a field in one of the tables that is stored as XML. Previously, an expert gave me some great advice and I was able to create a formula that broke out one of the 3 pieces of data that I need.

StringVar strTest := {_invoice_transaction1.Extra};
ExtractString (strTest,'"CheckDate">',"</v");

While this formula gives me the CheckDate, as I suspected, I could not create a parameter field from the formula.
Unless there is a workaround that I have not yet deduced, my latest attempt is to go to the SQL query and modify the query prior to the data reaching the report.

I know I need to go to: Database:database expert: odbc: add command... and there I can modify the SQL.

So, that leaves me 2 questions: Where and or how can I see the SQL statement output so I know if my modifications are going to have the desired results. If I was using straight SQL I would probably add a line like: ExtractString(_invoice_transaction1.extra, '"Checkdate">',"</") as checkdate     -  to my query which I have copied from Crystal below.

 SELECT _invoice_transaction1.TransactionDate, _customer1.LastName, _customer1.FirstName, _customer1.MiddleName, _insurancecompany1.Name, _invoice1.ID, _invoicedetails1.BillingCode, _user1.Login, _invoice_transaction1.Amount, _invoice_transaction1.Taxes, _invoicedetails1.ReviewCode, _invoice_transactiontype1.ID, _invoice_transaction1.Extra
 FROM   …
Hi Experts:
So I'm not super with Crystal Reports... let's start there.

I have a memo field that is stored as XML.
I need to parse the XML and pull 3 variables for one for Checknumber, one for checkdate, and one for paid.

Here is part of the problem. Some data sets contain the 3 variables, some don't, some data sets are null (no data at all).
Here are 2 sample pieces of data.

  <v n="Billable">50</v>
  <v n="CheckDate">04/29/2019</v>
  <v n="CheckNumber">12</v>
  <v n="Paid">35</v>
  <v n="PaymentMethod">Check</v>

  <v n="Billable">3617.85</v>
  <v n="Paid">500</v>
  <v n="PaymentMethod">Cash</v>

Ultimately, the goal is to have a formula and to be able to search for the CheckDate, CheckNumber, or Amount.
At this point, I am not certain that even If I can isolate the variables, that the variable can be made into parameters for searching...

I have researched and attempted various string variables but without success.
For years I have used Plantronics Supra binaural headsets along with the matching Plantronics headset amplifier/interface M10 or MX10. ( I am not at that location now.) I have the requirement that my phone audio be crystal clear at all times. I have never had any problem with clarity until yesterday. I never had considered VOIP because my internet speed was not ideal. Several months ago I got fiber and my up and down speed is 1 GIG with pings at 2ms. With this super speed I thought that VOIP would be an acceptable choice since it would save me more than 50% of my phone bill. Now that it is installed I am told that my transmitted voice is somewhat distorted and there is some sort of slight crackling in the background. I cannot live with this problem. I spoke to level one of tech support last night and he confirmed that I was indeed distorted. I have another line that utilizes the MagicJack. I phoned the tech on that line and the distortion was still present. I also switched from my headset and amp combo to a regular phone on the business phone system (Avaya Partner) and the distortion is still there. Level two is supposed to get back to me today and begin troubleshooting the problem. I was just wondering if any Expert has encountered this difficulty before? With such incredibly high isp speed the is the last thing that I had expected. If an Expert has any ideas please let me know.  

Configuration wise: On the isp's router there are two phone jacks. I go from jack One …
I have two tables with the same fields, I need to append those table into one. Is there a way to do it in Crystal report?
I created crystal report 2008 that is based on store procedure on SQL Server database.
 Store procedure has one parameter “StartDate” that is date type.

How to set up my Crystal Report to prompt user for date and pass that date to sp.

After two hours in a support call, I could not figure out how to do something that every tech support article in cyberspace outlines to do in Crystal Reports, when you have to summarize a formula.  (Crystal won't let you do so, conventionally.)

I tried the variables where you conduct "x:= while printing records" but to no avail.

If anyone out there has had a challenge with this, please tell me what you did to overcome it.

As best as I can tell you and as best as I can remember from the support call, there is a formula in Group Footer #1 - not in Details - and I need to have a subtotal for this appear in Group Footer #2.

I created several "variable" formulas, I put them in this header, that header, this footer, that footer, the Report Footer, the Report Header, etc.

I did everything to the letter, but I still could not get a simple subtotal to appear.

Please help.


I have an Oracle report that if a record in a field is empty I have to suppress not only that value but the subreport it is in as well as another subreport that the record is not in but is linked to the primary report the same way as the other subreport.

I know Oracle handles null records, blank records or spaces I think like this. (I may be wrong)
I use the suppress feature on the Conditional Formula for the field
Then I use the suppress section in the Section Expert

If isnull({Field1}) then true else
if {Field1} = "" then true else
if {Field1} = " " then true else false.

How do I suppress two subreports if one subreport has a empty record in a field?
This is actually a follow up question to  an earlier post

answered by Mike McCracken

I have reviewed the answered proffered by Mike McCracken but seem to have
issues because i am not filling my dataset from a list on the console
but from a method that reads data from a postgre database

I have tried to replicate McCraken solution with the same sample data that he used
and i was able to get it to run

Now i am trying replicate the  major segments  but i have problems  with each section

I got my old CrystalReports Designer loaded  from my Visual basic Application and exported
the .rpt   as  CrystalReport1 rpt

I am dealing here with only one table "Employee"

SECTION 1  (Creating the dataset)   Please see the code below

  private void btnCreateDataSource_Click(object sender, EventArgs e)
            MessageBox.Show("The dataset is created and filled");

        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));

Open in new window

JavaScript Best Practices
LVL 13
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

I need a formula to look up the last cost date on a job then share the value on to a main report. However, I am unable to use the Share Numbervar because it's not a number but a date.

Maximum(MakeArray({field1}, {field 2}, {field 3}))
I am trying to drag  CrystalReportViewer to my form and i got the following error

CrystalReportViewer  Error
This my first time of using Crystal Report  within Visual Studio

Is there some setting or references  i should set withing visual studio which i have not done
How to I split or separate a field in Crystal Reports to return 10 different fields with information.
The field captures answers to 9 survey questions and a comment field.
The field called "ANSWERS" returns the following information:

  <pair name="Q1" value="1" ></pair>
  <pair name="Q2" value="5" ></pair>
  <pair name="Q3" value="4" ></pair>
  <pair name="Q4" value="3" ></pair>
  <pair name="Q5" value="5" ></pair>
  <pair name="Q6" value="5" ></pair>
  <pair name="Q7" value="5" ></pair>
  <pair name="Q8" value="4" ></pair>
  <pair name="Q9" value="5" ></pair>
  <pair name="comments" value="ycjgvhkb,n.m,/" ></pair>

I want to separate to have each questions answer in it's own field

field Q1 should display 1
field Q2 should display 5
field Q3 should display 4
field Q4 should display 3
field Q5 should display 5
field Q6 should display 5
field Q7 should display 5
field Q8 should display 4
field Q9 should display 5
field "comments" should display ycjgvhkb,n.m,/

Any help would be appreciated!

I have a subreport that is using a sql server stored procedure as its source.   When the sp returns data, the report works fine.  If it has no data to return, the report fails with the message below.
How do I get around that ?  I tried page suppression via section expert but without any luck.  

Error - ExportReportToDisk: One or more fields could not be found in the result set.  Use Verify Database to update the report.
Failed to export the report.

Error in File brm_ecn 4224_5880_{0A81305B-6030-46E1-8C30-8C35C1AB4464}.rpt:
The rowset column could not be found.

Bruno Campoli
I am converting my visual basic 6 application  to c#.
While in Visual basic 6  i wrote my reports with Crystal Report 11

Now i need to move these report to the crystal reports in my c# application which is
crystal report 13

I have all the forms and designer files ( including the ttx field definition file ) done under crystal report 11


1. Is there a path/tool  to migrate my old crystalreport11  file to crystalreport13  or do i have to rewrite all the reports again

2.  my app.config file in my c# application has the line:
    <add name="Tournaments" connectionString="Host =; Database = Tournaments; Port = 5432; Username = postgres; Password = manager" />

How can i make my crystal report recognize this setting so that i do not have to be specifying connection string in
each report.
I just want to be able to get the designer, work on it and run .  it should recognize the app.config setting automatically

the same way my c#  forms behave


I am running a report in Crystal Reports and get the error "Divison By Zero" - the Formula Workshop Window opens and this formula is shown as causing the error - how can i fix the error in this formula

Sum ({@Loan Balance Balance}, {@Pool}) % Sum ({@Total Balance}, {@Pool})

I am trying to integrate crysta reports into my c#  Application

I have visual studio 17 installed  and i have downloaded crystal reports  from SAP site and i am trying to follow

the instructions below:

EDIT: " To add Crystal Reports to Visual Studio you will first need to download the runtime from SAP. Most commom runtimes can be found here. Then you will have to add the CR to your toolbox in VS by choosing Tools -> choose Toolbox items. Make sure the .NET Frameworks Components tab is selected and scroll to the CrystalReport items. Check the items you want to add (CrystalReportViewer for sure) and click OK. After that the CR Viewer should be available to you in the Reporting section of your toolbox."

I just can not find where to add  Crystal Report Item ( in particular CrystalReportViewer  )

Below please find the screen where I am surpposed  to be adding CrystalReportViewer  from

Screen to Bring CrystalReportViewer into my ToolBox
It is  not Listed

How do i get CrystalReportViewer into my Visual Studio 17


hiii im using crystal report in my web application in which i have a main report and a subreport my problem is that in my subreport i have passed a store procedure which except parameter @relationid so in code behind i have used this code to set that parameter value which is  

rpt.SetParameterValue("@relationid", documentId, rpt.Subreports[0].Name.ToString());

i have linked subreport with main report parameter but im getting this error  which is attached below  any solution thanks in advance
Hello dear expert,

Since few days, I'm trying to connect my crystal report software to Solarwinds Log & Event manager reports DB but I still get the following error:
Failed to open the connection. Details: JDBC driver not found.
Even if the JDBC driver is present on the server.


I made a copy of one report and try to edit it with Crystal report. What happen?

1.  When I remove some columns or I edit existing content and run the edited report on LEM Report Manager, it works
2.  But When I add a new column and try to the same report and try to run it, it says "Logon failed. Error Code: -2147189176"

Is there any expert with both Crystal report and Solarwinds LEM knowledge?

Many thanks,

Christian K.
PMI ACP® Project Management
LVL 13
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Using Crystal Reports ver 2106 sp 6
Report Header is suppressed.
There is a main report and one subreport in the Group Footer.

The report is used to print multiples of invoices with a Summary page.
The summary page prints after each printed invoice.
The Summary page holds specific information and different page orientation.

I need the Page Header to print on all pages of invoices but not when the Group Footer with the Subreport Summary page prints.
I have entered the code below.
This works to stop the Page Header listing on the Subreport Summary page and this is good.

Problem -The Page Header from the Main report prints only on the first invoice not the subsequent invoice pages.

In the report header add a formula
 Global BooleanVar SuppressPageHeader := False;

 In the group header add a formula
 Global BooleanVar SuppressPageHeader;
 SuppressPageHeader := False;

 In the group footer add a formula
 Global BooleanVar SuppressPageHeader;
 SuppressPageHeader := True;

 Right click the page header in the left margin
 Click the FORMULA BUTTON to the right of SUPPRESS
 Global BooleanVar SuppressPageHeader;
Crystal Reports 2013.  Unable to summarize field.  I have a field that takes the total dollar value of a group of accounts then multiplies it by the weighted value of the account.  Works fine but when I try to the summarize the formula it gives me an error that the field can not be summarized.  Is there any work around


Is there a way to pass to a Crystal Report the database connection? What we are hoping there is way to pass the the report via the VB.NET application the database to connect. This way whether we are publishing our application to a Test/Q&A server or to a production server, we do no need to edit the connection in each report prior to publishing.
Using Crystal Reports 2016 SP7

I have a formula that returns the correct value when using one set of criteria but when I duplicate the formula and change one criteria no value is returned.

Slots Formula:

if {LicenseParts.LicensePartType} = "GAMING"
and  {LicenseParts.LicensePartSubType} = "SLOT MACHINES"
then ToText({LicenseParts.Quantity},0)

Open in new window

This returns correct data.

Now I modified the formula to look for "TWENTY-ONE instead of "SLOT MACHINES"
and it does not return a value.

Twenty-One Formula:

if {LicenseParts.LicensePartType} = "GAMING"
and  {LicenseParts.LicensePartSubType} = "TWENTY-ONE"
then ToText({LicenseParts.Quantity},0)[code]

Open in new window


Below is what the SQL Data looks like:

I am a Crystal Reports novice.  I have an existing report that looks at a table of all employee paychecks.  It sums up the hours worked field by all employees on the last paycheck date (by referencing the maximum paycheck date), so that we can then calculate the number of full-time equivalents on that paycheck.  Management would like me to update this report to have the same FTE calculation over the previous three paycheck dates.  I tried using the running total field below.  The formula that is used under Evaluate is this:

{PR_Check_Exp_Distrib.Check_Date} in [(NthLargest (1, {PR_Check_Exp_Distrib.Check_Date})),  (NthLargest (2, {PR_Check_Exp_Distrib.Check_Date})), (NthLargest (3, {PR_Check_Exp_Distrib.Check_Date}))]

 The existing running total field.
When I use this, it only gets the maximum check date.  Like I said, I'm a novice, if anyone can point me in the right direction, I'd really appreciate it.
I have two MySQL databases that have the same table structure and common data. I need to generate a report that will combine some the data found in both databases for matching entries into a final total value. For example:

Database A, field Name = 1234, value = 1111
Database B, field Name = 1234, Value = 2222

Report result = Name 1234, value = 3333

Crystal Reports





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.

Top Experts In
Crystal Reports