By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,908 Members | 2,055 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,908 IT Pros & Developers. It's quick & easy.

Crystal Report with parameter problem -Pls help

P: n/a
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 .
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.. I have also used the post back method
but gives an error that object Report document not instantiated.


private void Page_Load(object sender,System.EventArgs e)
{
(if(!Page.IsPostBack)

string reportname= "C:\ReportWithParameter.rpt"
LoadReportName(reportname)
)

}
private void LoadReport(string reportName)

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

CrystalDecisions.CrystalReports.Engine.ParameterFi eldDefinitions
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

--
Message posted via http://www.dotnetmonster.com
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Kapil,

From your code, I can't find ReportDocument load twice.
Could you give more info?

Elton Wang
el********@hotmail.com

-----Original Message-----
Hello everybody,
I am trying to create a web application to generate Crystal Report withParameters. However I noticed that
ReportDocument.Load is used twice when the parameter page is loaded .1) The first time ReportDocument.Load is used when the Crystal Report isloaded and the parameter page is created.
2) The second time the ReportDocument.Load is again used when the userenters the parameters in the parameters page.
My problem is I do not want the ReportDocument.Load to be used twice alongwith the Parameter table . Would be greatful if anyone can help me with anysolution. The code is written below.. I have also used the post back methodbut gives an error that object Report document not instantiated.

private void Page_Load(object sender,System.EventArgs e)
{
(if(!Page.IsPostBack)

string reportname= "C:\ReportWithParameter.rpt"
LoadReportName(reportname)
)

}
private void LoadReport(string reportName)

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

CrystalDecisions.CrystalReports.Engine.ParameterF ieldDefin itionscrParamFieldDefinitions = 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

--
Message posted via http://www.dotnetmonster.com
.

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.