Report Information
Description Report Title: Form Letter
Report Author: George Peck
Report Comments: Form letter demonstrating several techniques used for text and formula manipulation
Converted By: Crystal Migration Services, support@crystalmigrater.com
Data Sources
DataSource1
Name DataSource1
Connection String DSN=Xtreme Sample Database 11.5;
Data Provider ODBC
Datasets
DataSet1
Name DataSet1
Query
Data Source DataSource1
CommandText
SELECT Customer.[Customer Name], Customer.[Contact First Name], Customer.[Contact Last Name], Customer.[Contact Title], Customer.Address1, Customer.[Contact Position], Customer.City, Customer.Region, Customer.[Postal Code], Customer.[Last Year's Sales], Customer.Address2, Customer.Country
FROM Customer Customer
WHERE ((Customer.Country = 'USA') OR (Customer.Country = 'Japan') OR (Customer.Country = 'China') OR (Customer.Country = 'Canada') OR (Customer.Country = 'France') OR (Customer.Country = 'Italy') OR (Customer.Country = 'Australis'))
Parameters
Fields
Customer_Name
Name Customer_Name
Source [Customer Name]
Data Type String
Contact_First_Name
Name Contact_First_Name
Source [Contact First Name]
Data Type String
Contact_Last_Name
Name Contact_Last_Name
Source [Contact Last Name]
Data Type String
Contact_Title
Name Contact_Title
Source [Contact Title]
Data Type String
Address1
Name Address1
Source Address1
Data Type String
Contact_Position
Name Contact_Position
Source [Contact Position]
Data Type String
City
Name City
Source City
Data Type String
Region
Name Region
Source Region
Data Type String
Postal_Code
Name Postal_Code
Source [Postal Code]
Data Type String
Last_Year_s_Sales
Name Last_Year_s_Sales
Source [Last Year's Sales]
Data Type Decimal
Address2
Name Address2
Source Address2
Data Type String
Country
Name Country
Source Country
Data Type String
Embedded Images
Picture_913956714AE9BFC85EE1F1434D4FBA95
Name Picture_913956714AE9BFC85EE1F1434D4FBA95
Type jpeg
Custom Code
Public Function Sales_Goal (ByVal dbField9 As Decimal) As Decimal
Dim Goal As Decimal
Select Case dbField9
Case 0 to 10000
Goal = ((dbField9 * 1.2) + 25000)
Case 10001 to 25000
Goal = ((dbField9 * 1.15) + 25000)
Case 25001 to 50000
Goal = (dbField9 * 1.25)
Case Else
Goal = (dbField9 * 1.15)
End Select
End Function
Body
Report Items
RectDetailSection1
Name RectDetailSection1
Type Rectangle
PrintDate1
Name PrintDate1
Type Text Box
Content =Format(Globals.ExecutionTime, "MMMM d, yyyy")
Customer_Name
Name Customer_Name
Type Text Box
Content =Fields!Customer_Name.Value
Address1
Name Address1
Type Text Box
Content =Fields!Address1.Value
ContactName1_Contact_Name
Name ContactName1_Contact_Name
Type Text Box
Content =(((((Fields!Contact_Title.Value & " ") & Fields!Contact_First_Name.Value) & " ") & Fields!Contact_Last_Name.Value) & ", ") & Fields!Contact_Position.Value
Picture1
Name Picture1
Type Image
Source Type Embedded Image Name
Embedded Image Name Picture_913956714AE9BFC85EE1F1434D4FBA95
RectDetailSection2
Name RectDetailSection2
Type Rectangle
Address2
Name Address2
Type Text Box
Content =Fields!Address2.Value
RectDetailSection3
Name RectDetailSection3
Type Rectangle
CityStateZip1_City_State_Zip
Name CityStateZip1_City_State_Zip
Type Text Box
Content =(((Fields!City.Value & ", ") & Fields!Region.Value) & " ") & Fields!Postal_Code.Value
Salutation1_Salutation
Name Salutation1_Salutation
Type Text Box
Content =((("Dear " & Fields!Contact_Title.Value) & " ") & Fields!Contact_Last_Name.Value) & ","
RectDetailSection6
Name RectDetailSection6
Type Rectangle
Text3
Name Text3
Type Text Box
Content =("Thanks for purchasing " & (Format (Fields!Last_Year_s_Sales.Value, "#,##0"))) & " in merchandise last year." We truly appreciate your business, and trust that you found the quality of XTREME products to meet your expectations in every way.
However, we are concerned that orders from =Fields!Customer_Name.Value didn't meet our coordinated goal of at least $25,000 last year.
We think that our products speak for themselves. And, we think when you look carefully at our line of high quality bicycles and accessories, you'll find that your customers will be happiest with XTREME products as well. So, as an incentive to increase sales of XTREME products in the coming year, we're doing two things:
FExtending =Fields!Customer_Name.Value a 15 percent discount on new orders between now and the end of the year.
FHolding a special gift with =IIF ((Right(Fields!Contact_Last_Name.Value, 1) = "s"), (((((Fields!Contact_Title.Value & " ") & Fields!Contact_First_Name.Value) & " ") & Fields!Contact_Last_Name.Value) & "'") , (((((Fields!Contact_Title.Value & " ") & Fields!Contact_First_Name.Value) & " ") & Fields!Contact_Last_Name.Value) & "'s")) name on it. As soon as sales this year exceed our agreed-upon goal of =Code.Sales_Goal (Fields!Last_Year_s_Sales.Value), we'll put this gift right in the mail to you!
Together, we can work harder this year to not only improve our business relationship, but to provide your customers with the most fun, state-of-the-art, and reliable products in the industry!
RectDetailSection4
Name RectDetailSection4
Type Rectangle
Text4
Name Text4
Type Text Box
Content =("Thanks for purchasing " & (Format (Fields!Last_Year_s_Sales.Value, "#,##0"))) & " in merchandise last year." We truly appreciate your business, and trust that you found the quality of XTREME products to meet your expectations in every way.
Not only did you exceed our common $25,000 goal for last year, but you helped "spread the word" on XTREME quality and value.
We think that our products speak for themselves. And, we're glad that =Fields!Customer_Name.Value recognizes this and passes the enthusiasm on to your customers. As thanks for your help in making last year the most successful in XTREME history, we're doing two things:
FExtending =Fields!Customer_Name.Value a 10 percent discount on new orders between now and the end of the year.
FPutting in the mail a special gift with =IIF ((Right(Fields!Contact_Last_Name.Value, 1) = "s"), (((((Fields!Contact_Title.Value & " ") & Fields!Contact_First_Name.Value) & " ") & Fields!Contact_Last_Name.Value) & "'") , (((((Fields!Contact_Title.Value & " ") & Fields!Contact_First_Name.Value) & " ") & Fields!Contact_Last_Name.Value) & "'s")) name on it. Look for it to arrive on your doorstep soon!
But, we're not resting here. We have aggressive goals for rolling out new, innovative products for the coming year. And, we are sharing our aggressive sales goals with our most successful dealers. We plan on working hard with you to attain sales of =Code.Sales_Goal (Fields!Last_Year_s_Sales.Value) during the coming year. Together, we can work harder this year to not only improve our business relationship, but to provide your customers with the most fun, state-of-the-art, and reliable products in the industry!
RectDetailSection5
Name RectDetailSection5
Type Rectangle
Text5
Name Text5
Type Text Box
Content Again, =Fields!Contact_First_Name.Value, thank you so much for your support and confidence in XTREME Mountain Bikes during the previous year. We're looking eagerly forward to continuing our great relationship into the future.
Sincerely,
Text1
Name Text1
Type Text Box
Content Andrew Fuller
Vice President, Sales
Data Regions
Tablix1
Name Tablix1
Type Table
Row Member 1
Details
Name Details
Row Member 1
Row Member 2
Row Member 3
Source Dataset DataSet1