From what you've wrote I assume you have little experience with preparing reports. You are mentioning Crystal Reports, but let me suggest to take a look at what the good old MS Word can do for you. One nice thing about MS Word is that you can prepare a template document and format it as needed. Then put placeholders into it where you want your data to appear.
In your .NET application you then read the data from your database into .NET data objects or XML. The last step is to merge the data and the template. Take a look at these
examples to learn more. And here is some code, to help you get started (the data is read from the database using Entity Framework):
using Docentric.Documents.Reporting;
using System;
using System.Collections.Generic;
using System.Linq;
namespace clientReport
{
class Program
{
static void Main(string[] args)
{
using (var context = new clientsEntities())
{
string templateDocument = @"C:\Temp\ClientsTemplate.docx";
string finalDocument = @"C:\Temp\ClientsReport.docx";
ClientLst cl = new ClientLst();
cl.Data = new List<ClientOutput>();
var q = context.Clients.ToList<Client>();
foreach (Client c in q)
{
ClientOutput co = new ClientOutput();
co.Cid = c.C_ID;
co.Name = c.Name;
co.Address = c.Address;
co.City = c.City;
co.Email = c.Email;
co.Picture = c.Picture;
cl.Data.Add(co);
}
Console.WriteLine("Count of records read ..." + cl.Data.Count.ToString());
DocumentGenerator dg = new DocumentGenerator(cl);
DocumentGenerationResult result = dg.GenerateDocument(templateDocument, finalDocument, SaveOptions.Pdf);
Console.Write("Press any key to continue ...");
Console.ReadKey();
}
}
}
public class ClientOutput
{
public int Cid { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string Email { get; set; }
public byte[] Picture { get; set; }
}
public class ClientLst
{
public List<ClientOutput> Data { get; set; }
}
}
This code reads the data from the database, fills .NET data objects (ClientOutput and ClientList) and generates the final document as plain MS Word docx file (other supported output formats are pdf, xps and image). You can see that the code is very simple, yet powerful.