1 2 3 7 Previous Next

SAP Crystal Reports

98 Posts

In Business Objects XI a tool existed for creating QRY files and using these files one could create Crystal reports on them. With CR 2008 onwards this tool is not available to create QRY files to report on them.

 

If there are reports created on these QRY files and migrated to higher version then these reports just works as static template which only refreshes data. One cannot make many changes to the query or to the data connection of these reports. Now if my underlying database goes under upgrade or there are any schema level changes then these won’t be available to the existing QRY reports. Though one can migrate these reports but it ends with limitations.

 

Now the question arises can these reports be re pointed to a datasource which would give flexibility in terms of data connection and making changes to query.

 

Following are some of the key points which one may
utilize to re point these reports:

 

  1. One can use the same query from Crystal query designer and create a new report
    using command object as datasource.
  2. Now if the concern is about the formatting of the report. Then one can try one of the
    following
  3. Open the existing report in higher version and re point it to the new datasource (command
    object) using set datasource location option in Crystal Reports
  4. Save the report as template and use it to create a new report using command object
    as datasource with the query.

 

      

This feature (QRY) when I came across very few were
familiar with it so thought to pen it down hope it will be useful.

Tips to achieve the same report structure when you export into Excel:

 

Following points will help to avoid the unwanted cell spaces and formatting issue while exporting .rpt file to Excel files.

 

  1. 1. Remove unwanted sections in the report. If the sections are not used either suppress or delete it.
  2. 2. Avoid more spaces between each object. For example if you have more space between each objects then when you are export to excel, the space will be considered as each cells & the data will be shifted randomly. To avoid the cells shifting, insert the blank text objects in between the objects.
  3. 3. Even for the small space try to insert the blank text objects.
  4. 4. For conditional objects try to create in the different sections.

    - For example I have condition to display two fields i.e. Grade A and Grade B based on revenue value.

    - If revenue is more than 60000 then we need to display Grade A field else Grade B. This condition we need to give at 2 objects suppression formula.

    - In this case the .rpt file will display only one field object at report. But when you export to excel it will take 2 cells for both field objects. To avoid that just create 2 different sections for example you just create detail 1 for Grade A and Detail 2 for Grade B with above suppression logic.

  1. 5. We can't export lines and tables when you are export to Excel data only.
  2. 6. After you drag & drop fields into your designer, don't resize or overlap them. Make sure that you have selected options snap to grid.
  3. 7. Select the Can Grow option for all the fields in the report by default. This will avoid the overlapping.

 

These are main point’s needs to be remember, when you are exporting the .rpt file to .xls file.

This week we learned more about what is coming in Crystal Reports for Enterprise.  This is a summary of this week’s ASUG webcast, “What’s new in Crystal 4.1” included some roadmap updates.  Henry Kam and Mike Seblani of SAP were the presenters.  Henry is the Solution Manager for Crystal Reports and BI Platform. Mike is the area product owner for Crystal Reports

 

Planned BI4.1 ramp-up is May time frame, subject to change.

 

The usual legal disclaimer applies that what is presented is subject to change.  These are my notes.

 

Agenda:

  • Crystal Reports Overview
  • Crystal Reports for Enterprise BI4 SP05
  • Planned BI4.1 Crystal Reports for Enterprise
  • Question & Answer

 

Crystal Reports Overview

2fig.png

 

Figure 1: Source: SAP

 

Figure 1 describes Crystal Reports.  It is great for operational and external facing reporting and “pixel perfect reports”.

 

2fig.png

Figure 2: Source: SAP

 

On the right of Figure 5 describes key capabilities

 

When you connect to semantic layer; you can model your data

 

It uses the Microsoft Office paradigm; “wysiwyg”, what you see is what you get

 

You can publish on the BI platform and can schedule reports

 

It uses several SDK’s; next generation includes RESTful web services – programming language agnostic to help you embed it with business applications

 

3fig.png

Figure 3: Source: SAP

 

Figure 3 shows that BI4 comes with two Crystal “flavors”.

 

Crystal Enterprise is focused on enterprises using the BI Platform; this is where SAP is placing the innovation effort

 

Crystal Reports 2011 is for stand-alone customers, same functionality, no regression

 

On the right 4.1 for Crystal Reports 2011 offers more platform support; as an example if use Linux as backend for BI server, CR 2011 with BI4 didn’t support Red Hat 6.  SAP plans to address this in BI 4.1.

 

Crystal Reports Today

 

4fig.png

Figure 4: Source: SAP

 

In 4.1, Crystal Reports 2011 is going through a rebranding exercise and will be named Crystal Reports 2013 in 4.1 timeframe

 

Figure 4 shows features today (BI4 SP05) on the left, focusing on report design, data sources, mobile, development and platform features.

 

5fig.png

Figure 5: Source: SAP

 

Figure 5 shows what is available in today’s version of Crystal for Enterprise, BI4 SP05

 

Smart Guidelines is very popular

 

Online library of report templates allow for easier report design and not starting with a blank canvas.

6fig.png

 

Figure 6: Source: SAP

 

In BI4 you can consume new semantic layer to have a consistent story to connect

 

SAP added the query panel to build query similar to Web Intelligence.

 

It uses BICS layer to access BW, with SAP access to Hana and ECC.

 

Some customers do not want to go through the authored universe so SAP offers “Direct to data” such as – JDBC or ODBC connection (not through the Universe) to help transition from Crystal 2011 to Crystal Enterprise.

 

7fig.png

Figure 7: Source: SAP

 

BI4 SP05 can consume Crystal content via Mobile BI, interact with the content

 

HTML viewer allows for continuous scrolling, bread crumb navigation, and a new search panel

 

8fig.png

Figure 8: Source: SAP

 

Figure 8 shows the Insight to Action Report to Report Interface is what SAP customers requested.  You can link Crystal to application – invoke action from

Crystal content from HTML view – target doesn’t have to be Crystal – can be any SAP application that supports RRI.

 

Planned Innovations

9fig.png

Figure 9: Source: SAP

 

Planned Innovations mean planned features for 4.1, subject to change. 

 

Figure 9 shows with BI 4.1 you can use Freehand SQL commands while building Crystal Reports; this is important for report developers to optimize the SQL; this offers parity features with Crystal Reports 2011.

 

You can verify structure of report to data source change; you can verify the content and the metadata once the data source changes.

 

Modeled data means an authored universe, BEx query, MSAS OLAP connection – models that have been created; the new feature is the ability to create subreports based on modeled/unmodeled data.  Mike said you may run into performance issues depending on the modeling and the joins.

 

10fig.png

Figure 10: Source: SAP

 

For data sources, for 4.1, SAP wanted to focus on the performance and quality of solution for BW data sources. Mike said some customers struggled with performance of solution; functionally it gave more than Crystal 2011.

 

BI 4.1 contains cumulative fixes for Service Packs over 4.0 and added to 4.1

 

Figure 10 shows in the query panel you can define the relative depth of the hierarchy at report design time.

 

SAP ECC data sources offer optional parameters now via the universe.

 

11fig.png

Figure 11: Source: SAP

 

Figure 11 shows access to HANA; BI4 SP5 only had JDBC/ODBC support. 

 

Now with BI4.1 has access to OLAP with analytic and calculated views (hierarchy, currency conversions). Figure 11 on the right shows the query panel looks like accessing a Hana analytic view.  JDBC and ODBC can also use freehand SQL.  BI4 had SSO with Kerberos and now with BI4.1 SSO with SAML.

 

12fig.png

Figure 12: Source: SAP

 

Figure 12 shows an enhancement with OpenDoc  support with Mobile BI – open doc targets stay within Mobile BI

 

For the BI Launchpad, customers wanted different behavior in the Launchpad – today it views the latest instance.  BI4.1 administrator defines default action – refresh data source or latest instance.

 

For the developer, supports Opendoc POST requests to get around long URL requests.

Related product roadmaps can be found at service.sap.com/roadmap

 

Question & Answer:

 

Q:  Will there be any future enhancements to CR 2011 ?

  A:  Mainly new Platform support.

________________________________________________________________

 

 

Q:  Have there been any performance issues reported in relation to using Crystal reports against the ECC datasource. I hear that as a big concern from my Basis team.

  A:  CR 2011 can connect to ECC directly.  CR for Enterprise connects to ECC through a modelled UNX universe.  Do you know what version they are conceren about?

________________________________________________________________

 

 

Q:  Are processing extensions still supported?  We use View Time Security by APOS in BOE 3.1 with CR2008.

  A:  I believe so, but it would only be for CR 2011.  But it is best to double check with APOS that their solution is supported in 4.0.

________________________________________________________________

 

 

Q:  How easy is it to convert a 2011 report to CR Enterprise? If there is a Freehand SQL query in 2011, will it convert to CR Enterprise?

  A:  You would open up the report on CR Enterprise and then repoint the report's data source to a relational connection object.  That's all that is required.  A relational connection object is the new method to connect to data directly.

________________________________________________________________

 

 

Q:  From a performance point of view, isn't it good to have most of the things configured at Bex level rather than at CR4E ?

  A:  It is always a best practice to connect to a BEx query in BI4

________________________________________________________________

 

 

Q:  I'm confused about the numbering... CR2011 - is that CR4.0 and the upgrade is then to CR4.1?

  A:  There are 2 versions: Use Crystal for Enterprise with BI4 and Crystal 2011 can be used without BI4.

  A:  In the BI4.1 timeframe SAP is rebranding CR2011 to CR 2013 (standalone)

________________________________________________________________

 

 

Q:  Do you have ability to persist last selected parameter values in CR enetrprise and Crystal reports on a per user basis, similar to SAP Personalization.

  A:  Not yet.

________________________________________________________________

 

Q:  Can CR2011 be used in BI4?

  A:  Yes; you can publish CR2011 to BI4

________________________________________________________________

 

Q:  Can we connect to HANA using CR 2011 ?

  A:  Yes, via ODBC and JDBC.

________________________________________________________________

 

Q:  Is there a published list of crystal reports version differences?

  A:  There is a nice wiki on SCN comparing BI4 Crystal Enterprise and CR 2011.  Will try to find the link.

  A: http://wiki.sdn.sap.com/wiki/display/BOBJ/From+Crystal+Reports+2008+to+SAP+Crystal+Reports+2011+or+SAP+Crystal+Reports+for+Enterprise 

________________________________________________________________

Q:  Is direct connectivity to ECC planned for CR4E ? Or it should be through universe only

  A:  BI4 SP5 can talk to the ECC via the Universe via InfoSets/ABAP functions today

   A:  Via the CR4E

________________________________________________________________

 

Q:  What is the current status for dynamic cascading prompts?

  A:  no changes - LOV - do chunking; not greatly altered in 4.0

________________________________________________________________

 

Q:  In RRI, when we open SAP Transaction from a crystal report, does the transaction data come up in Crystal format or does it just open SAP transaction with original look and feel(SAP GUI/Web GUI format)?

  A:  I think that depends on how you set up the RRI on the backend via RSBB transaction

________________________________________________________________

 

Q:  Will SAP continue to support both CR 2011 and CR4E in future ?

  A:  Yes!

________________________________________________________________

Q:  any planned innovations for changing the semantic layer which is automatically created when you click on bex query as the data source

  A:  Please join the Semantic Layer 4.1 webcast on 3/12

________________________________________________________________

 

Q:  dynamic parameter still work in CR2011 or CR2013? using Business View Manager as well?

  A:  Yes, it continues to work as is

________________________________________________________________

 

Q:  What is the long-term migration plan for Business Views and Dynamic Parameters...? Will all of that functionality be moved to UNX at some point...?

  A:  In the plans; common semantic layer team is aware of this

________________________________________________________________

 

Q:  Crystal Report for enterprise 4.1 still require Universe or can directly to Oracle/sybase database as CR2011?

  A:  Universe or Direct to Data can be used

________________________________________________________________

 

Q:  Will 2008 CR run on BI 4.0 or do we have to ask report writers to upgrade to 2011?

A:  CR content created in CR2008 and published to XI3.x should seamlessly work in BI 4.0 once it is migrated.  However the designer should be upgraded to CR2011.

________________________________________________________________

 

Q:  Can we use sub-query in MDX, do you mean sub report as sub query . we wanted to filter a mdx query on another mdx query

A: The question is not very clear.  If this is referring to the Command object in Crystal Reports for Enterprise, then the answer is no.  The Command object is intended for SQL and not MDX.  Freehand SQL can be used to query the main report and the sub report in Crystal Reports.

 

My thanks to Henry Kam (who gave 3 ASUG webcasts just this past week) and Mike Seblani for supporting ASUG.

 

You can get hands-on experience with BI4.1 including Crystal Reports for Enterprise at ASUG Annual Conference Pre-conference session in May.  Register here.

You may have a requirement to count the number of lines in a field that is coming from a database. One of our SCN members had this requirement recently.

 

 

Untitled.pngUnfortunately there is no property in an object that grabs the object height...although that could come in very handy for this situation and others. And text objects have line breaks at the end of the last word that will fit in a line. This inconsistency makes the solution a bit more complicated than grabbing the length of the field and basing the number of lines partially on that length. After attempts at using the text object length and estimating lines without much success, the solution seems to involve tracking when a line breaks or in particular when a line is going to break.

 

 

The solution still involves knowing the maximum number of characters in a line and the use of a fixed width font such as Lucida Console. Please have a look at the attached report by unzipping the file and changing the file extension from .txt to .rpt.

 

 

Steps to use this technique on your report:

 

 

1) change the text object (the one that you need to count the number of lines) to use a fixed width font...apologies to those that don't care for fixed width fonts but this is a requirement

 

 

2) now count the number of characters across you'd like the text object to be

 

 

3) create a new formula with the syntax below

 

 

 

 

stringvar t:= {Product_Type.Description};
numbervar ll:= 36; // set this to the desired width of the output, or line length, in characters > a fixed width font is recommended

// the code below does not need to be modified
stringvar o:= ''; // the formula output
stringvar en:= ' @@%%^^ '; // identifier used to replace "Enter" values in var t
t:= replace(t,chr(13)+chr(10), en) + ' ';
numbervar lt:= length(t);
numbervar i:= 1; // where the next word starts
numbervar nt; // where the next token or space starts
numbervar ntrt:= 0; // token running total
numbervar lc:= 1; // line counter
numbervar il:= 0; // character counter which is reset after each line

while  i < lt do
(
nt:= instr(t[i to lt], ' ');
ntrt:= ntrt + nt;
stringvar nw:= t[i to ntrt]; // next whole word
numbervar lnw:= length(nw); // length of next whole word
if trim(nw) <> trim(en)
then
    (
    if ll - il + 1 >= lnw then  o:= o + nw else
    if ll - il + 1 < lnw then (il:= 0; lc:= lc + 1; o:= o + chr(10) + nw;)
    )
else
    (il:= 0; lc:= lc + 1; o:= o + chr(10))
;
if trim(nw) <> trim(en) then il:= il + lnw;
i:= i + nt;
);

o; // use this line (and comment out next line) to display the formula output which mimics your text
//lc; // use the line to display the number of lines output by the formula above

 

4) change the first stringvar to use your text field

 

5) change the first numbervar to use the number of characters per line that you wish to use

 

6) save the formula and make a duplicate of the formula

 

7) the first formula leave it as is and put on the report...this will count and display the number of lines of output of your field

 

8) the second formula, uncomment the second last line, and comment out the last line...this will then have stringvar "o" as the output which is the original text object, but with the line breaks inserted at the appropriate places

 

9) ensure that the second formula has been stretched wide enough to accommodate the desired width and that it has been formatted to Can Grow

 

 

I hope that you find this tecnhique helpful. If you are looking for any other solutions or workarounds for Crystal Reports, please see my blog here in particular the content section.

Rakesh Krishnan

Business Views

Posted by Rakesh Krishnan Feb 27, 2013

Business Views

Business Views is a flexible and reliable multi-tier system that enables companies to build detailed and specific Business Views objects that help report designers and end users access the information they require.
   
Business Views are useful as companies engage in data management to collect and organize operational data into databases. Companies often use data integration technology to build data warehouses or data marts to cleanse, aggregate, and store data for analytic use. However, data warehouses must serve the lowest common denominator and canbut often do notprovide the various views and granularity that different business units require in order to understand and analyze their businesses. In addition, these warehouses may not provide the level of detail necessary for some analytic operations.
Using Business Views, you can integrate data from disparate sources. You can also bring together data from multiple data collection platforms and application boundaries so that the differences in data resolution, coverage, and structure between collection methods are eliminated.

Crystal Enterprise Business Views helps you better manage reporting across multiple data sources and applications by simplifying data access, change management, and data-level security processes. An optional service in Crystal Enterprise, Business Views allow you to integrate data from disparate sources, handle promotion/demotion between development and production environments, and control security at both the row and column level.

 

The Business View Manager allows you to simplify data access for your report designers by insulating them from the raw data structures. You can build connections to multiple data sources, join tables, alias field names, create calculated fields, and then surface this simplified structure as a Business View in Crystal Enterprise. Your report designers can then connect to Crystal Enterprise and use the Business View as the basis for their report, rather than accessing the data directly and building their own queries.

 

You can think of Business View Manager like an alternate mini version of Universe Designer. Just like you can throw in 10s of tables in Designer to create a Universe and use that universe to build DeskI or WebI reports, you can do the same thing using Business View Manager by throwing in 10s of tables or custom SQL to create a ‘Business View’ and use that in Crystal Reports.

  

Business Views includes the Business View Manager, a thick-client application. This designer enables administrators to create and modify Business Views objects:
  
Data Connections
 
Dynamic Data Connections
 
Data Foundations
 
Business Elements
 
Business Views
Architecture overview and diagram
 
Business Views is a multi-tier system. The following diagram illustrates how each of the various components fits within this system.
                                                            BVM.png
Client tier

The client tier includes SAP Business Objects applications (such as Crystal Reports and the Report Application Server) that access the Business Views that are stored and organized in the business tier. Business Views administrators control and define security and access to specific objects within the various Business Views.

 

Report designers using Crystal Reports see only the tables and fields that they have access to, as defined within the specific Business View. For example, a report designer in the company's sales department can access only regional sales data, and thus, design a report with sales-specific information, even though the data store also contains employee-specific information. Thus, depending on how the report is created and designed, a manager running the same report (or another report) has access to the additional information on employees within the company. All of the security and access information is handled by the Business View Manager.

 
Business tier
The business tier is the primary tier of the Business Views system. Administrators access this tier through the Business View Manager; they use this designer to create and modify Data Connections, Dynamic Data Connections, Data Foundations, Business Elements, and Business Views. Using the Business View Manager, you specify the settings and conditions for the various objects so that the client tier has access only to specific information from the data tier.

 

  • Business View Manager

You can use this designer to specify different Data Connections, to set security, and to control access to the data found within the different data sources in the data tier. This thick-client designer is the only part of Business Views that you interact with directly. End users access the data specified within the Business View Manager through their SAP Business Objects client application, such as SAP Crystal Reports (via the SAP Business Objects repository) or through the Report Application Server.

 

  • Data Connection

Data Connections specify and define the data sources for a Business View; they define how these data sources are made available to users. Thus, a Data Connection is a connection object, and you can apply security to this object. Each Data Connection contains
information that describes the physical data source, such as the server and data being accessed, the logon credentials, and the type of server being accessed.

 

  • Dynamic Data Connection

A Dynamic Data Connection is a collection of pointers to various Data Connections. An administrator or user is able to select which Data Connection to use through a parameter. When users refresh reports that are based on a Dynamic Data Connection, they are prompted to specify which of the available Data Connections to use.

 

  • Data Foundation

A Data Foundation consists of collections of tables and fields. Default table joins are defined at this level. You can secure Data foundations using the standard SAP Business Objects Business Intelligence platform security model, which includes View and Edit rights. The primary use of Data Foundations is for data abstraction: administrators control which tables and fields users can or cannot access when these users are designing or viewing a report.

 

  • Business Element

A Business Element is roughly equivalent to an OLAP dimension or logical view; that is, this object is a logically related collection of data fields that are based on a Data Foundation. These fields can be organized into a hierarchical structure within the Business Element. The most common example is a hierarchical structure that contains the following fields: Country, State or Province, and City. Business Fields
in Business Elements can be aliased to support data abstraction and to facilitate report design. Administrators can secure Business Elements through the standard View and Edit rights.

 

  • Business View

Business View is a logical collection of Business Elements. Users see Business Views as abstract database connections and the contained Business Elements as virtual tables that, in turn, contain Business Fields. Administrators can secure Business Views through the standard View and Edit rights. End users can access Business Views through applications such as SAP Crystal Reports and the Report Application Server.

  

A Business View consists of the following objects:

 

• One or more Data Connections

 

• One optional Dynamic Data Connection

 

• One Data Foundation

 

• One or more Business Elements

 
Data tier

The data tier consists of data sources, such as multiple databases on different machines that provide the data for the business tier. Business Views supports a wide range of corporate databases.

We are planning to print our own checks and I am using crystal reports for visual studio 2010 to create the check. When I preview the check the all the fields including the  MICR font show with no problem,  but when I  export to PDF  the MICR font gets truncated. I tried using smaller font hoping that this will solve the problem with no luck. I would appreciate any help.

If you have ever created a Crystal Report using the Hierarchical Grouping Options then you may have also wanted to create a cross-tab or chart using the same grouping order and hierarchy.

 

Untitled.png

In later versions of Crystal, a HierarchyLevel function was added so that you could find the node of a particular group when using the Hierarchical Grouping Options. This function could be used for formatting objects (indenting, highlighting, etc.) but formulae referencing this function could not be used in charts or cross-tabs or group summaries as it was a print time function.

 

Recently one of our community members was trying to apply the same group order from his hierarchical data into a cross-tab and also apply some formatting to the cross-tab based on the group nodes.

 

Although there is no way to do this directly in a cross-tab or chart, there is a workaround. If a report uses a hierarchy, all of the information from the hierarchy (group levels, hierarchy nodes, parent groups) can be rolled up in a string running total and passed to a subreport. The subreport would be based on the same data as the main report and formulae can parse through this data and then be used in subreport objects such as cross-tabs, charts, group summaries, etc.

 

This may seem like a lot of work but my hope is that the attached sample report will help you out considerably. The sample report contains a bunch of formulae that do most of the work for you. The real work that you have to do is some copying and pasting and also editing some fields so that they use your data instead of the sample report's data. There is one main formula in the sample that takes your group and parent values and then rolls up all of the hierarchical information and this is passed to the subreport via a one-way subreport link. In the subreport, several more formulae look after parsing this data out to make it usable in your subreport objects. A lot of the formulae that are in the sample report do not have to be edited, so that makes things even easier.

 

There are instructions on the sample report's Report Header that will guide you through reusing the formulae and this technique on your report. To use the report, download the HiearchyFormula file attached to this blog and change the file extension from .txt to .rpt. If you get an error opening the file it is most likely because you are using an earlier version of Crystal Reports that does not support the HiearchyLevel function.

 

I hope that you find this tecnhique helpful. If you are looking for any other solutions or workarounds for Crystal Reports, please see my blog here in particular the content section.

SAP Crystal Server Analytics Edition.jpgSAP is seizing the opportunity to address the big data needs of small and medium size businesses (SMB) with the integrated solution – SAP Crystal Server, analytics edition. This solution integrates one of the most well-known reporting solutions with the most widely-used database in the market.  When you add in business intelligence and data integration, you have a complete enterprise solution, but for a small budget.

 

To truly understand the impact of this solution on the SMB market, let’s discuss what big data really means. After all, big data defines a challenge that’s more complex than just “a lot of data.” Gartner Group states that “big data in general is defined as high volume, velocity, and variety information assets that demand cost-effective, innovative forms of information processing for enhanced insight, and decision making.”

 

These demands are not specific to just large enterprises. All businesses, even those on small budgets, have these needs.

SAP Crystal Server, analytics edition is SAP’s solution for companies with small budgets that use big data.  This solution includes:

 

  • SAP Crystal Server 2011, the heart of this solution, and the upgrade of SAP Crystal Reports Server.

 

  • SAP BusinessObjects Explorer software in named user licenses for the product. This tool enables end users to perform guided searches and explore corporate data. The addition of this business intelligence capability is the primary reason that “Reports” was removed from the name, as explained in the SAP Crystal Solutions 2011 FAQ.

 

  • SAP Sybase IQ, the analytics server for data warehousing and business intelligence. There’s no question that this database is a success in the market. SAP Sybase IQ has four times more customers than all other column databases combined, and wins more new customers in a year than other column databases have in total.

 

  • Integration with SAP Data Integrator to ensure that no data is out of reach. Now, SMBs can connect to their business data wherever it resides, whether it’s structured or unstructured.

 

With SAP Crystal Server, analytics edition, small and medium size businesses can gain a big data advantage on a small business budget.  It’s the quick and easy way to turn disconnected and overwhelming volumes of data into actionable insight. Check out some analytic samples from different industries to get a better idea of the value of this solution.

 

And stay tuned for future posts on how SAP Crystal solutions can help you address business intelligence visualization and mobilization.

In this blog I invite SAP Crystal Reports designers and Visual Studio .NET developers using SAP Crystal Reports, SAP Crystal Reports Application Server and Business Objects Enterprise (BI) Solution Developer Kits (SDK) to follow us on twitter. I also provide a bit of an explanation, purpose and history of SAP twitter channels for report designers and for Visual Studio .NET developers.

 

Report designers using SAP Crystal Reports follows us at SAPCRDes.

 

Visual Studio .NET developers using SAP Crystal Reports, SAP Crystal Reports Application Server and Business Objects Enterprise (BI) SDKs follow us at SAPCRNETSup.

 

 

I believe that freely sharing technical knowledge with the users of any software is the only scalable solution that enables the user to learn, to solve and to resolve issues with their software. And in these days of Social Media, that scaling is pretty well infinite. In the very first days of Windows applications knowledge sharing was limited to technical manuals, books and phones. Scaling up, meant hiring more people, using faxes and occasionally loading a file or two on Bulletin Boards. It was not until the age of the internet that real scaling became possible with freely available blogs, Knowledge Bases, wikis and other content, efficient searching notwithstanding…

 

Through this evolution I was always interested in better ways of sharing; Would it not be great to let a customer know about a new piece of knowledge the minute it was created? I kicked around ideas such as locally updatable apps, emails announcing new knowledge to subscribing customers and so on. Unfortunately as often happens, due to the efforts needed to implement such initiatives the ideas remained… well, ideas. Finally, with Social Media and particularly channels such as Twitter and Facebook, the idea of pushing knowledge out to customers who wanted it became possible with relatively low effort. On December 7, 2009, the SAP .NET Developer support team for Crystal Reports, Report Application Server and Business Objects Enterprise launched the twitter channel; SAPCRNETSup. The intent of this initiative was to share knowledge as soon as we were able to publish it. Since then we have tweeted over 990 pieces of information; KBAs, articles, blogs, wikis and more. The channel now has over 400 followers and more are joining every week. Following on the success of the SAPCRNETSup twitter channel, the SAP Crystal Reports Design and Database connectivity launched it’s own SAPCRDes twitter channel on July 17, 2012.

 

While the two twitter channels may appear to be redundant, the idea is that Visual Studio .NET developers using SAP Crystal Reports, SAP Crystal Reports Application Server and Business Objects Enterprise (BI) are interested in very different information than designers of actual reports. Each twitter channel is specifically targeting these two types of users with information specific to their interests. The channels are not technical support. This would be a difficult task in under 140 characters. Rather, they are a way of sharing information. If you are looking for timely information, join us; SAPCRDes, SAPCRNETSup.

 

For more SAP Technical Support channels see SAP Twitter Feeds for Techies

 

For those of you who use arrays in Crystal Reports you are most likely familiar with grabbing a certain item from the array. Or you may have a large varchar field in your database that you'd like to Split up into an array and then return an item in a certain position of the array. Or you'd like to add items from your Details section into an array and then parse that array out later in the report.

 

In some cases you may have run into the array limitation of 1000 values. There are workarounds to some of these problems caused by the array limit of 1000 values, and one workaround is to not use an array but use a String Running Total instead. This blog will hopefully provide you a solution when you encounter this issue.

 

First of all, download the attached file, extract the "txt" contents and then change the "txt" extension to "rpt" instead. This is a sample Crystal Report that contains an example of the steps below including the Custom Function. You can easily add the Custom Function to your Repository should you wish to avoid step 2 below.

 

Steps on How to Use a StringToken Custom Function to Get Around the 1000 Value Array Limit

 

1) Instead of adding values (text or numeric) to an array, consider rolling up these values into a String Running Total instead. For example, if you've got an ID field in your Details section and you want to add these to an array, but you run into the 1000 values limit, try rolling up the ID's into a New Formula which is a string running total such as:

 

whileprintingrecords;

stringvar srtIDs:= srtIDs + totext({youridfield},0,"") + "|";

 

The pipe "|" character will be used later on when you want to parse a certain ID out of the string running total.

 

Place this new formula on your details section and then suppress the formula.

 

2) Now you will want to create a new Custom Function named StringToken in the Formula Expert as Basic Syntax  and paste in the following code:

 

Function StringToken (string_input as string, character as string, number_of_characters as number)
dim token as number
dim incrementor as number
dim output as string
dim ender as number
ender = number_of_characters + 1

do until token = ender or incrementor = length(string_input)
incrementor = incrementor + 1
if string_input(incrementor) = character then token= token + 1
if ender - token = 1 and string_input(incrementor) <> character then output = output + string_input(incrementor)
loop
  StringToken = output
End Function

 

This custom function will allow to grab any Nth value from the string running total. E.g. you can grab the 10th value or the 2000th value.

 

NOTE: You shouldn't let your string running total get too big or you'll run into an output limit of 64k. There are ways around that limit as well (such as using multiple stringvars or putting up to 1000 large stringvars into an array) but this blog post won't get into that.

 

3) To test the Custom Function out create a new formula to put in your Report Footer with syntax similar to the following:

 

whileprintingrecords;

numbervar tokenid:= 10;  // 0 will bring back the first value from the string running total

stringvar srtIDs;

StringToken (srtIDs, "|", tokenid)

 

4) Now if all goes well, you should be able to grab values that are in a position that is greater than 1000. Please go to the last page of the sample report and you'll see that it is displaying the 1400th values for a Customer Name and the matching 1400th value for an Order Number ID.

 

I hope that you find this tecnhique helpful. If you are looking for any other solutions or workarounds for Crystal Reports, please see my blog here.

Yesterday I responded to a discussion seeking help to replace numbers with asterisks.

 

While I think my suggestion to loop through the string of data one character at a time replacing each character with an asterisk if it is a number will work I kept thinking that it could be improved.  I am certain the code I provided could be better, but it seemed to me that a whole different approach using a regular expression would be even better.

 

What I am going to suggest here requires some basic C# programming skills (which I have, but are rusty from lack of use) and control of your database (or at least a helpful DBA).

 

About six weeks ago my manager (and helpful DBA) asked me to help him create a CLR-based, user-defined function to assist in analyzing SQL Server 2008 trace data.  He had found a CLR function created by Itzik Ben-Gan and detailed in his book Inside Microsoft SQL Server 2005: T-SQL Querying.  Fortunately I had a copy of that very book updated for SQL Server 2008 on my desk to guide me through the details (pages 160 -162).

 

So my first step was to create a C# class library project.  I used Visual Studio 2010 and compiled my code targeting .NET 3.5 since the was the newest version of the .NET framework that was on the SQL Server to which were going to be deploying this function.

 

Here is entirety of the code taken directly from Ben-Gan's book...

 

using Microsoft.SqlServer.Server;

using System.Data.SqlTypes;

using System.Text.RegularExpressions;

 

public partial class RegExp

{

    [SqlFunction(IsDeterministic = true, DataAccess = DataAccessKind.None)]

    public static SqlString RegexReplace(SqlString input, SqlString pattern, SqlString replacement)

    {

        return (SqlString)Regex.Replace(input.Value, pattern.Value, replacement.Value);

    }

 

}

 

Proceeding to follow the steps laid out in the book you have to enable CLR on your SQL Server, load the IL code and register the RegexReplace function.  That all worked like a charm.  My manager got what he needed and we forgot about it.

 

Then I came across the discussion mentioned above and wondered if I could use that RegexReplace function when using a command object in Crystal Reports.  You sure can.

 

For the purposes of this example I created a global temporary table and inserted 3 rows as follows...

 

CREATE TABLE ##MyTable (ID INT, Column1 VARCHAR(50))

 

INSERT INTO ##MyTable (ID, Column1) VALUES (1, 'Some data $12,345.78')

INSERT INTO ##MyTable (ID, Column1) VALUES (2, 'Some other data 01/31/2013')

INSERT INTO ##MyTable (ID, Column1) VALUES (3, '123 Main Ave. - Apt #2B')

 

I then created a Crystal Report based on a command object and used my RegexReplace function.

And here are the results.

I am not a regular expression expert; there are plenty of other in-depth resources elsewhere.  My only intent was to show this was possible, not to incorporate comprehensive regular expression support into Crystal Reports.  If you would like to see that, vote for my idea.

 

Please understand that I did this as a proof-of-concept.  I don't have a need for this right now, but since I figured this much out I thought I would share it and perhaps this could be a building block for something for someone else.  The C# code could be enhanced to expose more regular expression  functionality or perhaps you could implement something totally different  that can be done in C#, but not in SQL Server or Crystal Reports.

 

Enjoy,

 

Noel

If you've ever wanted to create an index report in Crystal, here's a blog that will walk you through the steps on creating one. If you've ever wanted to create a table of contents in a Crystal Report, perhaps you can use this technique as a substitute.

 

Index.png

 

A lot of times there are forum posts asking how to create a Table of Contents report. This is not a lesson on building a table of contents but may be the next best thing and in a web viewer, linking can make it feel like a table of contents. The main difference between the two being that the table of contents is usually at the beginning while the index is at the end of the document. There is a way to create a table of contents using stored procedures and write-backs to the database but that will not be covered here.

 

In this 'how to lesson' we can walk through a sample report that you can get by clicking here. When you open up the file in the Crystal Reports (CR) designer you will notice that there is a "Go to Index" link on each page that will be active when you publish the report to either BusinessObjects Enterprise or to Crystal Reports Server and open it in the DHTML viewer. This link targets the "Index" text object that is in the Report Footer. If you right click on the "Go to Index" link and choose Format Text and then the Hyperlink tab, you'll see that it is a Report Part Link. Report Part Linking can be a handy feature and is documented further in your online help in the Crystal Reports Designer. I'll show you how to create some Report Links further on in the lesson.

 

If you go to the Design mode of CR there is a formula named "IndexBuilder" which you can copy to your report and place it in the section of your report where you want the index to be based on. In this sample, the index is based on collecting the group names and starting pages at the customer level. The index's highest level is on country, but the information we require is at the lowest level which is the group on customer name. When you copy the IndexBuilder to your report you will want to change the stringvar for "group1" and stringvar for "group2" to the matching groups on your report. You do not need to change anything else as long as you've got two levels of grouping on your report.

 

whileprintingrecords;
stringvar group1:= {@fGroup1};
stringvar group2:= {@fGroup2};

stringvar groupsSRT;
if onfirstrecord then groupsSRT:= '||';

groupsSRT:= groupsSRT + group1 + group2 + '|' + totext(pagenumber,0) + '||';

 

The above formula will keep track of your group hierarchy plus the lower level groups and their corresponding starting page numbers.

 

You will also want to copy the "IndexGroups" formula to your report and also change the groups in that formula to match the groups on your report.

 

Now on your report Insert a Cross-tab that you will place in your Report Footer. The two Row values will be the two groups that you are using in the above formulae. The Summary value will be the Maximum of the IndexGroups formula. Once you preview the report you can right click on the Maximum Summary and then choose Format Field and then click on the Display String formula icon. Insert the following syntax which will display the Page Number for each of your lower level group values:

 

whileprintingrecords;
stringvar groupsSRT;
stringvar tH:= currentfieldvalue;

numbervar i:= instr(groupsSRT, tH);
stringvar tG:= groupsSRT[i to i+length(tH)+6];
i:= instr(tG, '||');
tG:= tG[1 to i-1];
tG:= tG[instr(tG,'|')+1 to length(tG)];

 

You can also right click on either of the country row or the customer name row and then choose Format Field and select the Hyperlink tab. Note that there are Report Part Links that will take the end user to the appropriate group while in the DHTML viewer. Sorry, but these links don't work until you publish the report to your server environment.

 

Here's a brief outline on how you can put a Report Part Hyperlink into a cross-tab:

 

1) first you need to publish the report to your server environment (BusinessObjects Enterprise or Crystal Server)

2) right click on your Group 1 Name and choose Copy

3) right click on the Row 1 Name in the cross-tab and then choose Format Field and then Hyperlink

4) you should be able to Paste the Report Part Link into the dialogue

5) ensure that the Data Context is similar to below

 

"/"+GridRowColumnValue("your group 1 field")

 

This report part link will allow the end user to link from the index to any group on the report.

 

You can also customize your cross-tab by right clicking on the cross-tab and choosing Cross-tab Expert and then Customize Style. If you wish you can uncheck Show Cell Margins and also go to Format Lines and uncheck Show Grid Lines. This will quickly make the cross-tab smaller and less busy looking.

 

One final step for the sake of formatting your report is to allow the end user to open up the report and go to the index with one click.

 

1) Insert a Text Object that reads "Go to Index" and place this field on the Page Header

2) Insert a Text Object that reads "Index" and place this field on the Report Footer right above your index cross-tab

3) right click on the text object that reads "Index" and choose Copy

4) right click on the "Go to Index" text object and choose Format Text and click on the Hyperlink tab

5) you should now be able to Paste the Report Part link into the dialogue

 

Note that in this case there is no Data Context to pass as you're only linking from object to object.

 

If you create a one page Report Header you can also copy the "Go to Index" Text Object to this Report Header and then allow the end user to go directly to the index from the title page, thus (sort of) acting like a table of contents. So instead of paging to the second page for the table of contents, the end user clicks on the link to go to the index. Once in the index pages, the end user can easily select the data that they wish to navigate to.

 

I hope that you find this tecnhique helpful. If you are looking for any other solutions or workarounds for Crystal Reports, please see my blog here.

I've always thought that Service Packs for any product were a way of fixing bugs in software after release. If a software company wanted to introduce new features, they waited until the next full or point release. When I install software, I always patch to the latest Service Pack. I normally leave any in-between patches as they can introduce more problems than they solve due to less testing.

 

Following installation, unless a customer had a specific problem, I would always advise not to apply a new Service Pack. The thinking being that there's no point fixing ten bugs that aren't causing any problems, then introducing one new bug that breaks something important. The exception to all this has been security or compatibility fixes in a Service Pack, but they're normally solved at the operating system or application server level.

 

Looks like I need to change my recommendations!

 

Last year (2012) there were some major changes in functionality for the Crystal products introduced through Service Packs. SAP have justified this by renaming Service Pack to Minor Release but as the installer still says Service Pack, it looks like marketing have been getting involved rather than there being any technical change.

 

Let's take a quick look:

 

Crystal Server 2011 was released at Service Pack 2. Bit of an oddity, but due to being the same platform as Business Objects Enterprise. I seem to have missed Service Pack 3 (they were released thick and fast), but Service Pack 4 fixed a lot of the problems with the migration wizard. More importantly for the purpose of this post, the add-on for Mobile Solutions was made available. This had previously been available for the higher products, but not for Crystal Server. Dreadful name for the add-0n, but just meant you could use a native app for the iPad to access your Crystal Reports. This first release was very basic, just rendering an image of the report with none of the interactivity you expect with a Crystal Report.

 

This lack of interactivity was fixed with the introduction of Service Pack 5. Now I can start to get excited about the iPad app as it supports drill-down, interactive parameters, search and has a proper group tree. There's no longer a need to send complicated opendoc links to users.  Sadly, none of this has been extended to Android users yet. The current mobile solution of Android doesn't support Crystal Reports at all. I'm sure it's on the way, let's just wait for Service Pack 6 or 7!  On another note, if you do decide to install a Service Pack on Crystal Server, make sure you have all your custom configuration files saved somewhere safe. They disappear when the application is redeployed to Tomcat.

 

Crystal Dashboard (neé Xcelsius) had some mobile functionality added recently too. It seems strange that when I first started selling Xcelsius, its big selling point was the as it was flash based, most client computers could be used to view the dashboards! This all changed with the introduction of the iPad which is lacking flash. There are two options for application developers now - HTML 5 or a native application. I'm glad to say that SAP have gone for HTML 5 which will hopefully avoid all the issues of different functionality between platforms.

 

We're not quite there yet - when you save a dashboard to Crystal Server, you have the option to 'Save for mobile'. There are currently two caveats. The first is that not all the widgets are available, so some just won't render. The second is that not all data access options are supported. I'm frustrated that Web Services aren't there as it prevents use of the excellent Flynet. I guess that will be introduced in the future.

 

Crystal Reports for Enterprise Despite my initial reservations this product is rapidly improving. Graph support when you upgrade an existing rpt file is a bit odd, but other than that, I'm getting happier with every Service Pack. Native connections to databases (the important ones) has been around for a while now. The best bit about the native connections is that they're stored centrally when you save the report to Crystal Server. That means that when you change your database password or connection information, you only have one connection to edit rather than every report.  I still wouldn't recommend dropping Crystal Reports 2011 yet (could we call it Crystal Classic?), but I think it's worth examining Crystal Reports for Enterprise ready for the next release.

 

Crystal Reports 2011. Sorry to get you excited, but there's nothing going on here. Yes, we're up to Service Pack 5, but it's just bug fixes as far as I'm aware. I've no doubt I'll still be writing Crystal Reports in 5 years (that'll make 22 years of Crystal Reports for me), but we should all be preparing for the new kid on the block - Crystal Reports for Enterprise.

 

Where are they then? I had a strange discussion with my account manager the other day as I was struggling to find the Service Packs for Crystal Reports 2011. The initial response was that you had to buy an upgrade to get the latest Service Pack. Seemed a bit extreme given how frequently they're being released, and how minor some of the changes are, so I persevered.

The Crystal 2008 Service Packs are available for download at http://scn.sap.com/docs/DOC-27917

Crystal 2011 from here: http://scn.sap.com/docs/DOC-28273

Crystal Dashboard is in there somewhere too.

For Crystal Server, you need to have a current support contract, then download from support .

Needless to say, if you're struggling with this, and you're a customer of mine, just give me a call and I'll sort it out for you.

 

To end, a big thank you to whoever was reading my blog on Christmas Day. I salute your dedication to all things Crystal. There was also a lone reader on New Year's Day. Possibly an accident induced by a hangover, but thanks anyway.

 

Happy New Year!

I just created a report which had two required parameters and five optional parameters.  I found quite a bit of information about how to create and use an optional parameter, but I could not find anything how to make use of more than one optional parameter.  I couldn't figure out how to translate what I was finding into working for more then one parameter.

 

I got the raw T-SQL query working as I wanted it to in Microsoft SQL Server using COALESCE function as follows where @OptionalParameter1 to @OptionalParameterN are variables representing my optional parameters...

 

SELECT *

FROM myTable

WHERE myTable.Column1 = COALESCE(@OptionalParameter1, myTable.Column1)

     AND myTable.Column2 = COALESCE(@OptionalParameter2, myTable.Column2)

...

     AND myTable.ColumnN = COALESCE(@OptionalParameterN, myTable.ColumnN)

 

I attempted to translate that SQL criteria to the following in the Record Selection Formula of my report as follows...

 

If HasValue({?OptionalParameter1}) Then {Command.Column1} = {?OptionalParameter1} Else True And

If HasValue({?OptionalParameter2}) Then {Command.Column2} = {?OptionalParameter2} Else True And

...

If HasValue({?OptionalParameterN}) Then {Command.ColumnN} = {?OptionalParameterN} Else True

 

That worked, but only for the first optional parameter for which I had specified a value.  I knew somehow I needed to eliminate the If-statements, but I was stuck. 

At last, in yet another desperate Google search I came across this, Crystal Reports: Parameters Optional.  Although that didn't answer my question directly it helped re-frame my logic in such a way that I was able to get rid of the If-statements as follows.

 

(Not HasValue ({?OptionalParameter1}) Or {Command.Column1} = {?OptionalParameter1}) And

(Not HasValue ({?OptionalParameter2}) Or {Command.Column2} = {?OptionalParameter2}) And

...

(Not HasValue ({?OptionalParameterN}) Or {Command.ColumnN} = {?OptionalParameterN})

 

My report is working beautifully now.  Hopefully this will help someone down the line.

 

Noel

在跨國企業裡,一套資訊系統可能會有許多不同國家的使用者在使用,所以系統介面的多語是相當常見的,同樣地也有一些資訊是不同國家的使用者都想要關心的,這些資訊可能都在同一份報表中,為各地不同使用者而開發多份不同語文的報表版本,除了線性的開發成本增加外,另外也可能因不同版本報表,造成的溝通成本增加及決策延誤,報表的內容其實都是相同的,只是需要用不同的語系來說明這些資訊的意義,報表的多語應用就是為了節省這些成本而存在。

圖1.JPG

資訊系統的多語介面使用非常廣泛

 

Crystal Reports我們可以使用User Function Library (UFL),根據地區語系查閱外部檔案中不同語系的顯示值來達到多語的效果,這些UFL可以被用在Crystal Reports 2008BusinessObjects Enterprise XI 3.1的使用情境,首先我們要先下載幾個檔案,其中有兩個dll檔案:u212samp.dllxerces-c_3_0.dll,將其置放在安裝Crystal Reports designerBusinessObjects Enterprise主機的下列路徑資料夾內:C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 (64-bit環境為Program Files (x86)),取代原有的dll檔案。

 

 

然後在C:\ProgramData路徑下 (Windows 2003/XPC:\Documents and Settings\All Users\Application Data)建立一個名稱為LocalLookup的子資料夾,將下載檔案中的lookup.xml檔案置放在此資料夾內,就完成了相關的設定。

 

接著我們來研究lookup.xml檔案的內容,編輯檔案後可見基本架構如下:

 

<?xml version="1.0" encoding="utf-8"?>

<localizations xmlns:dt="urn:schemas-microsoft-com:datatypes">

  <key value="CountryTitle">

    <localization locale="zh_TW">國家</localization>

    <localization locale="en_US">Country</localization>

    <localization locale="ja_JP">国家</localization>

  </key>

  <key value="RevenuesTitle">

    <localization locale="zh_TW">銷售金額</localization>

    <localization locale="en_US">Revenues</localization>

    <localization locale="ja_JP">販売の金額</localization>

  </key>

</localizations>

 

        其中的key標籤,就是決定要用多語顯示的關鍵字及顯示值,當我們在這個xml檔案中維護了這些資訊後,就可以在Crystal Reports designer建立公式欄位,公式為Lookup(lookup.xml檔案中的關鍵字, ContentLocale),使用這個公式之後Crystal Reports就會依據關鍵字找到xml檔案中對應的標籤,再由開啟報表的client機器是何地區語系來決定要傳回哪個顯示值。

 

以上面的標籤內容為例,我們在一份報表的銷售金額上放一個公式欄位為Lookup("RevenuesTitle", ContentLocale),此時若client機器的地區語系是中文(台灣)會顯示銷售金額;若是英文(美國)就會顯示” Revenues”;日文(日本)則是販売の金額,下面是一張實作多語的報表在不同地區語系的client開啟的差異:

 

 

圖2.JPG

中文(台灣)

 

圖3.JPG

英文(美國)

 

圖4.JPG

日文(日本)

 

          下個世代的Crystal ReportsCrystal Reports 2011Crystal Reports for EnterpriseCrystal Reports for Enterprise使用語意層為資料來源,多語的實作也同Web Intelligence報表使用Translation Manager。透過多語的實作,來自世界各地不同國家的使用者不只可以用自己熟悉的語言使用資訊系統,還可以用自己熟悉的語言快速獲得報表中的資訊,更重要的是,報表製作人員不再需要把報表每一種語言重新製作一次,因此可以省下大量的時間人力成本。

Filter Blog

By author:
By date:
By tag: