Wednesday, July 11, 2007

ASP.NET Crystal Report

1. Create the Crystal Report Page
A. You may need to modify your code to deal with a password.
B. Print showing filtered selection from drop down list.
2. Create the following Crystal Report using the Crystal Viewer:
A. Invoices View grouped on Salesperson: Total on Extended Price
B. Executive Leading break format (wizard)
C.
D. Tips: use the wizard to format most of the report.
1. Note the date, currency and heading
2. Place the initialization code in Page_Init
E. Some helpful code
Public Sub InitCRV()
'**called from page_init in top hidden region
Dim crReport As New Sales2
crReport.SetDatabaseLogon("sa", "password")
With crViewer
.ReportSource = crReport
.DisplayGroupTree = False
End With
End Sub
3. Create the following Crystal Report by writing to a PDF file
A. Add a PDFCache folder to your project and set permission ASPNET =
Modify
B. Add routine to clear the PDFCache of reports over 1 day old
Page 1
C. Modify drop down list to include all sales people with the first item being
1. “”
D. Modify the click event to ensure that a salesperson is selected
E. Clearing check box will suppress detail.
F. Extra Credit: Show only the report
1. Suppress PDF Viewer Interface including Toolbars and tabs (as much as
possible)
2. Suppress the browser interface
G.
H. 1.
A. Print the new Main Page after both new user controls have been added
B. Print the DropDownList UserControl
1. Highlight the Event Declaration(s) and where you raise the event(s) in
your code…
Page 2
C. Print the code and results of your test page
5. Add a User Control named Header.asc
A. 1.
C. Expose the following properties / labels in the code behind.
1. Title (label), Home (hyperlink), Path (label), User (label),
Public WriteOnly Property Title() As String
Set(ByVal Value As String)
lblTitle.Text = Value
End Set
End Property
Public WriteOnly Property Path() As String
Set(ByVal Value As String)
lblPath.Text = Value
End Set
End Property
Public WriteOnly Property User() As String
Set(ByVal Value As String)
lblUser.Text = Value