• No results found

SAP Crystal Reports SDK Adding Reporting to Your Custom Applications (0304)

N/A
N/A
Protected

Academic year: 2021

Share "SAP Crystal Reports SDK Adding Reporting to Your Custom Applications (0304)"

Copied!
18
0
0

Loading.... (view fulltext now)

Full text

(1)

September 9–11, 2013

Anaheim, California

SAP Crystal Reports SDK – Adding Reporting to Your Custom

Applications (0304)

(2)

Key Learning Points

Brief History of SAP Crystal Reports SDKs

Showcase of Solutions using the SAP Crystal Reports SDKs

SAP Crystal Reports SDKs Available Today

(3)

Brief History

Definition: Software Development Kit

A software development kit (SDK or "devkit") is typically a set of

development tools that allows for the creation of applications for a

certain software package, software framework, hardware platform,

computer system, video game console, operating system, or similar

platform.

First Crystal Reports SDKs

CRPE, VCL, and VBX/OCX controls

Standalone report designer

Report Designer Component (RDC)  COM/ActiveX

SAP Crystal Reports for .NET

Java versions also released

(4)

Showcase of Solutions using the SDKs

SAP Business Suite (CR .NET WinForm)

SAP Landscape Virtualization Management (CR .NET WebForm)

SAP ByDesign (CR Java DHTML viewer)

AANDC (using RAS with the BI Platform)

(5)

SAP Crystal Reports SDKs Available Today

SAP Crystal Reports for .NET / SAP Crystal Reports for Eclipse

Visual Studio 2002 – 2012 / Eclipse 3.4-3.7

Embedded Report Designer

In-Process SDK & Runtime, including viewers

Report Application Server (RAS)

Designed to be used with BI Platform

SDK & Runtime, with out-of-proc server

Viewer SDK

WinForm, ASP.NET (DHTML), WPF, Java DHTML

JavaScript (BI4.0 FP03)

(6)

Common CR SDK Use Cases

Setting user credentials for the report’s data source

Setting values for parameters

Display report in viewer

Export report to other formats

(7)

Setting user credentials for the report’s data source

Required for secured databases

[.NET]

ConnectionInfo connectionInfo = new ConnectionInfo();

connectionInfo.ServerName = SERVER_NAME;

connectionInfo.DatabaseName = DATABASE_NAME;

connectionInfo.UserID = DB_USER_NAME;

connectionInfo.Password = DB_PASSWORD;

TableLogOnInfo tableLogonInfo = table.LogOnInfo;

tableLogonInfo.ConnectionInfo = connectionInfo;

table.ApplyLogOnInfo(tableLogonInfo);

[Java]

connectionInfo = newTable.getConnectionInfo();

propertyBag = new PropertyBag();

propertyBag.put(“Database Class Name”, DATABASE_CLASS_NAME);

propertyBag.put(“Server Name”, SERVER_NAME);

propertyBag.put(“Database Name”, DATABASE_NAME);

connectionInfo.setAttributes(propertyBag);

connectionInfo.setUserName(DB_USER_NAME);

connectionInfo.setPassword(DB_PASSWORD);

(8)

Setting values for parameters

Use Parameters fields to prompt user for input that can be used

to filter data

[.NET]

ParameterValues currentParameterValues = new ParameterValues();

ParameterDiscreteValue parameterDiscreteValue = new ParameterDiscreteValue(); parameterDiscreteValue.Value = newValue; currentParameterValues.Add(parameterDiscreteValue); ParameterFieldDefinition parameterFieldDefinition = reportDocument.DataDefinition.ParameterFields[PARAMETER_FIELD_NAME]; parameterFieldDefinition.ApplyCurrentValues(currentParameterValues); [Java]

ParameterFieldDiscreteValue newDiscValue = new ParameterFieldDiscreteValue(); newDiscValue.setValue(newValue);

clientDoc.getDataDefController().getParameterFieldController().setCurrentValue(reportName, parameterName , newValue);

(9)

Display report in viewer

Displaying the report in the runtime viewer

similar for all viewers

[.NET]

crystalReportViewer1.ReportSource = reportDoc;

[Java]

(10)

Export report to other formats

Providing report in other common formats

PDF, Microsoft Word/Excel, RTF, CSV, and more

[.NET]

ExportOptions exportOpts = new ExportOptions();

PdfFormatOptions exportPDFOpts = ExportOptions.CreatePdfFormatOptions(); exportOpts.ExportFormatOptions = exportPDFOpts;

reportDoc.ExportToHttpResponse(exportOpts, this.Response, true, "crystalreport.pdf");

[Java]

PDFExportFormatOptions pdfOptions = new PDFExportFormatOptions(); ExportOptions exportOptions = new ExportOptions();

exportOptions.setExportFormatType(ReportExportFormat.PDF); exportOptions.setFormatOptions(pdfOptions);

(11)

Use Viewer SDK to customize viewer

Display/Hide toolbar buttons

Provide custom toolbar (ie: page navigation)

[.NET]

//Customize toolbar

crystalReportViewer.HasExportButton = true; crystalReportViewer.HasPrintButton = false; crystalReportViewer.HasRefreshButton = false; //Custom page navigation

crystalReportViewer.ShowNextPage(); crystalReportViewer.ShowLastPage(); crystalReportViewer.ShowPreviousPage(); crystalReportViewer.ShowFirstPage(); [Java] //Customize toolbar crystalReportPageViewer.hasRefreshButton(); crystalReportPageViewer.hasExportButton(); crystalReportPageViewer.hasPrintButton(); //Custom page navigation

crystalReportPageViewer.showFirstPage(); crystalReportPageViewer.showLastPage(); crystalReportPageViewer.showPreviousPage(); crystalReportPageViewer.showFirstPage();

(12)

12

How reporting is being used in solutions today

SAP Crystal Report SDKs have evolved with changing technologies

and architectures

The basic needs for integrating reporting into your applications

Next Steps:

Download and use the SAP Crystal Reports SDKs in your solutions

Visit the SAP Community Network (SCN) for articles and samples

(13)

Resources

Download Sample Apps & Reports

http://www.sdn.sap.com/irj/boc/samples

CR .NET and CR Java SCN Portal Pages

http://scn.sap.com/community/crystal-reports-for-visual-studio

(14)
(15)
(16)
(17)
(18)

Thank you for participating.

Please provide feedback on this session by

completing a short survey via the event

mobile application.

SESSION CODE: 0304

Link to external site http://www.sdn.sap.com/irj/boc/samples http://scn.sap.com/community/crystal-reports-for-visual-studio http://scn.sap.com/community/crystal-reports-for-eclipse

References

Related documents

• Intuitive reporting solution helps create flexible, feature-rich, and dependable reports and printouts.. 1bn .rpt files

2012 with SAP Crystal Reports for SAP Business One - Design-time version is only given with SAP Crystal Reports 2013 for SAP Business One, which is supported by SAP Business One

In this section we are going to create a sales report with a bar chart showing yearly sales of the products, a pie chart showing overall sales of products, and a cross table

In the Page View, open the Page Header section, right-click the object that you want to bind the sort control to (such as the customer field), and then select Bind Sort

To define an SAP Crystal Reports .rpt file as a report or a layout and save it to the SAP Business One database, in the Add-ins menu, choose the Save or Save As

To run a report created with the Crystal Reports software, do one of the following: • Run the report from the Report and Layout Manager

• Many Fortune 500 companies are using the technique of an enterprise reporting bus to integrate SAP BusinessObjects WebI and SAP Crystal Reports directly into the applications

Crystal Reports for Enterprise & HANA Studio CR for HANA Connector Delivery Unit CR for HANA Reporting Service Report requests sent to Reporting Service Processed