Home Search Sitemap Legal Notice Contact
 

 

List & Label

Programming Examples Printing


.NET

 private void button2_Click(object sender, System.EventArgs e)
{
     try
     {
          // Bind to a DataSet object
          LL.SetDataBinding(myDataSet, "Orders");

          // Set Properties
          LL.AutoDesignerFile  = "subreport.lst";
          LL.AutoProjectType  = LlProject.List;
          LL.AutoDialogTitle  = "Example";
          LL.AutoShowSelectFile = true;
  
          // Start Print
          LL.Print();
     }
     // Catch Exceptions:
    catch (Exception LlException)
    {
           MessageBox.Show("Information: " +
                    LlException.Message,"Information",
                    MessageBox.IconInformation | MessageBox.OK);
    }
}

 


Delphi

{Printing}
procedure TForm1.PrintButtonClick(Sender: TObject);
begin
     //Assign data source
     LL.DataSource := dsCustomers;

     //Pass customer data as fields
     LL.AutoMasterMode := mmAsFields;

     //Set the default project name
     LL.AutoDesignerFile := 'subrep.lst';

     //Switch print mode to preview
     LL.AutoDestination := adPreview;

     //Print
     LL.AutoPrint('Invoice List', '');
end;

 


C++

//=====================================
void CMainFrame::DoLabelPrint()
//=====================================
{
  // Define special fields, regular text field:
  LLDefineFieldExt(job, "Text", "Testtext",LL_TEXT, NULL);

  // Numeric field:
  LLDefineVariableExt(job, "Subtotal", "12.34",
    LL_NUMERIC | LL_NUMERIC, NULL);

  // Barcode field:
  LLDefineVariableExt(job, "BC_EAN_128", "123456789abcd",
    LL_BARCODE_EAN128, NULL);

  // Variable graphic by file name:
  LLDefineVariableExt(job, "Graphic","sunny.bmp", LL_DRAWING, NULL);

  // Start printing:
  LlPrintWithBoxStart(job, LL_PROJECT_LABEL, szFile,
    LL_PRINT_EXPORT, LL_BOXTYPE_BRIDGEMETER, hWnd, "Printing...");
 
  //Print label:  
  nErrorValue = LlPrint(job);

  // End printing:
  LlPrintEnd(job,0);
}


Visual Basic

Private Sub ButtonPrint_Click()

  'Print the project "test.rpt" on the printer:
  Data1.Recordset.MoveFirst
  ListLabel1.Print(0, LL_PROJECT_LIST, "test.lst",_
    True, LL_PRINT_NORMAL,_
    LL_BOXTYPE_NORMALWAIT, hWnd,_
    "Print, True, Environ$("temp"))


End Sub


Private Sub ListLabel1_CmndDefineFields(ByVal nUserData As Long,
  ByVal bDummy As Long, nProgressInPerc As Long, pbLastRec As Long)

  'This event is called by the commands Print and Design.
  'It is called for each record to declare the fields and
  'their contents to List & Label.
  'Repeat for all fields of a 'record:
  For i = 0 To Form1.Data1.Recordset.Fields.Count - 1
    content$ = Data1.Recordset.Fields(i)
    nRet = ListLabel1.LlDefineFieldExt _
      (Data1.Recordset.Fields(i).Name,_
      content$, LL_TEXT)
  Next i
  'Skip to next record:
  Form1.Data1.Recordset.MoveNext
  'Stop printing of last record is reached:
  If Form1.Data1.Recordset.EOF = True Then
    pbLastRec = 1
  End If

End Sub

 

Programming Examples Starting the Designer...

 

 
 
© 2008 combit GmbH. All rights reserved. Please read our Notes on Data Protection. Changes and errors may occur.
 Mr. Wong Del.icio.us Digg Reddit Oneview Linkarena StumbleUpon Spurl Technorati Simpy