We covered how to customize reports displayed in web
applications in Part 1. In Part 2 we will cover how to implement something
similar for your Windows Form application. Crystal Reports .NET includes the
ability to use CSS style sheets for your web application. Unfortunately there
is no built in ability to use something similar to CSS Style sheets in your WinForm
application.
To implement something similar to a style sheet, our
examples involve using custom XML file to describe the formatting for your
reports. Our WinForm application uses a custom function to apply the formatting
specified in the XML file to our Report. Listing 1 shows the SQL syntax used in
our report. We use the Adventureworks database and tables to create a sales
report. Once we have the report that we want to display, now we need to change
the formatting in our windows application.
Listing 1
SELECT "vSalesPersonSalesByFiscalYears"."FullName",
"vSalesPersonSalesByFiscalYears"."SalesTerritory",
"vSalesPersonSalesByFiscalYears"."2002", "vSalesPersonSalesByFiscalYears"."2003",
"vSalesPersonSalesByFiscalYears"."2004"
FROM "AdventureWorks"."Sales"."vSalesPersonSalesByFiscalYears"
"vSalesPersonSalesByFiscalYears"
ORDER BY "vSalesPersonSalesByFiscalYears"."SalesTerritory",
"vSalesPersonSalesByFiscalYears"."FullName"