Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Crystal Reports With MS Access

Status
Not open for further replies.

SGLong

Programmer
Jun 6, 2000
405
US
I have a web-site that I've developed using MS Access that I'd like to add some reporting capability to. The few that I've done so far are "printer friendly" html pages, but they end up looking odd depending upon the browser and version viewing them. From this forum it's clear that Crystal is a better solution.

I'm using ASP.Net 1, and have never used Crystal Reports before. Can somebody refer me to a good book that would help me get the reports up and running quickly?

Steve
 
crystal is similar to access reports. I think crystal processes the records differently behind the scenes. but that's only an issue if the report has complex forumlas and variables.

i find the crystal viewer to be awkward and cumbersome for end uesers. Instead I use ReportDocument.ExportToStream(Type.PDF); this will stream a pdf document to the browser. I find this a better solution because the user gets the power of AdobeReader for searching, saving, printing ...

I also like to push data to reports using datasets, rather than pulling data from inside the report. my reasons for this approach:
1. easy to switch between data sources (local, dev, staging, production).
2. crystal is really slow at fetching, sorting, filtering records. ADO.Net is much faster.

when viewing the reports on the web I use ashx instead of aspx. they are HttpHandlers and don't require the overhead of a webform. pesudo code looks like this
Code:
protected ProcessRequest(HttpContext context)
{
   //use context.Request.QueryString to get parameters
   //or context.Session
   DataSet data = //fetch data with parameters;
   ReportDocument rpt = new ReportDocument();
   rpt.Load(path to report file);
   rpt.SetParameter(name, value);
   rpt.SetParameter(name, value);

   context.Response.Buffer;
   context.Response.ContentType = "application/pdf";
   context.Response.AddHeader= ("Content-Disposition","attachment;filename=myreport.pdf");
   context.Response.WriteStream(rpt.ExportToStream(Type.PDF));
   context.Flush();
   context.End();
}

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top