Showing posts with label event report writing example. Show all posts
Showing posts with label event report writing example. Show all posts

Sunday, 20 September 2009

Event Report Writing Example

event report writing example"event report writing example"

How to store FastReport.NET report templates in database

Some applications require the storing of report templates in a database. This simplifies template support - all reports are stored in one place, and allows to differentiate the access rights to different templates. I noted only one shortcoming of this technique - slight complication of the code in the client application.
For example, we need to create Access database (mdb) named "reports" and a table for storing our report templates. I named this table "reports_table". Three tables are enough in our data table:
№ Field name Type Description
1 Id counter Auto-increment, index
2 ReportName text Name of report
3 ReportFile BLOB Binary data with template

You can store templates in any other database similar to the one in our example.
To do this:
• open the designer;
• show custom form with a list of templates from our database instead of standard dialog when users open a file in the designer;
• load template in the designer after selecting it in the custom form;
• Save the template in a database where the user saves a file in the designer.
Despite the apparent complexity, the tasks above will be simple because FastReport.NET has special features.
Create a new project in Visual Studio first. Then you need to drag-n-drop "Report" object from toolbox to the empty form. Also drag the " EnvironmentSettings" object (properties of reporting engine).

You can setup many settings of the report and the designer in "environmentSettings1" object. You have to override the event handlers CustomOpenDialog, CustomOpenReport, CustomSaveDialog and CustomSaveReport.
Event handler CustomOpenDialog allows releasing any algorithm of the load report template in the designer - load template from the database field and load it in the designer or set e.Cancel = true; when loading fails.
The problem reduces to showing a dialogue with a list of files from which you want to select the report template from the database and load the template in the designer. Of course, if the user presses the Cancel button in this dialog, we set e.Cancel = true. The loading process is clear but saving code need some details.
The user can choose two ways to save a file - simply by clicking "Save", in this case report should be rewritten to the old place, or the second option - "Save as...", the user is expected to select path of file. Storage location of report templates cannot be changed in our case. You need to save template in the old place (database field) in both ways - capture the CustomSaveDialog event by empty function and save template in database in the CustomSaveReport event.
Now you need to add a new data source to the project - reports.mdb.Drop the button on form for launching of the reports designer.

Write in the Click event handler:
private void button1_Click(object sender, EventArgs e)
{
report1.Design();
}

Create an additional dialog form for template selection:

Assign the buttons OK and Cancel corresponding to DialogResult.
Do not forget to bind your data source to DataGrid - select the field name of the record and make the index field invisible.
You need to save the selected index when you click on the ‘OK' button:
public int reportID;
...
private void OKBtn_Click(object sender, EventArgs e)
{
// save id of report for use in future
reportID = (int)dataGridView1.CurrentRow.Cells[0].Value;
}

We return to our first form. It is time to handle the events of opening and saving a report. We make loading the first thing to do:
// define variable for store of report ID
private int reportID;
// define array byte[] for store of template
private byte[] blob;

....
private void environmentSettings1_CustomOpenDialog(object sender,
FastReport.Design.OpenSaveDialogEventArgs e)
{
using (ReportListForm reportListForm = new ReportListForm())
{
// show dialog for report selection
if (reportListForm.ShowDialog() == DialogResult.OK)
{
// get report ID
reportID = reportListForm.reportID;
// load report in array from BLOB
blob =
(byte[])this.reports_tableTableAdapter.GetDataByID(reportID).Rows[0]["ReportFile"];
// read file name of report for designers title
e.FileName =
(string)this.reports_tableTableAdapter.GetDataByID(reportID).Rows[0]["ReportName"];
}
else
// cancel loading
e.Cancel = true;
}
}

Second handler CustomOpenReport for loading the template in designer should look like this:
private void environmentSettings1_CustomOpenReport(object sender,
FastReport.Design.OpenSaveReportEventArgs e)
{
using (MemoryStream stream = new MemoryStream())
{
// skip all garbage created by MS Access in begin of blob field - we seek the tag of XML
int start = 0;
for (int i = 0; i < blob.Length - 1; i++)
{
if (blob[i] == (byte)'<' && blob[i + 1] == (byte)'?')
{
start = i;
break;
}
}
// copy of blob content in stream
stream.Write(blob, start, blob.Length - start);
stream.Position = 0;
// load template in designer
e.Report.Load(stream);
}
}

We used mdb-database to store report templates. MS Access write special header in begin of BLOB field. We need to skip this header and find begin of xml file (report templates stored in xml).
We turn to the organization and save the template using the designer. As written above, we need to override the event handler CustomSaveDialog by an empty function to prevent a user from unnecessary actions:
private void environmentSettings1_CustomSaveDialog(object sender,
FastReport.Design.OpenSaveDialogEventArgs e)
{
// empty
}

Event handler CustomSaveReport should look like this:
private void environmentSettings1_CustomSaveReport(object sender,
FastReport.Design.OpenSaveReportEventArgs e)
{
// create stream for store of template
using (MemoryStream stream = new MemoryStream())
{
// save template in stream
e.Report.Save(stream);
// copy stream in array
byte[] blob = stream.ToArray();
// save array in BLOB
this.reports_tableTableAdapter.UpdateReport(blob, reportID);
}
}
The methods GetDataByID and UpdateReport are created in the dataset designer- you can see them in the example project.
Compile and run application, then press a button to open the designer:

Click menu item "Open":

Select any report template and press OK.

You can change the report and save the template after that- new template will be stored in database.
Full source code of this example is available in an attached zip archive (databases with reports are included).


About the Author

.Net and Delphi developer. Specialist in Reporting tools and data development.



Fantasy Football, Report Writing, and Weekend Events









event report writing example
event report writing example
event report writing example

Friday, 19 June 2009

Event Report Writing

event report writing"event report writing"

10 Steps to Better Investigation Reports

A critical component of any workplace investigation is the investigation report. Writing investigation reports doesn't have to be daunting. A standardized reporting structure improves the consistency of reports amongst investigators. Standardized reporting provides investigators with a reporting format to follow and reduces the time spent preparing investigation reports. This information is all fine and dandy, however, a question we frequently receive is, what information do I actually need to put in an investigation report?




 Here is our answer to that question:




1. Information to Identify the Case:




Begin the report with case specific information that identifies the case the report is related to. Include information such as the investigator's name, case number, the date the case was entered and the date it was assigned to the investigator.




2. Referral Source:




The next section should include the complainant's information. The complainant's work phone number, e-mail, employee number, office location, department and job title help identify the person lodging the complaint.




3. Allegation Details:




Harassment, discrimination, retaliation -- what type of allegation is under investigation? In this section, be sure to include as much detail as possible about the initial complaint.





  • Identify the type of case.

  • Who the alleged victim is- may or may not be the same person as the complainant.

  • How the complaint was received- hotline, face-to-face, web form, etc.

  • Allegation details- what happened, where, when and any other information provided in the initial complaint.


4. Information About the Subject:




The information required for this section of the report is similar to that of the "Referral Source" section. However, it's the subject's (the accused person's) information being documented this time. Include their name, e-mail, work phone number, office location, department and job title.




5. Investigation Scope/ Purpose:




Include a statement that describes the mission and objectives of the investigation. Answer the question "what is the investigation trying to prove?".




6. Case Notes:




The case notes section should include an overview of the tasks assigned and action taken throughout the investigation. Be sure to include a brief description of the task, steps taken to complete it, who completed the task and when.




7. Interview Summaries:




List the investigation interviews that took place throughout the investigation. Make sure the list is in chronological order, beginning with the first interview, ending with the last. Summary details are short and sweet, outlining:





  • Name of the interviewer- also include the names of any other people who sat in on the interview.

  • Name of the person interviewed and their role in the investigation- complainant, subject, witness.

  • Interview location.

  • Date of interview.


In this section of the report, there's no need to go into detail about the events of the investigation- that's what the next section is for!




8. Interview Reports:




Interview reports are brief summaries of each of the investigation interviews. In addition to the information in the above section, this part elaborates on the investigation interview to include:






  • Credibility Assessment- Certain factors will determine the credibility of an interviewee's statements. We cover the topic of determining credibility in our post "Investigation Interview Questions to Determine Credibility". This section of the report should list any indicators that contribute to the belief that the interviewee is or isn't a credible source.


  • Investigator Notes- Summarize the introduction, incident overview and conclusion of each interview. In the introduction, outline the explanation of the interviewer's role in the investigation, the purpose for the interview, efforts to maintain confidentiality and retaliation protections. The incident overview section should include the interviewee's description of events related to the incident, whether or not they are aware of any witnesses, where/when the incident occurred and any background information linking the involved parties. Notes to be made about the interview conclusion should include thanking the interviewee, reiteration of confidentiality concepts, review of statements made and interviewee singing of investigator notes.


9. List of Evidence:




As simple as it sounds- list the evidence collected during the investigation. For the sake of the investigation report, include information such as:





  •  Type of evidence collected- interview, video, photo, audio tape, e-mail, etc.

  • Name of person who presented the evidence, as well as their role in the investigation.

  • Date the evidence was collected.

  • Location of the evidence.


10. Recommendations:




Conclude the report with recommendations. After reviewing all of the investigation materials, what type of action should be taken? Does evidence support the violation of workplace policies? Make sure recommendations are backed up by the consequences outlined in the company code of conduct or other policies governing employee behaviour in the workplace. Include a plan of action, identifying next steps in taking corrective action.




Reporting With a Case Management System




Case management solutions simplify the investigation reporting process, creating reports with the click of a button. Initially, a report template needs to be developed, outlining the sections of the report. Information from the investigation is pulled from the case file, automatically filling in each of the sections in the report. The report is then ready for export, with the investigator choosing the desired format for the report (PDF, MS Word document, etc.).


About the Author

i-Sight is a case management software platform designed to simplify your process and provide outstanding reports. It's primarily configured to manage customer complaints and corrective actions, or employee relations, HR & ethics investigations. It's also used for a variety of other customized case management solutions. We blog at i-Sight.com, providing advice and tips to HR managers and investigators in regards to managing internal investigations.



Two poems by Catherine Wagner









event report writing
event report writing
event report writing