Showing posts with label VS2010. Show all posts
Showing posts with label VS2010. Show all posts

Tuesday, July 23, 2013

Dummy data in Crystal Report at runtime

When using Crystal Reports, in Design mode, you preview your report by clicking "Main Report Preview".

To bind the report I use:
crDaily1.SetDataSource((DataTable)dtDaily);
crDaily1.SetParameterValue("pPeriod", title);

If I put this code in
private void FormReportDaily_Shown(object sender, EventArgs e)
sometimes the dummy data that appears in "Main Report Preview" is shown at runtime. I really don't know the reason?!.

Resolution:

Put the binding code
crDaily1.SetDataSource((DataTable)dtDaily);
crDaily1.SetParameterValue("pPeriod", title);

in the constructor:
public FormReportDaily()

Thursday, October 4, 2012

Expando Object

The ExpandoObject class enables you to add and delete members of its instances at run time and also to set and get values of these members.

Creating a dynamic instance:
       dynamic Student = new ExpandoObject();
       Student.ID = 1;
       Student.Name = "John";
Student.Grade = 10;


Creating a nested dynamic instance:
       Student.Addess = new ExpandoObject();
       Student.Addess.City = "London";
       Student.Addess.Country = "UK";
       Student.Addess.StreetNo = 123456;
Dynamically binding an Event
Student.Click += new EventHandler(SampleHandler);
 
private void SampleHandler(object sender, EventArgs e)
{
//throw new NotImplementedException();
}
Pass parameter as dynamic.
public void Write(dynamic Student)
{
//do stuff
}

Friday, March 30, 2012

Can't connect to TFS 2010

I've tried:
  1. Stop Collection / Start Collection
  2. Detach / Attach Collection
  3. IIS Stop, Strat , Reset
  4. Flush DNS
  5. Reinstalled TFS
and nothing worked.

I've checked the port 8080 in windows firewall, and was allowed through the firewall but the rule was set to PUBLIC and the network is PRIVATE. Added "private" to the rule and everything works again.