ReportDocument.Load

  • Thread starter Kapil Shah via DotNetMonster.com
  • Start date
K

Kapil Shah via DotNetMonster.com

Hello everybody,
I am trying to create a web application to generate Crystal Report with
Parameters. However I noticed that
ReportDocument.Load is used twice when the parameter page is loaded for the
first time and then again when the user enters the parameters in the
parameters page.
1) The first time ReportDocument.Load is used when the Crystal Report is
loaded and the parameter page is created.
2) The second time the ReportDocument.Load is again used when the user
enters the parameters in the parameters page.
My problem is I do not want the ReportDocument.Load to be used
twice along with the Parameter table . Would be greatful if anyone can help
me with any solution. The code is written below..


private void Page_Load(object sender,System.EventArgs e)
{
string reportname= "C:\ReportWithParameter.rpt"
LoadReportName(reportname)
}


private void LoadReport(string reportName)

{
crDoc=new CrystalDecisions.CrystalReports.Engine.ReportDocument();
crDoc.Load(reportName);

CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinitions
crParamFieldDefinitions =
crDoc.DataDefinition.ParameterFields;


// create the table to hold the controls
Table table = new Table();
table.Width = 300;
table.BorderWidth=1;
table.BackColor = Color.LightGray;
table.BorderColor = Color.Gray;
table.CellSpacing = 10;
// table.GridLines = GridLines.Horizontal;
string paramName;

TableRow
summaryRow = new TableRow();
TableCell summaryCell = new TableCell();


ParamTable.Rows[0].Cells[0].Controls.Add
(table);

Session["Report"] = crDoc;
}

}


Pls guide...

Rahil















}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top