WhatYouNeedtoUseThisBookTherearesoftwareandknowledgerequirementsforyoursuccessfulprogressthroughthisbook.Software❑MicrosoftWindows2000orXPProfessional❑VisualStudio.NETProfessionalorhigher❑SQLServer2000orMSDEKnowledge❑SomeknowledgeoftheVisualStudio.NETdevelopmentenvironmentisassumed❑SomeverybasicknowledgeofSQLisassumedSummaryofContentsIntroduction1Chapter1:CrystalReports.NETOverview9Chapter2:GettingStartedwithCrystalReports.NET33Chapter3:ReportIntegrationforWindows-BasedApplications79Chapter4:ReportIntegrationforWeb-BasedApplications113Chapter5:CreatingXMLReportWebServices151Chapter6:Workingwith.NETData167Chapter7:FormulasandLogic201Chapter8:WorkingwiththeCrystalReportsEngine233Chapter9:DistributingYourApplication267AppendixA:Troubleshooting285AppendixB:MigratingApplicationstoCrystalReports.NET295AppendixC:Crystalvs.BasicSyntax309Index315ReportIntegrationforWeb-BasedApplicationsWhileWindowsapplicationswillstillcontinuetobepopularforsometimetocome,thegrowingtrendinapplicationdevelopmentisforweb-basedapplications.Inthischapter,wearegoingtolookathowtointegrateandviewreportsfromwithinweb-basedapplicationscreatedwithVisualStudio.NET.Inaddition,wewilllookatsomeoftherun-timecustomizationsthatcanbemadetoyourreports,aswellassomeissuesaroundwebapplicationdeployment.Thiswillconsistof:❑DeterminingthecorrectObjectModel❑CrystalDecisions.Webnamespace❑UsingtheCrystalWebFormsViewer❑CustomizingtheCrystalWebFormsViewer❑PassinginformationtotheWebFormsViewerAswegothroughthischapter,wewillbebuildingformsforuseinweb-basedreportingapplications,whichdemonstratemanyoftheCrystalReports.NETfeaturesthatcanbeusedinyourownwebapplications.ObtainingtheSampleFilesAlltheexamplereportsandcodeusedinthischapterareavailablefordownload.Thedownloadfilecanbeobtainedfrom(andifyouaren't,yousoonwillbe!).ASP.NETisnotreallyalanguage,perse,butratherasetofinterrelatedtechnologiesandcomponentsthatcometogetherinoneframeworktodeliverrobustwebapplications.Asadeveloper,youprobablyalreadyknowthatthemostimportantpartofcreatinganapplicationisintheplanninganddesignoftheapplication,beforethecodingactuallystarts.TheintegrationofCrystalReportsintowebapplicationsisnodifferent–alittlebitofplanninggoesalongway.Thefirstthingwewillneedtodo,beforewewriteasinglelineofcode,istodeterminewhattypeofreportswewanttodeliverinourwebapplicationandhowtheyaregoingtobeused.Aretheylistingorgroupedreports?Aretheyusedtocheckdataentryinaformbeforesubmittingit?Whatwillthereportslooklike?WilluserswanttoprintthereportsfromtheirbrowserorexporttoanotherformatsuchasPDF,RTF,orExcel?Allofthesequestionscanhelpyougathertheinformationyouneedtodesignyourreportsandgetahandleonhowtheyaregoingtobedelivered.Note:Evenifyoudon'thaveyourownreportstoworkwith,youcanstillworkthroughthischapter–samplereportsareavailableinC:\ProgramFiles\VisualStudio.NET\CrystalReports\Samples\orinthedownloadfilesforthischapter.Onceyouunderstandthetypeoffunctionalityyouwouldliketodelivertotheuser,youcansitdownandstartplanninghowCrystalReportswillbeintegratedintoyourwebapplication.CrystalReports.NETusesafeature-richreportviewer,availableoutofthebox,whichcanbeinsertedontoaWebFormandusedtoviewreports.ThevieweritselfhasfeaturesthataresimilartotheWindowsformviewerandhasanextensiveobjectmodel,allowingyoutosetthesourceofthereport,theappearanceofthevieweritself,andwhathappenswhendifferenteventsfire,amongotherthings.Whenworkingwithwebapplications,mostusersseemtopreferthatwepopupanadditionalwindowtodisplayreports.ThisallowsthemtohavethefullbrowserareatoviewthereportandwecanpasspropertieslikethereportsourceandviewersettingstothisWebForm.Thisallowsustoreuseonereportviewingformthroughoutthewebapplicationandjustsetthepropertiesweneedeachtime.Theoptionsforworkingwithreportsareendless–basedonauser'saccessrightsinyourapplication,youcouldsetaspecificrecordselectionformulaorallowtheusertosetandretainparameterstheyusefrequently,orevenestablishprofilesoftheirfavoritereports,sotheycanrunitwithalloftheirsettingsinplacewithoneclick.ReportIntegrationforWeb-BasedApplications115LikeintegratingreportingintoWindowsapplications,thereportintegrationshouldbedrivenbytheuser'srequirements,buthowthesefeaturesaredeliveredisuptoyou.Asyougothroughtherestofthechapter,thinkabouthowthedifferentcustomizationfeaturescouldbeusedinyourdevelopment.Ifyouarenotatapointwhereyoucanintegratethesefeaturesintoyourapplication,eachoftheproperties,methods,andeventsaregroupedtogetherbyfunctiontomakeiteasiertocomebackandlookthemup.ABriefHistoryofCrystalW