Drilldown Reports
Posted: Tue May 27, 2008 7:27 am
Hi All
I have one report that, when I click on a Component I open a new report.. Here are the code
public override void OnPrepare()
{
this.Cursor = Cursors.WaitCursor;
// Selection
StringBuilder sel = new StringBuilder();
sel.Append("Cashbook: " + this.CBook.Text + "; ");
sel.Append("Year no: " + YearNo.Value.ToString() + "; ");
sel.Append("Period no" + this.PeriodNo.Value.ToString());
General_Ledger_Casbook Rep = new General_Ledger_Casbook();
StiPostgreSQLDatabase db = (StiPostgreSQLDatabase)Rep.Dictionary.Databases[0];
db.EditConnectionString(DAL.ConString);
Rep["CpyFP"] = Company.Value.ToString();
Rep["CpyID"] = Company.Text;
Rep["CBookFP"] = this.CBook.Value.ToString();
Rep["YrNo"] = Convert.ToInt32(YearNo.Value);
Rep["PerNo"] = Convert.ToInt32(this.PeriodNo.Value);
Rep["Selection"] = sel.ToString();
Rep["User"] = UserDD.UserFullName;
Rep.Click += new EventHandler(GLCBook_Click);
Rep.Show();
this.Cursor = Cursors.Default;
}
#region GLCBook_Click
void GLCBook_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
StiComponent Comp = sender as StiComponent;
string Fingerprint = (string)Comp.TagValue;
if (Fingerprint != null)
{
General_Ledger_Cashbook_Details Rep = new General_Ledger_Cashbook_Details();
//StiPostgreSQLDatabase db = (StiPostgreSQLDatabase)Rep.Dictionary.Databases[0];
//db.EditConnectionString(DAL.ConString);
Rep["CpyID"] = Company.Text;
Rep["CBookID"] = this.CBook.Text;
Rep["Fingerprint"] = Fingerprint;
Rep["User"] = UserDD.UserFullName;
Rep.Show();
}
this.Cursor = Cursors.Default;
}
#endregion
Every thing work fine, excep when I uncomment this...
//StiPostgreSQLDatabase db = (StiPostgreSQLDatabase)Rep.Dictionary.Databases[0];
//db.EditConnectionString(DAL.ConString);
in "void GLCBook_Click(object sender, EventArgs e)" the New report display Progress Dialog and just hang. Other wyse it works fine.
I have one report that, when I click on a Component I open a new report.. Here are the code
public override void OnPrepare()
{
this.Cursor = Cursors.WaitCursor;
// Selection
StringBuilder sel = new StringBuilder();
sel.Append("Cashbook: " + this.CBook.Text + "; ");
sel.Append("Year no: " + YearNo.Value.ToString() + "; ");
sel.Append("Period no" + this.PeriodNo.Value.ToString());
General_Ledger_Casbook Rep = new General_Ledger_Casbook();
StiPostgreSQLDatabase db = (StiPostgreSQLDatabase)Rep.Dictionary.Databases[0];
db.EditConnectionString(DAL.ConString);
Rep["CpyFP"] = Company.Value.ToString();
Rep["CpyID"] = Company.Text;
Rep["CBookFP"] = this.CBook.Value.ToString();
Rep["YrNo"] = Convert.ToInt32(YearNo.Value);
Rep["PerNo"] = Convert.ToInt32(this.PeriodNo.Value);
Rep["Selection"] = sel.ToString();
Rep["User"] = UserDD.UserFullName;
Rep.Click += new EventHandler(GLCBook_Click);
Rep.Show();
this.Cursor = Cursors.Default;
}
#region GLCBook_Click
void GLCBook_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
StiComponent Comp = sender as StiComponent;
string Fingerprint = (string)Comp.TagValue;
if (Fingerprint != null)
{
General_Ledger_Cashbook_Details Rep = new General_Ledger_Cashbook_Details();
//StiPostgreSQLDatabase db = (StiPostgreSQLDatabase)Rep.Dictionary.Databases[0];
//db.EditConnectionString(DAL.ConString);
Rep["CpyID"] = Company.Text;
Rep["CBookID"] = this.CBook.Text;
Rep["Fingerprint"] = Fingerprint;
Rep["User"] = UserDD.UserFullName;
Rep.Show();
}
this.Cursor = Cursors.Default;
}
#endregion
Every thing work fine, excep when I uncomment this...
//StiPostgreSQLDatabase db = (StiPostgreSQLDatabase)Rep.Dictionary.Databases[0];
//db.EditConnectionString(DAL.ConString);
in "void GLCBook_Click(object sender, EventArgs e)" the New report display Progress Dialog and just hang. Other wyse it works fine.