Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difficult reporting problem Active Reports for .Net

Status
Not open for further replies.

LauraCairns

Programmer
Jul 26, 2004
173
GB
I am using Active Reports for .Net to produce reports which are displayed in aspx pages in the browser window. I have a problem though displaying parts of my reports in the browser windows.
Does anyone know how to write code which makes a checkbox property true whenever a selected field in a database select statement =1. I am running reports which are populating textboxes from the result of a complex select statement. My problem is that I would like one or two of the flag fields to be displayed with a tick in a checkbox when there value =1. At present the value 1 is just being displayed in a textbox and it doesn't look very good to the user. A checkbox ticked would look much better and more professional. I need to be able to do this in code as well. Im guessing this could be quite tricky as there are no examples in the notes or anything. Could someone help me do this please.
Attached is a copy of the report which I am hoping to do this in. This might give you a better idea what I mean.
 
I am just guess but I would look at the Detail Format event.

Code:
    Private Sub Detail_Format(ByVal sender As Object, ByVal e As System.EventArgs) Handles Detail.Format

Hope everyone is having a great day!

Thanks - Jennifer
 
I tried the following below but I keep getting the following build error: -
An object reference is required for the nonstatic field, method, or property 'DataDynamics.ActiveReports.ActiveReport.Sections'

Have you any ideas how I can fix this. Im at my wits end


private void Detail_Format(object sender, System.EventArgs eArgs)
{
if(((CheckBox)Test.Sections["Detail"].Controls["chcomplaint"]).DataField == "1")
{
((CheckBox)Test.Sections["Detail"].Controls["chcomplaint"]).Checked = true;
}
else
{
((CheckBox)Test.Sections["Detail"].Controls["chcomplaint"]).Checked = false;
}
}
 
I would havethe DataField bound to a textbox that is hidden. Then set the Checkbox based on the value of the checkbox. Something like the following (just typed not tested...)

if (txtcomplaint.text == "1")
{
chcomplaint.Checked = true;
}
else
{
chcomplaint.Checked = false;
}

Hope this helps.

Hope everyone is having a great day!

Thanks - Jennifer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top