English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi i am vijay shankar. working as a software developer in .net.
i am facing a big problem with crystal reports.
at present we are creating static crystal reports and binding directly with dataset.the design and all we are doing static. any knows how to do this in dynamic. means by coding how we can place the objects in report.
thx in advance

2007-04-27 02:14:09 · 3 answers · asked by VIJAYASHANKAR P 1 in Computers & Internet Programming & Design

3 answers

//Create a datset
DataSet ds;
ds = new ReportDAL().GetData();

//Create report document
private ReportDocument objRepDoc = null;
objRepDoc = new ReportDocument();
objRepDoc.Load(Server.MapPath("Reports/ReleaseNotes.rpt"));
objRepDoc.SetDataSource(ds);
crvReport.ReportSource = objRepDoc;
crvReport.DisplayGroupTree = false;
crvReport.EnableToolTips = false;

I hope this will help you....

2007-04-27 02:21:54 · answer #1 · answered by kedarnath c 2 · 0 0

I do it here this is .net 2.0. Now I created a dataset in my project to help design the report. But I never use the dataset because I generate it on the fly if you will also.

Generates a report on the fly.


protected void btnGenerate_Click(object sender, EventArgs e)
{
if (validateEntries())
{
lblError.Text = "";

CrystalDecisions.CrystalReports.Engine.ReportDocument doc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

doc.Load(Server.MapPath("reports/tipReport.rpt"));

DataTable dt = Business.getReportData(ddReportTypes.SelectedValue, Request.Form["myDateField"]);

doc.SetDataSource(dt);
CrystalDecisions.Shared.ExportFormatType export = CrystalDecisions.Shared.ExportFormatType.HTML32;

switch (ddFormat.SelectedIndex)
{
case 0:
export = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
break;
case 1:
export = CrystalDecisions.Shared.ExportFormatType.Excel;
break;
case 2:
export = CrystalDecisions.Shared.ExportFormatType.ExcelRecord;
break;
case 3:
export = CrystalDecisions.Shared.ExportFormatType.RichText;
break;
case 4:
export = CrystalDecisions.Shared.ExportFormatType.WordForWindows;
break;
}
doc.ExportToHttpResponse(export, Response, true, ddResurants.SelectedItem+"_"+ddReportTypes.SelectedItem+"_"+Request.Form["myDateField"].Replace('/','-') + "_report");

}
}

2007-04-27 02:31:29 · answer #2 · answered by Anonymous · 0 0

Go to the web site and read through the Forums and the FAQ's.

2007-04-27 02:17:29 · answer #3 · answered by ELfaGeek 7 · 0 1

fedest.com, questions and answers