Title: Adrotator CrystalReport
1Adrotator CrystalReport
- Objective
- Crystal Report ASP .net
- Dynamic Crystal Report using dataset returned by
parameterized query - Advertisement Banner with Adrotator
2Crystal Report (ASP)
- Steps to create a crystal report
- Add a Crystalreportview to webform
- Add a new item crystalreport and
- Configure and design the crystalreport tabs
- Connect the Crystalreportview to the
Crystalreport
3Crystal Report (ASP)
- Add a new item? Choose Crystal Report
- Choose Report Expert.
- Configure as follows
4Crystal Report
- Data Choose OLE DB (ADO) ? Jet 4.0 _? Choose
the Database.
5Crystal Report Example
- Data
- Insert Tables-
- Choose Category
- Course
6Crystal Report Example
- Link (leave as default) click next
- Fields Choose the fields from the 2 tables
7CR - Group
- Group report grouped in sections
- Grouped by CategoryCode in ascending order
8CR - Total
- Total Choose Capacity and Fee, select
- summary type Sum
9CR Chart
- Chart Click Data-Tab to choose chart placement
Header or Footer.
10Adding Formula fields
- In Field-explorer, Rightclick Formulae Field
choose New to add a calculated field Here we
choose courseFee .9
11CR Formula Fields
- To re-enter the Report-Expert rightclick the
empty space in detail section of report. - Drag the DiscountFee field onto the
Details-section of report-designer.
12Connecting Crystalreportviewer
- Connecting Crystalreportviewer to Crystal report
in the program. - In page_load sub
- CrystalReportViewer1.ReportSource
Server.MapPath("CrystalReport1.rpt") - If Not Page.IsPostBack Then
- Me.CrystalReportViewer1.DataBind()
- End If
13Moving Web-Crystal report(CR)
- When you move webapplications with crystal
report. You need to reconnect the database for
both the webapplication and crystal report
separately. To reconnect the database for CR - Rightclick Database Field and
- Choose Set Location. Create
- new connection and
- choose Replace.
- (replacing the old
- database)
14Dynamic Crystal Report
- To create dynamically generated CR, you need to
connect the CR to dataset with parameterized
query. Use Project Data dscourse -Course
15Dynamic Crystal Report
- Design the other CR designer Tabs as before. But
choose all fields from dscourse. - Modify your webform dataadapter (dbcourse) by
adding parameterized select statement. E.g. - select from course where (catcode ?)
16Dynamic CR - SetDataSource
- Create a dataadapter with parameterized query
- Fill the dataset using the dataadapter
- dbCourse.SelectCommand.Parameters(0).Value
_ "SPORTS" - dbCourse.Fill(Me.DsCourse1)
- Dynamically set the datasource of your CR
(objreport) to the dataset e.g. - Dim objreport As New CrystalReport2
- objreport.SetDataSource(Me.DsCourse1)
- CrystalReportViewer1.ReportSource objreport
-
17Adrotator
- Advertisement banner can be accomplished using
the control Adrotator. - Set the Adrotator.Advertisementfile
XMLfile1.xml - The Advert-xml-file contains
- The ImageURL -
- ltImageUrlgtParadise.jpglt/ImageUrlgt
- The NavigateURL to redirect page
- ltNavigateUrlgthttp//www.paradiselost.co.uk/lt/Navi
gateUrlgt - lt!-- The alternate text for the image --gt
- ltAlternateTextgtVisit Microsoft's
Sitelt/AlternateTextgt -
18Adrotator Example
lt?xml version"1.0" encoding"utf-8" ?gt
ltAdvertisementsgt ltAdgt lt!-- The URL for the ad
image --gt ltImageUrlgtParadise.jpglt/ImageUrlgt lt!
-- The URL the ad redirects the user to
--gt ltNavigateUrlgthttp//www.paradiselost.co.uk/lt
/NavigateUrlgt lt!-- The alternate text for the
image --gt ltAlternateTextgtVisit Microsoft's
Sitelt/AlternateTextgt lt!-- The relative number
of times this ad should appear --gt lt!--
compared to the others --gt ltImpressionsgt80lt/Impr
essionsgt lt!-- The topic of this ad (used for
filtering) --gt ltKeywordgtProductInfolt/Keywordgt lt
/Adgt ltAdgt lt/Adgt