Reporting Framework - Crystal Reports
DELMIA Apriso 2020 Technical Guide
®2021 Dassault Systèmes. Apriso, 3DEXPERIENCE, the Compass logo and the 3DS logo, CATIA, SOLIDWORKS, ENOVIA, DELMIA, SIMULIA, GEOVIA, EXALEAD, 3D VIA, BIOVIA, NETVIBES, and 3DXCITE
are commercial trademarks or registered trademarks of Dassault Systèmes or its subsidiaries in the U.S. and/or other countries. All other trademarks are owned by their respective owners.
Use of any Dassault Systèmes or its subsidiaries trademarks is subject to their express written approval.
Contents
1Introduction 5
1.1Objective 5
1.2Scope 5
1.3Definitions,Acronyms,andAbbreviations 5
2FrameworkOverview 6
2.1Motivation 6
2.2Features 6
2.3Implementation 7
3Usage 8
3.1KeyAspects 8
3.2ToolsInstallationandPrerequisites 8
3.3CentralConfiguration 8
3.4ConfiguringaDeveloperMachineforDesigningCrystalReportsforDELMIAApriso 9
3.5CreatingaReportDefinitionFile 9
3.5.1CreatingaNewReport 9
3.5.2DefiningaGrouping 10
3.5.3DefiningFiltersforReports 11
3.5.4DefiningAdditionalParameters 11
3.5.5LocalizationofStaticLiterals 11
3.5.6UsingUTCConversionFunctions 12
3.5.7MakingCulture-DependentDateandTimeFields 13
3.6CreatingaReportConfigurationFile 14
3.6.1GeneralPropertiesofReports 14
3.6.2Filters 15
3.6.3Parameters 16
3.6.4Grouping 17
3.6.5DiscreteValues 18
3.6.6QueryValues 18
3.7UsingADO.NETDataSetsinReports 19
3.7.1PreparingaDataSetinC#Code 19
3.7.2UsingaDataSetinaReport 20
3.8PerformingOtherTasks 20
3.8.1WritingCustomUser-DefinedFunctions 20
4UseCases 23
4.1ConfiguringanODBCConnection 23
4.2CreatingCrystalReport 25
4.3ModifyingtheReport 30
4.3.1AddingCrystalReportParameters 30
4.3.2AddingFormulaFields 33
4.4DELMIAAprisoConfiguration 37
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
2
4.4.1AddingDELMIAAprisoParameters 37
4.4.2MovingRPTandXMLFiles 38
4.4.3LoadingReportAdministrator 38
4.4.4ReportTesting 40
4.4.5DataTranslationandLocalTimeAdjustment 41
5BestPractices 46
5.1ReportOrganizationandStyle 46
5.2Standards 46
5.2.1PaperSizeandFonts 46
5.2.2Header 46
5.2.3Footer 46
5.3CommonMistakes 47
5.3.1BindingReportsStaticallytoOneDatabase 47
5.3.2UsingViewsinReports 47
5.3.3OuterJoins 47
5.3.4SelectionFormulas 48
5.3.5UsingSub-Reports 48
5.3.6PageSetup–OptimizationforScreenDisplay 48
5.4OptimizingReportsforExportingtoExcel 50
6KnownIssues 51
7References 54
Figures
Figure1FlexNetLocalizationLocalizeLiterallocationintheFunctionstree 12
Figure2DateFormatEditorwindow 13
Figure3Configuringthereportgeneralproperties 15
Figure4Configuringreportfilters 16
Figure5Configuringreportparameters 17
Figure6Configuringreportgroupings 19
Figure7ODBCDataSourceAdministrator 23
Figure8OracleODBCDriverConfiguration 24
Figure9Testingthedatasourceconnection 24
Figure10Creatinganewreport 25
Figure11Creatinganewdatabaseconnection 25
Figure12Selectingthedatasource 26
Figure13Enteringtheconnectioninformation 26
Figure14Dataview 27
Figure15SelectedTables 27
Figure16Predefinedtablelinks 28
Figure17Addingthefieldstodisplay 28
Figure18Definingthegroupinginformation 29
Figure19Reportpreview 29
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
3
Figure20Designview 30
Figure21FieldExplorerwindow 30
Figure22ReportIDparameter 31
Figure23LanguageIDparameter 32
Figure24TimeZoneIDparameter 32
Figure25ParametersaddedinFieldExplorer 33
Figure26SelectingFormulaWorkshop 33
Figure27Addinganewformula 33
Figure28Editingthef_Titleformulafield 34
Figure29Libraryview 34
Figure30Placingthef_Titlefieldinreportheader 35
Figure31Formatfieldoption 35
Figure32Fontsettings 35
Figure33Formattedreportdesign 36
Figure34Reportvalues 36
Figure35Reportpreview 37
Figure36LoadingReportAdministrator 39
Figure37ReportExplorer 39
Figure38Addingreportconfigurationanddefinitionfiles 40
Figure39OpeningReportViewer 40
Figure40Viewingareport 41
Figure41Selectingtherecordeditor 41
Figure42RecordSelectionFormulaEditor 42
Figure43Addinganewformulafield 42
Figure44Enteringtheformulaname 43
Figure45f_LastUpdateOnformulatext 43
Figure46Addingaformulatothereportsection 43
Figure47Specifyingthereportparameters 44
Figure48Finalversionofthereport 44
Figure49Originaldataonthedatabaseserver 45
Figure50NoPrinteroptiononthePageSetupscreen 49
Figure51Trimmedreportview 49
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
4
1 Introduction
1.1 Objective
Theobjectiveofthisdocumentistogatheralloftheinformationrequiredbytheprogrammerto
utilizetheReportingFrameworkusingCrystalReports.Theknowledgeincludedinthis
documentshouldallowtheprogrammertousetheframeworkwithoutmajorpriorknowledge
ofthesubject.
1.2 Scope
Thescopeofthisdocumentdescribesthefollowingcoreareas:
ThestepsrequiredtocreateanewDELMIAAprisoReportingServicesreport
Creatingareportconfigurationfile
Using.NETmethodsinareport
Frameworklimitations
Bestpractice
Knownissues
1.3 Definitions, Acronyms, and Abbreviations
Report file–afilegeneratedbyCrystalReports(BusinessObjects)thatstoresinformation
aboutthereport.
Report configuration file–afileusedbytheDELMIAAprisoReportingFrameworkthat
containsinformationsuchasparameters,groupings,filters,etc.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
5
2 Framework Overview
AlloftheReportingFrameworkssupportedinDELMIAAprisoarepresentedforcomparisonin
thefollowingtable:
Framework Pros Cons
CrystalReports WorksonbothOracle
andSQLdatabases
Worksonboth32-bit
and64-bitplatforms
Istheindustryleader
Requiresadeveloperlicensetobuildthe
reports
SQLServer
Reporting
Services
Comesforfreewiththe
SQLServer
Noruntimeor
developerlicenseis
required
Worksonboth32-bit
and64-bitplatforms
RequiresanSQLServerdatabase,which
isaproblemforOraclecustomers
XtraReports WorksonbothOracle
andSQLdatabases
Noruntimelicenseis
required
Worksonboth32-bit
and64-bitplatforms
Requiresadeveloperlicensetobuildthe
reports
2.1 Motivation
ThemotivationfordevelopingtheCrystalReportsReportingFrameworkwastoprovidea
flexibleandeasywaytoprintanddisplayreportswhenretrievingdatafromadatabase,
especiallyforthosecustomerswhowishtodeveloptheirownreports.Itprovidesameansto
easilyintegratereportswithoutadditionaldevelopmenteffort.
2.2 Features
ThefollowingfeaturesarecharacteristicofCrystalReports:
Usersareprovidedwiththeabilitytocreatenewreportsandaddthosereportstothe
DELMIAAprisoReportViewerwithoutprogramming
Userscancreatereportdefinitionfilescontaininggroupings,filters,andparametersthat
canbeappliedtoreports
Onlyonedefinitionfileisgenerated,whichcanbeusedbybothMSSQLServerandOracle
Theframeworkallowsforchangingadatabaseconnectionwithoutprogrammingand
modifyingthereportdefinitionfiles
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
6
Theframeworksupportstheconfigurationoffilters,parameters,andgroupingswithout
programmingandchangingtheframework
Theframeworkmakesitpossibletocreatereportsthatcanbelocalized
Allstaticliteralsandliteralsfromadatabasearelocalized,whileUTCtimeconversions
aremadeinthereport
Supportforcallingexternal.NETwrittenfunctionsforcomplicatedcalculations
Supportforreportsobtainingdataindirectlyfromadatabasebutfrom.NETpre-generated
datasetsforverycomplicatedreportsthatcannotberealizedusingSQLqueriesinthe
report
2.3 Implementation
TheWebReportingFrameworkisimplementedasaconfigurableWebviewerusingareport
configurationfileasaninput.BasedonanXML,adynamicUIiscreatedforeachreport.When
usingtheUI,youcanconfigurethereportsparameters,whicharepassedontothereport
enginebytheframework.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
7
3 Usage
3.1 Key Aspects
ThemaintaskoftheReportDesigneristodefinenewreports.Toaccomplishthis,areport
mustbedesignedinCrystalReportsusingstandardCrystalrulesaswellasseveralrules
uniquetoDELMIAApriso.Correspondingconfigurationfilesarethencreatedandthereport
mustberegisteredintheDELMIAAprisoReportAdministrator.
3.2 Tools Installation and Prerequisites
TodisplayCrystalReportsintheruntime,theSAPCrystalReportsruntimeengine(Version
13,ServicePack18)mustbeinstalledontheDELMIAAprisoserverandtheCentral
Configurationflagmustbeenabled(see3.3CentralConfigurationfordetails).
TodesignCrystalReports,theCrystalReportsDesignerorCrystalReportsforVisual
Studio.NETClickOnce(Version13,ServicePack18)mustbeinstalledonthedeveloper’s
machine.Thisdocumentdescribesthelatterinuse.
SincetheExpressversionofVisualStudio2010doesnotsupportplug-ins,itis
requiredtohavetheProfessional,Premium,orUltimateversioninstalledforuse
withCrystalReportsforVisualStudio(whichisconsideredaplug-in).
MicrosoftOfficewithInfoPath(toeasereportconfigurationfilecreation).
3.3 Central Configuration
CrystalReportsframeworkcanbeconfiguredusingkeyslocatedinthe“Reporting”sectionof
theCentralConfigurationfile(fordetails,seeCentralConfigurationDocumentation).The
CrystalReportsframeworkusesthefollowingkeys:
EnableCrystalReportstheflagmustbesettoTrueforCrystalReportstobeused(bydefault
itissettoFalse)
ReportLibraryPath–pointstothereportlocation
1
LabelLibraryPath–pointstothelabellocation
1
ReportHeaderString–yourcompanyname
Customconnectionsallowtheusertochoosethedatabasethatwillbeusedtogeneratethe
report:
CustomConnectionAlias1–thenamethatwillbedisplayedinReportAdministrator
CustomConnectionType1–CrystalReports
CustomConnectionParameters1–thedatabaseconnectionstring
Exportconfiguration:
1
Whensettingalocationdifferentthantheoriginalone,pleasemakesureithastheproperaccessrightsconfigured.Therightsare“Read&
execute,”Read,”andListfoldercontents”forthe<domain>\Users”usergroup.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
8
ReportExportDir–thedirectorywherereports/labelsaregenerated
ReportExportUrl–theURLwherereports/labelsaregenerated
StandarddatabaseconnectionconfigurationisperformedwithuseoftheDELMIA
AprisoConfigurationManager(fordetails,refertotheConfigurationManagerHelp).
3.4 Configuring a Developer Machine for Designing Crystal
Reports for DELMIA Apriso
TheDELMIAAprisoReportingFrameworkoffersspecialfeatures(likelocalizationofUTC
conversions)thatcanbeusedinreports.Toenablethesespecialfeatures,thefollowing
configurationstepsmustbeperformedonthemachinewherereportswillbedesigned:
1. InstalltheCrystalReportsDesigneronthedevelopmentmachine.
2. Install.NETFrameworkonthedevelopmentmachine.
3. InstallthereportdevelopmentfilesusingtheDELMIAAprisoClientInstaller.
3.5 Creating a Report Definition File
3.5.1 Creating a New Report
Tocreateareportfile,theCrystalReportDesignerapplicationintegratedwithVisualStudio
.NETorthestandaloneproductfromCrystalDecisions(BusinessObjects)mustbeused.
ThebestwaytocreateanewreportthatcanbeusedinDELMIAAprisoReportVieweristo
useoneofthetemplatefilesdeliveredwithDELMIAApriso(thesecanbefoundintheFile
PackssectionofTools and File PacksontheDELMIAAprisoServerConfigurationpage).
Thosetemplatesincludeallofthestandardparameters,astandardreportheader,andapage
footer.
Whencreatinganewreport,thefollowingrulesmustbeobeyed:
Createanewreportfile(*.RPT)andreportconfigurationfile(*.XML)
Thenameofthereportdefinitionfilemustbethesameasthenameofthereport
configurationfile(excludingtheextension).Usuallythefilenameshouldlookasfollows:
FlexNet Rpt{Report Number} {Report Name}.{rpt | xml}
Thereportconfigurationfilemustpreciselymatchthereportfile.Formoredetails,
referto3.7UsingADO.NETDataSetsinReports.
Specifyadatasourceforthereport–generally,DELMIAAprisosupportstwotypesofdata
sources:
ODBCwithuserauthentication(notWindows)
ADO.NET(ifauserwantstoretrievedataprogrammaticallyusingC#.NETcomponents)
Formoredetails,referto3.7UsingADO.NETDataSetsinReports
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
9
IfproblemsarisewhileusingODBCforOracleDBMS,createnewreportfilesusing
theOracleServerdatasourceasdescribedin5.1ReportOrganizationandStyle.
3.5.2 Defining a Grouping
Reportscanbecreatedthataredisplayableindifferentmanners,dependingonwhich
groupingtheuserselects.
Tocreateareportthatcanbegrouped,theGroupingIDparametermustbedefined.This
parameterisrequiredtodeterminewhichgroupinghasbeenselectedbytheuser(ifareportis
beingcreatedfromatemplate,thisparameterdoesnothavetobedefined).Thegrouping
formulacouldresemblethefollowing:
select {?GroupingID}
case "WorkOrder":
{WIP_ORDER.WipOrderNo}
case "Product":
{PRODUCT.ProductNo}
case "WorkCenter":
{WORK_CENTER.WorkCenter}
default: ""
Theaboveformulasverifywhichgroupinghasbeenselectedbytheuserandreturnan
adequatevaluefromthevariablesusedinthereport.
Createanewgroupinthereportandselectthecreatedformulaasthe"GroupedBy"field.To
makeagroupingavailabletousers,referto3.6.4Grouping.
Aftercompletingtheabovesteps,theuserwillhaveagroupingintheirreportthatis
modifiable.
Iftheuserwantstohaveareportthatisgroupedbymorethanoneformula,heorsheneedsto
createadequateformulasforeachgroupinglevel(inCrystalReports,groupsimplicate
themselves,andtherecanonlybeonegrouponeachlevel).
Forexample,assumeasecondformulahasbeencreatedinthefollowingway:
select {?GroupingID}
case "WorkOrder":
{PRODUCT.ProductNo}
case "Product":
{WIP_ORDER.WipOrderNo}
case "WorkCenter":
{WIP_ORDER.WipOrderNo}
default: ""
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
10
Inthiscase,ifthereportisgroupedusingbothexemplaryformulasandtheuserselects
groupingbyWorkOrder,datainthereportwillbegroupedbyWIP_ORDER.WipOrderNo
andthenbyPRODUCT.ProductNo.
3.5.3 Defining Filters for Reports
Iftheuserwantsareportthatcanbefiltered,thentheonlyoptionistoaddafiltersectiontothe
reportconfigurationfile.Fordetails,referto3.6.2Filters.
3.5.4 Defining Additional Parameters
Todefinenewparameters,pleaserefertotheCrystalReportsdocumentation.Tomakethe
parametersavailabletousers,referto3.6.3Parametersformoredetails.
Parameternamesinsub-reportscannotbethesameasparameternamesinthemain
report.
3.5.5 Localization of Static Literals
ThefunctionsdescribedheremaynotworkiftheCrystalReportswereupgradedsince
DELMIAAprisowasinstalled.Toresolvethisproblem,referto5.1ReportOrganization
andStyle.
MakesurethattheClientApplications.xmlfileinCentralConfigurationdirectoryon
DELMIAAprisoservercontainstheFlexNet.BusinessRules.Printingclientapplication
entry.Ifnot,itmustbemanuallyaddedinorderforstaticliteralslocalizationtowork
correctly.
Tolocalizestaticliteralsinareport,theuserneedstouseaformulathatinvokesthe
FlexNetLocalizationLocalizeLiteralfunction.ThisfunctioncanbeselectedfromtheFunctions
treeunderAdditionalFunctions.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
11
Figure1FlexNetLocalizationLocalizeLiterallocationintheFunctionstree
TheReportDeveloperneedstopasstothisformulatheReportIDandLanguageIDparametersas
wellasthedefaulttranslation,whichistheliteraltobedisplayedandtheliteralID(that
identifieswhichliteralisused).TheLiteralIDshouldbeauniquevaluewithinthereport,and
usuallyitisthedefaulttranslationwithoutspaces.
Forexample,iftheuserwantstodisplay“WorkOrder”,thenintheformulaheorshecalls:
FlexNetLocalizationLocalizeLiteral({?ReportID}, "WorkOrder", "Work Order", {?LanguageID});
RefertotheProcessofTranslationImplementationGuidefordetailsonreportlocalization.
3.5.6 Using UTC Conversion Functions
ThefunctionsdescribedheremaynotworkwhenCrystalReportsareupgradedafter
DELMIAAprisoisinstalled.Toresolvethisproblem,refertosection5.1Report
OrganizationandStyle.
WhenadateisintheUTCtimezone,localizationofthereport’sDateTimevaluefieldcanbe
accomplishedbycreatingaformulathatinvokeseithertheFlexNetLocalizationUTCToLocalor
FlexNetLocalizationUTCToLocal11function(whichcanbeselectedfromtheFunctionstreeunder
“AdditionalFunctions”).
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
12
FlexNetLocalizationUTCToLocal11(int TimeZoneID,string datetime, int languageID)allowstheuser
tolocalizeDateTimevalues,regardlessofemployeepersonalizationandserverlocalization
settings.Bydefault,languageIDshouldbetakenfromtheLanguageIDreportparameter.This
methodshouldbeusedinsteadofFlexNetLocalizationUTCToLocal.
ConversionfromlocaltoUTCtimecanbedoneinasimilarwaythroughtheuseofthe
FlexNetLocalizationLocalToUTCorFlexNetLocalizationLocalToUTC11function.
TheTimeZoneIDandDateTimevalues(convertedtostring)mustbepassedtothatfunction,which
returnsalocalizedDateTimestring.
Forexample,ifauserwantstoconvertWIP_ORDER.CreatedOntolocaltimeinthedd-MMM-yy
hh:mmformat,thentheformulashouldlooklikethis:
local stringVar createdOnString;
createdOnString:= FlexNetLocalizationUTCToLocal({?TimeZoneID}, Cstr( {WIP_ORDER.CreatedOn}
) );
if IsDateTime(createdOnString) then
ToText( DateTimeValue(createdOnString), "dd-MMM-yy hh:mm" );
3.5.7 Making Culture-Dependent Date and Time Fields
Tomakedate-timefieldsculturedependent,auserneedstoselectintheFormat Editor }
Datetab“SystemDefaultLongFormat”or“SystemDefaultShortFormatforDatevaluefields
and“SystemDefaultTime”forTimevaluefields(thedateformatwillberetrievedfromthe
systemRegionalandLanguageOptions”settings).
Figure2DateFormatEditorwindow
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
13
3.6 Creating a Report Configuration File
ReportDesignersmustcreateaconfigurationfileintheXMLformatforeveryreport.This
describesthereport'sname,version,parameters,andthefiltersitwilluse.Tocreatethisfile,
ReportDesignersshouldusetheReportDefinition.xsnfileasatemplate.Thiscanbeedited
usingMSInfoPath2003.Theconfigurationcanalsobecreatedmanuallyaccordingtothe
ReportDefinition.xsdschema.Thisdocumentdescribesonlythefirstmethod.
Tocreatetheconfigurationfile,usersmustfillinthetemplatewiththedatatheyneedinthe
report.Somesectionsareoptional(ashortHelpisontheright-sideofthepanel).
BoththeReportDefinition.xsnandReportDefinition.xsdfilesareavailableontheDELMIA
AprisoserverthroughtheDELMIAAprisoServerConfigurationpage(inToolsandFile
Packs).
3.6.1 General Properties of Reports
Propertiesneedtobedefinedforeveryreport.Thesepropertiesareatthetopofthepanel.
Usershavetosetbasicpropertiesforeachreport,suchas:
Report ID(requiredvalue)–thereportsuniqueidentifier
ThisisusedforlocalizationandissetasthevaluefortheReportIDparameterinthe
report
Typically,thereportIDshouldresemblethefollowing:
FlexNet.Reports.{TypeOfYourReport}.Rpt{ReportNumber}_{ReportNameWithoutWhitespaces}
Forexample:
FlexNet.Reports.Production.Rpt15_WorkOrderOperationPlannedVsActualDates
Report Name(requiredvalue)–thenameofthereportthatwillbedisplayedtotheuser
Typically,thefollowingtemplateshouldbeused:
FlexNet Rpt{ReportNumber} {Report Name}
Forexample:
FlexNet Rpt15 Work Order Operation Planned vs. Actual Dates
Report Version(requiredvalue)–theversionnumberofthereportshouldbeinsertedhere
Report Engine(required)–foreachReportingServicethereshouldalwaysbea
“ReportingServices”value
FilterType–determineswherefilterswillbeperformed,andtheacceptablevaluesare:
Crystal–filteringwillbeperformedinthereport,buttheusercannothaveaReport
Generationsectionintheconfigurationfile(thisisthedefaultvalue)
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
14
SQL–filteringwillbeperformedduringreportgeneration,butthiscanbeusedonlyifthe
reportisgenerated;therefore,ifitissettoSQL,thenaReportGenerationsectionmust
beaddedtotheconfigurationfile(see3.7UsingADO.NETDataSetsinReports)
UnderDescription,thereportcanbedescribedindetail(notrequired).
Figure3Configuringthereportgeneralproperties
3.6.2 Filters
Ifauserwantstoenablefilteringintheirreport,theymustclickClickheretodefinefiltersfor
report.Everydefinedfilterfieldmustbeplacedinthatsection.Foreachfilterfield,theuser
mustdefine:
Filter Name–thenameofthefilterfield,whichisusuallythetablenameandfieldname
usedintheReportDefinition,forexample:
WIP_ORDER.WipOrderNo - for field from database used in report
@FormulaFieldName for formula field
?ParameterName for parameter
Value displayed to the user–thevaluethatwillbedisplayedintheFilterEditorinReport
Viewer
Type of filter field value–thetypeoffilterfieldthatisbeingusedinthereport
UserscannotuseeverytypethatisavailableinCrystalReports
Thetypesavailableare:
Type Description
Integer ThesameasNumberinCrystalReports.
Decimal ThesameasDecimalinCrystalReports.
Char ThesameasStringinCrystalReportsandSQL.
DateTime ThesameasDateTimeinCrystalReports.
Date ThesameasDateinCrystalReports.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
15
Bool ThesameasBoolinCrystalReports.AvailablevaluesareinDiscrete
Values,andtherearetwoDiscreteValueswithActualValuesTrueand
False.
Table1Availablefieldtypes
DiscreteValuesorQueryValuescanalsobedefinedforafilterbyclickingontheappropriate
link.Formoredetails,referto3.6.5DiscreteValuesand3.6.6QueryValues.
Figure4Configuringreportfilters
DiscreteValuesandQueryValuescannotbesettogether–onlyoneofthemcanbe
usedforvalues.
3.6.3 Parameters
Parametersareusefulwhenareportneedstoobtainsomeinformationfromauserbeforeitis
displayed.
Besidesstandardparameters,eachparameterthatisdefinedinthereportfilemustbelocated
inthecorrespondingconfigurationfile.Todefineaparameter,click“Clickheretodefine
parameterforreport.”Thefollowingcanbedefinedforeachparameter:
Parameter Name(requiredvalue)–thenameoftheparameterthatisdefinedinthereport
Value displayed to the user–thevaluethatwillbedisplayedintheParameterssectionin
ReportViewer
ThevaluedoesnothavetobedefinediftheparameterisInternalorHidden
Type of parameter value–thetypeofparameterinthereport
Theavailabletypesarethesameasforfilters(see3.6.2Filters)
ThevaluedoesnothavetobedefinediftheparameterisInternal
Picked Value Required–usedwhenDiscreteValuesandQueryValuesaredefined(see
3.6.5DiscreteValuesand3.6.6QueryValues)
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
16
Value is Required–ifchecked,theuserdoesnothavetopassthevalueforthatparameter
(bydefaultthisisselected)
Internal Parameter–ifselected,theparameterwillbeidentifiedbythereportfileas
internal–novaluewillberequiredandpassedfromit
Additionally,itwillnotbedisplayedtotheuserintheReportViewer
Hidden for the user–ifselected,theparameterwillnotbedisplayedtotheuserinthe
ReportViewer,butitwillstillneedtohaveadefaultvaluesetthatistobeusedbythe
report(bydefaultthisisnotselected)
Key Value Number–whenprintingareportfromafunction,parametervaluesaresavedto
specificfieldsofthePRINT_REQUEST_HISTORYtable
ThesefieldsarenamedKey1,Key2,Key3,etc.
TheKeyValueNumberallowsforassigningparameterstotablefields(e.g.,theKey1
fieldcorrespondstoKeyValueNumber"1")
Default Value for parameter–thedefaultvaluefortheparameter,whichwillbedisplayed
totheuser
ThedefaultvalueisrequiredonlyiftheparameterisHidden
DiscreteValuesandQueryValuescanalsobedefinedforparametersbyclickingthe
appropriatelink.Formoredetails,referto3.6.5DiscreteValuesand3.6.6QueryValues.
Figure5Configuringreportparameters
DiscreteValuesandQueryValuescannotbesettogether–onlyoneofthemcanbe
usedforvalues.
3.6.4 Grouping
Inthissectionofthereportconfigurationfile,theavailablegroupsforareportarewritten.To
addgroupstoareport,clickClickheretoinsertgroupingoptionsforreportandtheninputall
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
17
oftheavailablegroupsthatausershouldbeabletoselectforareport.
In“Valuedisplayedtotheuser,avaluecanbedefinedthatwillbedisplayedtotheuserinthe
groupingsectioninReportViewer.In“Group,avaluecanbesetthatwillbepassedtothe
GroupingIDparameterofthereport(thisshouldbethegroupnamedefinedinthereport).
In“DefaultGroup,thereportsdefaultgroupcanbedefined.
3.6.5 Discrete Values
Discrete Valuesarelistedvaluesthatareavailabletotheparameterorfilterfields.Iftheuser
wantstoinsertaDiscreteValue,thenheorshehastodefinethevaluewiththesametypeas
avalueselectedfromthedrop-down.Foreveryvaluethereshouldbedefinedarendered
literalthatwillbedisplayedtotheuserinsteadofthevalue.
Picked Value Requiredcanalsobedefinedforfilters.Ifselected,thentheusercanonly
selectvaluesdisplayedinthecombobox.Ifcleared,thentheusercanalsoentertheirown
values.Bydefaultitisselected.Usuallyuserssetitasclearedwhenthevaluesdisplayedto
theuserarethesameasthevaluespassedtothefilterfield.ThishappenswhentheDiscrete
Valuesrenderedliteralandthevaluearethesame,ortheQueryValuesrenderedcolumnand
thevaluecolumnarethesame.Iftheyaredifferent,thenitispreferablethatthesettingbe
selected.
3.6.6 Query Values
Inthissectionaquerycanbedefinedthatretrievesvaluesforaparameterorfilterfieldthatare
storedinthedatabase.UserscaninsertaQueryValuessectionintotheconfigurationfileby
clicking“Clickheretoinsertqueryforfilter.
Togetthosevalues,userscandefine:
Query–thisistheSQLquerythatretrievesdatafromthedatabase
AqueryshouldbewrittenthatcanbeusedonbothSQLandOracleservers
Thisquerycanbeparameterizedbytwovariables:@EmployeeIDand@LanguageID.
Rendered column–thenameofthecolumnthatwillhaveitsvaluesdisplayedtotheuser
Value column–thenameofthecolumnthatwillhaveitsvaluespassedtotheparameter
orfilterfield
PickedValueRequiredcanalsobedefinedforfilters.Formoreinformation,referto3.6.5
DiscreteValues.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
18
Figure6Configuringreportgroupings
3.7 Using ADO.NET DataSets in Reports
3.7.1 Preparing a DataSet in C# Code
ItispossibletomakeareportthatusesDataSetsasadatasourcebyfollowingthesesteps:
1. DefinetheDataSetdefinitionfile(*.XSD)inVisualStudio.NET.
2. Writeaclassthatimplementstheinterfacedescribedbelowfromthe
FlexNet.BussinessRules.Printing.dllassembly,whichfillstheDataSetthatwillbeusedas
thedatasourceforthereport:
public interface IReportGenerator
{
Outcome GenerateReport( string reportID, ReportPrintRequest profile, out DataSet
dataSet, bool limitSize );
}
ThefollowingparametersarepassedtoGenerateReport:
reportID–theuniqueIDofthereportdefinedinthereportconfigurationfile
limitSize–selectedmeansthatthesizeoftheDataSetcanbelimitedifitistoolarge
andonlypartofthedatabasedatawillberetrieved
profile –theuserprofileforthatreport
ItcontainsParameterValuesandvaluesthatweresetbytheuser,thegroupingthat
theuserselected(ifavailable),andFilter,whichcontainsthefiltersthattheuserset
forthereport
ThemostimportantforgenerationofthereportisFilterandoccasionally
ParameterValues(dependingonthereport)
FromFilter,theusercanretrievetheFilterConditionandExpressioncollectionthat
canbeusedintheWHEREclause
3. Inthereportconfigurationfile,thefollowingsectionneedstobeadded:
<ReportGeneration>
<ClassName>Your class name</ClassName>
<AssemblyName>
Your assembly name without .dll extension
</AssemblyName>
</ReportGeneration>
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
19
3.7.2 Using a DataSet in a Report
TouseaDataSetinareport,theusershouldsettheDataSetdefinedasthereportsdata
source.TosetaDataSetasadatasource,inDatabaseExpertintheDatatabselectMore
DataSources”andthenADO.NET(XML),andthenbrowsetotheDataSetsXSDfile.
3.8 Performing Other Tasks
3.8.1 Writing Custom User-Defined Functions
User-definedfunctionscanbedesignedandprogrammedinanylanguagethatsupportsthe
developmentofWindowsDLLs.Thismeansthatanautomationservercanbecreatedinany
languageenvironmentthatsupportsCOM.Usersmustnametheautomationserverwitha
CRUFLprefixandregisteritonacomputer.SeagateCrystalReportsFormulaEditorwillthen
beaccessibleandmakeavailableanyfunctionsexposedbythatautomationserver.
Thisisanexamplewhereuser-definedfunctionsarecreatedusingC#inVisualStudio.NET:
1. CreateaC#ClassLibraryproject.
2. IftheuserwantstoregistertheCOMautomatically,theymustset:
Project } Properties } Configuration Properties } Build } Register for COM Interop =
selected
Thiswillautomaticallyremoveoldfunctionsandregisterthenewone.Thisisasample
codewithdescriptions:
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
20
//the namespace must have CRUFL prefix
namespace CRUFLNamespace
{
//Here you must insert functions declarations
//(only this functions which you want to use in your reports).
//
//RESTRICTIONS:
//Interface must be public.
//
//Function parameter can’t be decimal, it can be replace with float
//(function cant return dacimal as well).
//
//If you want to pass DateTime into function or if you want function //return DateTime
you must convert DateTime to string (string to //DateTime)
//
//You cant use out, ref parameters
//this number must be unique, you can create it usinguuidgen.exe
//in .NET command prompt
[Guid("place your guid here")]
public interface IYourInterface
{
string Method1(int param1,string param2);
int Method2(string param1,float param2);
string Method3(string param1);
}
//This class must implement interface above.
//All functions implements this interface must be public
//This number must be unique you can create it using “uuidgen.exe
//in .NET command prompt
[Guid("place your guid here")]
[ClassInterface(ClassInterfaceType.None)]
public class YourClassName : IYourInterface
{
public string Method1(int param1,string param2)
{
//your code
}
public int Method2(string param1,float param2)
{
//your code
}
public string Method3(string param1)
{
//your code
}
}
} //namespace CRUFLNamespace
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
21
3. Ifauserwantstousethenewlycreatedfunctioninareport,heorshemust:
a. Openthecorrectreport.
b. OpentheFormulaEditor.
c.
Goto:Additional Functions } Visual Basic UFLs.
d. Choosethedefinedfunction.
TheCrystalReportsconstructfunctionnameusesthefollowingrules:
TakesNamespace(partafterCRUFL)
AppendsClassname
AppendsfunctionName
Eliminatesanynon-alphanumericcharacters
Thisisasample:
namespace CRUFLNamespace
{
public class Class : IInterface
{
public string Method(string s)
{
}
}
}
Thefunctionconstructedwillhavethename:NamespaceClassMethod.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
22
4 Use Cases
Thefollowingusecasesprovideguidanceintheareaofreportconfigurationandcreationfrom
ablankpage.Apartfromtheflowsdescribedinthischapter,itisalsopossibletousethe
reporttemplateshippedwithDELMIAAprisoinordertocreateareportstartingwithdefault
settings,likestandardparameters,astandardreportheader,andapagefooter.
TheusecasesdescribedinthischapterarebasedonanOracledatabaseandmay
varyforSQLscenarios.
4.1 Configuring an ODBC Connection
CreateanODBC(OpenData-BaseConnection)linkintoWindows:
1. GototheControl PanelandselectAdministrative Tools,thenselectData Sources
(ODBC).Next,gototheSystem DSNtabandselectAprisoReports.
Figure7ODBCDataSourceAdministrator
2. IftheAprisoReportsdatasourcedoesnotexist,clickAddandselecttheproperdriver
namedOracle in [ORACLE_HOME].EnterthedatasourcenameAprisoReports.
3. SelectthecorrectTNSservicenameanduserIDtoconnecttoDELMIAAprisoandclick
theTest Connectionbutton.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
23
Figure8OracleODBCDriverConfiguration
4. Testthedatabaseconnectionusingtheflxuserlogin.
Figure9Testingthedatasourceconnection
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
24
4.2 Creating Crystal Report
1. LaunchtheCrystalReportsapplicationandcreateanewreport:
Figure10Creatinganewreport
2. Createanewdatabaseconnectionanddouble-clickODBC (RDO).
Figure11Creatinganewdatabaseconnection
3. ChooseAprisoReportsfromtheData Sourcelist:
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
25
Figure12Selectingthedatasource
4. Providetheconnectioninformation.
Figure13Enteringtheconnectioninformation
5. Choosethetables(expandTablesandthenchoosePRODUCTandTEXT_
TRANSLATION).
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
26
Figure14Dataview
Figure15SelectedTables
6. Usethepredefinedlinksbetweenthesetwotables.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
27
Figure16Predefinedtablelinks
7. ChoosePRODUCTNOandMEDIUMasthefieldstobedisplayed:
Figure17Addingthefieldstodisplay
8. AddagroupingbyFACILITY:
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
28
Figure18Definingthegroupinginformation
Thepreviewofthereportisasfollows:
Figure19Reportpreview
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
29
Thedesignview:
Figure20Designview
9. Finally,saveasFlexNetListofProduct.rpt.
4.3 Modifying the Report
4.3.1 Adding Crystal Report Parameters
Theparameterstobeadded:
ReportID:String,Defaultvalue=1
LanguageID:Number,Defaultvalue=1033(USEnglish)
TimeZoneID:Number,Defaultvalue=0
ThefirsttwoaremandatoryforanykindofCrystalReportswithdatatranslation.
TheparameterscanbeaddedwiththeuseofFieldExplorer:
Figure21FieldExplorerwindow
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
30
1. AddtheReportIDparameter:
Figure22ReportIDparameter
2. AddtheLanguageIDparameter:
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
31
Figure23LanguageIDparameter
3. AddtheTimeZoneIDparameter:
Figure24TimeZoneIDparameter
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
32
Afteraddingthethreeparameters,theyshouldappearintheFieldExplorer'sparameter
fields:
Figure25ParametersaddedinFieldExplorer
4.3.2 Adding Formula Fields
1. SelectFormula WorkshopfromtheReportmenu.
Figure26SelectingFormulaWorkshop
2. Addanewformulacalledf_Title.
Figure27Addinganewformula
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
33
3. Addatitletranslation:
Figure28Editingthef_Titleformulafield
4. Double-clickthelibrary:
Figure29Libraryview
5. Next,modifythefunctionparametersinthefollowingway:
FlexNetLocalizationLocalizeLiteral ({?ReportID}, 'Title', 'Product Report',
{?LanguageID});
6. Savetheformula.
7. Dragthef_TitledatatotheReportHeadersection.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
34
Figure30Placingthef_Titlefieldinreportheader
8. FormatthetitleusingtheFormat Fieldoptionfromtheright-clickmenu:
Figure31Formatfieldoption
Figure32Fontsettings
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
35
Figure33Formattedreportdesign
9. Previewthereportusingthefollowingvalues:
Figure34Reportvalues
Afterenteringtheconnectioninformationvalues,thereportpreviewwillbedisplayed:
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
36
Figure35Reportpreview
CrystalReportsreturnsalloftheproductcodesfoundinthedatabaseineach
language.
4.4 DELMIA Apriso Configuration
4.4.1 Adding DELMIA Apriso Parameters
Theparameterstobeadded:
Report ID:String,Defaultvalue=1
Language ID:Number,Defaultvalue=1033(English)
CreatetheFlexNetListofProduct.xmlconfigurationfile(withinsamefolderastheRPTfile)
containingthefollowingdata:
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
37
<?xml version="1.0" encoding="utf-8" ?>
<ReportDefinition xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ReportID>FlexNet.Reports.Production.FlexNetListofProduct</ReportID>
<ReportName>FlexNetListofProduct</ReportName>
<ReportVersion>1.0</ReportVersion>
<Parameters>
<Parameter>
<Name>REPORTID</Name>
<LiteralID>Report ID</LiteralID>
<TypeString>Char</TypeString>
<Required>true</Required>
<DefaultValue>1</DefaultValue>
</Parameter>
<Parameter>
<Name>LANGUAGEID</Name>
<LiteralID>Language ID</LiteralID>
<TypeString>Integer</TypeString>
<Required>true</Required>
<DefaultValue>1033</DefaultValue>
</Parameter>
</Parameters>
</ReportDefinition>
4.4.2 Moving RPT and XML Files
Bydefault,reportsandlabelsareexportedtotheReportExportfolder:<server
name>\Program Files\Dassault Systemes\DELMIA Apriso 2020\WebSite\Portal\ReportExport\
CopytheFlexNetListofProduct.rpt andFlexNetListofProduct.xmlfilestothefollowingdirectory
ontheserver:<drive>\Program Files\Dassault Systemes\DELMIA Apriso 2020\Reports Definitions\
4.4.3 Loading Report Administrator
1.
LoadtheReportAdministratorbyfollowingthispath:Administration } System
Administration } Report Administrator.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
38
Figure36LoadingReportAdministrator
2. ChooseReportsfromtheReport typedrop-downlist.
Figure37ReportExplorer
3. EnterFlexNetListofProduct.xmlintheReport/label configuration filefieldand
FlexNetListofProduct.rptintheReport/label definition filefield,andthenclick (Add).
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
39
Figure38Addingreportconfigurationanddefinitionfiles
ThereportwillbeaddedtothesystemanddisplayedintheReportExplorergridontheleft.
4.4.4 Report Testing
1. SignintoDELMIAAprisoandgotoReport Viewer.
Figure39OpeningReportViewer
2. Toviewareport,selectitwiththeuseofReportExplorerontheleft,choosethedesired
outputformat,andclickVieworView in new window:
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
40
Figure40Viewingareport
4.4.5 Data Translation and Local Time Adjustment
1.
Toadjustitems(listofproducts)onselectedlanguage(parameter),clickReport }
Selection Formulas } Record.
Figure41Selectingtherecordeditor
2. AddalinkbetweentheXMLlanguageparameterandTEXT_TRANSLATION:
{TEXT_TRANSLATION.LANGUAGEID}={?LanguageID}
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
41
Figure42RecordSelectionFormulaEditor
Thelastproductupdatewillbetakenasanexampletoinsertlocaltimedata(accordingto
UTCtimedata).
3. Addthenewf_LastUpdateformulafieldinFieldExplorer:
Figure43Addinganewformulafield
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
42
Figure44Enteringtheformulaname
4. EnterthefollowingformulatextinFormulaEditor:
FlexNetLocalizationUTCToLocal({?TimeZoneID},ToText({TEXT_TRANSLATION.LASTUPDATEON}));
Figure45f_LastUpdateOnformulatext
5. DragthenewformulafieldtotheDetailssection:
Figure46Addingaformulatothereportsection
6. Previewthereportandspecifythefollowingparameters:
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
43
Figure47Specifyingthereportparameters
Thefinalversionofthereport:
Figure48Finalversionofthereport
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
44
7. Comparethereportwiththeoriginaldatarecordedonthedatabaseserver(atUTCtime,in
theSpanishlanguage):
Figure49Originaldataonthedatabaseserver
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
45
5 Best Practices
5.1 Report Organization and Style
Reportsareorganizedinsubfolders:
Attendance
Production
Whencreatinganewreport,itisrecommendedthatthetemplatesdeliveredwiththeWeb
ReportingFrameworkinstallationbeused.Thisisbecauseallofthestandardparameters,
reportheaders,andpagefootersaswellasthestandardfontsusedinthereportsarealready
defined.
5.2 Standards
5.2.1 Paper Size and Fonts
UsersshoulduseLetter Paper Sizeinalltheirreports.TheArial MS Unicodefontsize8,9,
or10isacceptable,basedonthedensityofthereport.
5.2.2 Header
Theheadershallbeplacedatthetopofthereportandcontaintwolineswiththefollowing
format:
Line Content Style Font
1 “Company:”+companyname Left,Justified ArialMSUnicodeSize10
1 “RunDate:”+thedatethereportwasrun Right,Justified
2 “Report:”+reportname Left,Justified
Table2Contentsofreportheaders
Additionally,aheadershouldbeenclosedinasingle-linebox.
5.2.3 Footer
Thefootershallbeplacedatthebottomofthepageandcontain:
Line Content Style Font
1 DassaultSystèmescopyrightinformation Left,
Justified
1 Pagexofn Center,
Justified
ArialMSUnicode
Size10
1 “Filteredifafilterhasbeenappliedtothereportor
“Unfiltered”otherwise
Right,
Justified
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
46
Table3Contentsofreportfooters
Thefootershouldhaveasingle-linetopborder.
5.3 Common Mistakes
5.3.1 Binding Reports Statically to One Database
Occasionally,areportcanbedisplayedonlywhenitisconnectedtothedatabasethatauser
declaredwhilecreatingthereportbyusingtheconnectionsetting.Thisoccursbecause
CrystalcreatesSQLqueriesthathaveadatabasenameinthem.TocheckifCrystalhas
createdacorrectSQLquery,userscanselectShowSQLQueryfromthepop-upmenuinthe
Databasemenuandthencheckifthedatabasenameisusedinthatquery.
Tocorrectthis,usershavetoagainsetthelocationforthereport(selectSetLocationfromthe
Databasemenu),selectadifferentODBCconnection,andthenreplacetheoldconnection
withthenewone.
5.3.2 Using Views in Reports
WhenusersuseviewsinareportandtheywanttohavethereportdisplayedontheMSSQL
serverandOracledatabases,thentheymustcreatethereportusinganODBCconnectionthat
isconnectedtoanOracledatabase.Iftheuserhasareportthatusesviews,thenheorshe
mustsetthelocationforthatreporttoanOracleODBCconnection.Iftheuserrunsthatreport
onanOracledatabase,thenitshouldalsoworkfineonMSSQL.
5.3.3 Outer Joins
Ifauserlinkstwotablesusingafieldthatcouldbenullandheorshewouldliketohavedata
returnedifthatfieldisnull,thentheleftjoininsteadoftheinnerjoinshouldbeused.The
reasonforthisisthat,ifaninnerjoinisusedandthatparticularfieldisnull,thenthequery
doesnotreturnarelatedrecord.
Anotherproblemoccurswhenauserwantstofiltertherecordsusingafieldthatcouldbenull.
Example
AuserhasaFACILITYandTEXT_TRANSLATIONleftouterjoinedandwantstofilterrecords
usingTEXT_TRANSLATION.LanguageID(TEXT_TRANSLATION.LanguageID=1033).If
theformulabelowisnotused,thereportwillnotdisplayalloftherecordsthathaveFACILITY
withoutarelatedrowinTEXT_TRANSLATION.Usersshouldinsertthefollowingtextintothe
selectionformula:
IsNull( TEXT_TRANSLATION.LanguageID ) or TEXT_TRANSLATION.LanguageID = 1033
Forotherissuesboundedwithouterjoins,referto5.3.4SelectionFormulas.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
47
5.3.4 Selection Formulas
Ifuserswanttofilteraparticularfieldintheirreportandverifyifitisnullorequalsaspecified
value,thenthefollowingshouldbeused:
( IsNull( {TABLE.Field} ) or {TABLE.Field} = value )
insteadof:
({TABLE.Field}=value
5.3.5 Using Sub-Reports
Inspecificcircumstanceswhenusingsub-reportsinareport,AprisoReportViewerisunable
togenerateareportinanyformatotherthanHTML.Thisoccurswhenthegeneratedsub-
reportsaresupposedtobeblank,buttheSuppressBlankSectionsoptiononasub-reportis
notchecked(ortheformulathatenablesthisoptionisnotactive).
Ifusingsub-reportsinareport,itisessentialtolinkLanguageID,ReportID,orTimeZoneIDtothe
sub-reportparametersiftheyareneededinthesub-report.
Theparameternamesinsub-reportscannotbethesameastheparameternamesin
themainreport.
Sub-reportsmustusethesamedatasourceasthemainreport!Otherwiseanerror
couldoccurduringthereportresave(firstrunontheDELMIAAprisoserver),andthe
reportwouldbeunusable.
Itisnotpossibletocreateasub-reportinasub-report.Evenattemptingtoaddareportwith
sub-reportstoanotherreportwillnotbepossible.Inthiscase,thereportmustbecomposedin
adifferentmanner.
5.3.6 Page Setup – Optimization for Screen Display
InorderforthereportstobecorrectlydisplayedintheReportViewer,theNoPrinteroption
shouldbeselectedonthePageSetupscreen(Figure50NoPrinteroptiononthePageSetup
screen).Withoutthisoptionset,thedefaultprintersettingwillbeusedtorenderthereport,
whichcanresultindisplayingatrimmedreportimage(Figure51Trimmedreportview).
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
48
Figure50NoPrinteroptiononthePageSetupscreen
Figure51Trimmedreportview
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
49
5.4 Optimizing Reports for Exporting to Excel
IfthereportisintendedtobeexportedtoMicrosoftExceldataonly,thencertainoptimization
rulesshouldbeobeyedduringdevelopmentinordertoensurereportcompatibilityandto
maintainconsistentreportstructures.Therearenoofficialguidelinesonhowtoperformsuch
optimization.However,manyunofficialsourcesofferinformationonhowtodealwiththe
subject.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
50
6 Known Issues
Issue with UFLs Being Unregistered upon Crystal Reports Upgrade (Third-
Party Issue)
Problem:
DuringanyCrystalReportsupgradeperformedwhenDELMIAAprisoisalreadyinstalledon
theserver,itmayhappenthattheUserFunctionLibraries(UFLs)areunregisteredandstop
functioning.
Solution:
1. RemoveFlexNet.BusinessRules.Printing.dllfrom<WindowsInstallationDirectory>\assembly(by
deletingitorselecting"uninstall"fromthecontextmenuonthefilewhenopeninWindows
Explorer).
2. Executethefollowingfromthecommandline(replacingthepartsin"<>"withcorrect
values):
<WindowsInstallationDirectory>\Microsoft.NET\Framework\v2.0.50727\]regasm.exe
<FlexNetInstallationDirectory>\setup\gac\flexnet.businessrules.printing.dll
3. AddFlexnet.businessrules.printing.dllto<WindowsInstallationDirectory>\assembly(by
draggingitfromtheWindowsExplorer).Thefileislocatedasspecifiedinstep2.
ThiswillreregistertheUFLsandresolvetheproblem.
Report Display Delay
Problem:
ReportsexecutedinDELMIAAprisoReportViewerintheHTMLversionareloadedand
displayedaftera20-seconddelay.
Solution:
AddthedevelopmentdatabasemachinenametotheWindowshostsfile
(<WindowsInstallationDirectory>\sytem32\drivers\etc\hosts)andmakeitpointtotheproduction
databasemachineontheproductionWebserver.Thisshouldeliminatethe20-seconddelay
asnonamelookupoccursnow.
Issues with ODBC connection on Oracle Database
Problem:
TheremaybeproblemswithCrystalReports11whenusingOracleDBMS.
Solution:
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
51
1. Convertallofthereportfilestothenew"OracleServer"datasource.
2. ModifythereportconnectionparameterssettinginDELMIAAprisoConfigurationManager
(fordetailsonConfigurationManager,refertotheConfigurationManagerHelp).
Formerdatasourcesetting:<ODBC Source name>
Currentdatasourcesetting:<TNSNAME>
Problem with Displaying Crystal Reports Localizable Label Text in the Report
Viewer
Problem:
TheCrystalReportslocalizablelabeltextisnotdisplayedcorrectlyinReportViewer.
Solution:
Makethefollowingchangesintheserver'scontrolpanelRegionalSettings:
1. IftheproblemconcernsEastAsianlanguages,check"InstallfilesforEastAsian
languages"ontheLanguagetab.
2. Selectthedesiredlanguagein"Standardsandformats"ontheRegionalOptionstab(e.g.,
Chinese[PRC]).
3. Check"Defaultuseraccountsettings"ontheAdvancedtab.
4. Restartthecomputer.
Iftheissuepersists,pleaseinstalltheArial Unicode MSfontontheDELMIAAprisoserver
andmakesurethattheDefault app poolhasaccesstothisfont.
Problem with Displaying Reports in Microsoft Word 2013 in Read Mode
Problem:
TheproblemmayoccurwhenusingReportVieweranddisplayingtheReportinMicrosoft
Word (doc)Format.ThereportisdisplayedinReadModebydefaultinMicrosoftWord2013
anditisnotrenderedcorrectly.
Solution:
PressESCtoexitReadMode,thereportwillbedisplayedcorrectly.Alternatively,usea
differentversionofWord.
Problem with displaying an Operation description in PDF reports (Japanese
bold font)
Symptoms
ThesymptomsarevisibleonlywhentheautodocumentationfeatureisusedinDELMIA
AprisoProcessBuilderandthecurrentlanguageisJapanese.ThedescriptionsofaProcess
andanOperationarenotdisplayedcorrectlyinthefollowingreports:DetailedOperation
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
52
DefinitionandDetailedProcessDefinition.ThisonlyhappenswhenthereportisinthePDF
format,thedescriptioncontainsaUnicodefont(suchasJapanese),andthetextisbolded.
Problem Description
Thisisathird-partyissuecausedbybugsintheCrystalReportsframework.
Workaround
Modifythestandardreportsothatitdoesnotusetheboldstyle.
Impacted Area
DELMIAAprisoProcessBuilder
Problem with Printing Crystal Reports from the Report Viewer When 'No
Printer' Option is Enabled (Third-Party Issue)
Problem
Whenyouenablethe'NoPrinter'optiononthePageSetupscreeninCrystalReportsfor
VisualStudio,eventhoughtheprintjobissenttotheprinter,oncertainprintersthereportmay
notbeprintedfromtheReportViewer.
Solution
Ifthereportisnotprinted,makesurethe"NoPrinter"checkboxisunselected.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
53
All the internal documents referenced in this section are available from the DELMIA Apriso
Start page, which can be accessed on your DELMIA Apriso server (<server name>/apriso/start).
The newest versions of all documents are available from 3DS Support at:
https://www.3ds.com/support/documentation/
7 References
Internal Documentation
1. Process of Translation Implementation Guide
Providesanoverviewofthetranslationprocessaswellasbackgroundinformationon
translatingDELMIAAprisocontentandCubeliterals.Theguidefocusesonthelocalization
ofoperationaldatainDELMIAApriso(throughuseoftheDELMIAAprisoLocalization
ManagerandDELMIAAprisoTranslationTool)aswellasontranslatingtheuserinterface
dataandMODELdata.
2. Configuration Manager Help
ProvidesthebackgroundinformationnecessarytousetheDELMIAAprisoConfiguration
Managertoolanddescribeshowtocarryoutcommontasks.
3. Central Configuration Documentation
DescribesindetailallthekeysoftheCentralConfiguration(CC)fileforDELMIAApriso.
Varioussectionsgroupthekeysforindividualmodulesordistinctfunctionalareas.
External Documentation
Alistofexternalresources.
1. Microsoft API and reference catalog
2. Business Intelligence from Business Objects–onlinesupportforCrystalReports
3DS Support Knowledge Base
Ifyouhaveanyadditionalquestionsordoubtsnotaddressedinourdocumentation,feelfreeto
visitthe3DS Support Knowledge Baseathttps://support.3ds.com/knowledge-base/.
Reporting Framework - Crystal Reports | DELMIA Apriso 2020 Technical Guide
54