Monday, June 4, 2012

Report Maker


Report Form

This post describes a program made for Windows Tablet OS, and used for logging working report, and eventualy quotation requests.

It was made with c# (enviroment VsStudio 2010 ), SQLCompact 3.5, EF4.0, DevExpress Libraries, SOAP Technologies toward Tomcat Server.

I will focus the attention on "User Interface", and what the program does in order to promote also my works.

Login Form
Before login, the user can synchronize data with remote server, configure company infos in order to send auto email or simply visualize the correct address on report. What the synchro does, is to retrieve a technicians list, the jobs list, the client list.

The functions available to the operator who must prepare the confirmation report are displayed in the upper right of the window.

Function Buttons
New: Creates a new report. Clone: duplicates the current report. Save: Saves the data in the current report. Notes: Shows an area for private comments of the technician. Search: Search reports previously saved and retrieves them. Pdf: create the report pdf. Send: sends the report to the remote server.

Report Layout

Sign Form

The .NET platform allows the pendrive managing with a special object, InkPicture, that I have used to intercept the drawing actions on tablet.


 
 using Microsoft.Ink;
  
  
 //Create InkPicture object control 
 private void frmInkSign_Load(object sender, EventArgs e)
 {
  InkPicture moInkPicture = new InkPicture();
  moInkPicture.BackColor = System.Drawing.Color.White;
  moInkPicture.Parent = this;
  moInkPicture.Dock = DockStyle.Fill;
 }

    
 ...
 //retieve image object from InkPicture object control 
 if (moInkPicture.Ink.Strokes.Count > 0) 
 { 
  byte[] sig; 
  sig = moInkPicture.Ink.Save(Microsoft.Ink.PersistenceFormat.Gif, Microsoft.Ink.CompressionMode.Maximum);  
  System.IO.MemoryStream imgToStore = new System.IO.MemoryStream(sig);
  //retrieve image object from object property Ink
  Image imgSrc = Image.FromStream(imgToStore,false); 
  //resize the image in order to maintain it compact
  Image img = Utility.ResizeImage(imgSrc, new Size(w, h)); 
  //convert the image into black and white color palette
  Bitmap bmp = Utility.convertToBitonal((Bitmap)img);
  Sign = bmp;
 }