Depending on the type of application you are deploying, we
will discuss different methods of changing the formatting on your report. For
web applications, you can utilize style sheets used in your web application to
format your report. If you deploy the web application to different servers, the
CSS file can be different formatting on each server. If your reports are going
to be in the same server, I would recommend placing a different aspx file with
the Crystal Viewer for each customer.
For a Windows application there is no out of the box
solution to setting the formatting outside of an application like the CSS file.
We will introduce a way to change the formatting in your windows application
with some custom code in Part 2 of this series.
For our example we start out with a sales report we created
using the Adventureworks database. We will base the report off the view vSalesPersonSalesByFiscalYears.
The sample report displays data by region, then by sales person. The sales show
totals by year, and then grand totals at the bottom. See the SQL used in the
report in Listing 1.
Listing 1
SELECT "vSalesPersonSalesByFiscalYears"."FullName",
"vSalesPersonSalesByFiscalYears"."SalesTerritory",
"vSalesPersonSalesByFiscalYears"."2002", "vSalesPersonSalesByFiscalYears"."2003",
"vSalesPersonSalesByFiscalYears"."2004"
FROM "AdventureWorks"."Sales"."vSalesPersonSalesByFiscalYears"
"vSalesPersonSalesByFiscalYears"
ORDER BY "vSalesPersonSalesByFiscalYears"."SalesTerritory",
"vSalesPersonSalesByFiscalYears"."FullName"