CMS-1500 Form SDK
Print Data onto CMS-1500 Forms
I don’t have to deal with PDF documents anymore. That’s save us a heap of time.
Quickly create and send CMS-1500 form data to your printers. Purchase a license here.
“You’ve done it once again!
Once again, I like to congratulate you and the team for the CMS1500Form class and allowing it to be extended for the future or custom client purpose”
Main Features
- Just initialize simple fields and call Print()
- Ability to set X and Y offset positions to handle different printer settings
- Ability to modify field height, width, alignment, position and data before data is sent to the printer
- Add Date, Phone, Price and Text form fields
- Create your own custom fields
- Ability to print to named printers
- Integrates with .Net PrintDialog, PageSetupDialog, PrintPreviewDialog
- Removes the need to have any PDF components
Print Form Data
To print data on a CMS-1500 form first initialize the form fields using the CMSFormData class then print them using the CMS1500Form class
Initialize Form Fields
…
Next print it using the CMS1500Form class.
Printing Fields
Note that the printing offsets may need to be slightly adjusted in the sample below. See the Setting Printing Offsets topic in the help files to adjust your printer offsets correctly.
Creating a Custom Form Field
By default, the following fields are available; TextField, PriceField, PhoneField and DateField. Custom fields can be created easily. Just derive from the FormField class and override the GetText() method.
The Code
public class MyCustomField : FormField
{
public MyCustomField(string name)
: base(name)
{
}
public MyCustomField(string name, decimal? data, double x, double y, double width, double height)
: base(name, x, y, width, height)
{
Data = data;
}
public decimal? Data
{
get;
set;
}
public override string GetText()
{
if (Data != null && Data.HasValue)
{
return Data.Value.ToString("F2");
}
return null;
}
}
Dynamically modify data before Printing
Form fields can be modified before being sent to the printer. Field coordinates, width, heights and alignment ( vertical and horizontal ) are modifiable.
The Code
cmsForm.BeforePrint += cmsForm_BeforePrint;
private void cmsForm_BeforePrint(object sender, FormEventArgs e)
{ //e.Cells has all fields that will be send to printer.
//The field properties can be modified
e.Cells[0].X = 12;
e.Cells[0].Y = 13;
e.Cells[1].Width = 3;
e.Cells[1].Height = 0.5;
}
CMS1500Form comes FREE with a license of RDPCrystal EDI Library. However it can be purchased separately in our online store.