Dear all,
We are going to make the label report in Avery 5160 Format and export to be PDF. Is there any sample code for us to investigate?? Can document exporter handle this easily??
Hi,
rchiu5hk said:In IGridCell cell = row.AddCell(), How can I know whether it is added in column j??
I'm afraid I do not understand your question.
rchiu5hk said:Moreover, if I have only 10 rows per page, How to make separate page??
section.AddPageBreak();
Dear Mike,
In IGridCell cell = row.AddCell(), How can I know whether it is added in column j?? Moreover, if I have only 10 rows per page, How to make separate page??
I have below specification:
PAGEHEIGHT: 792,
PAGEWIDTH: 612,
LEFTMARGIN: 8,
TOPMARGIN: 20,
VERTICALPITCH: 76,
HORIZONTALPITCH: 205,
LABELHEIGHT: 72,
LABELWIDTH: 205,
NUMBERACROSS: 3,
NUMBERDOWN: 10,
FONTNAME: Courier,
FONTSIZE: 9
No, I don't think there are any samples of printing labels. I could be wrong, though. You can check out the samples installed with NetAdvantage just to be sure.
I don't think you can use an ITable here, since the ITable has no columns. You probably need to use an IGrid, instead. If you know the paper size and the measurement of the labels, then you should be able to do what you need using a little bit of trial and error to determine the exact spacing.
Creating a grid with three columns is pretty straightforward. Here's some quick sample code to get you started that creates a grid with three equal columns and places some horizontally centered text in each cell. You'll have to figure out the row heights and the spacing between rows to make everything fit.
Report report = new Report(); ISection section = report.AddSection(); IGrid grid = section.AddGrid(); IGridColumn column0 = grid.AddColumn(); column0.Width = new RelativeWidth(0.333333F); IGridColumn column1 = grid.AddColumn(); column1.Width = new RelativeWidth(0.333333F); IGridColumn column2 = grid.AddColumn(); column2.Width = new RelativeWidth(0.333333F); for (int i = 0; i < 200; i++) { IGridRow row = grid.AddRow(); for (int j = 0; j < 3; j++) { IGridCell cell = row.AddCell(); IText text = cell.AddText(); text.Alignment = TextAlignment.Center; text.AddContent(string.Format("This is row {0}, column {1}", i.ToString(), j.ToString())); } } string filename = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "x.pdf"); report.Publish(filename, FileFormat.PDF); Process.Start(filename);
I am planning to use Infragistics.Documents.Report.Table.ITable.
Do you have any full sample If I want to have 3 columns in A4 paper??
I'm not familiar with Avery 5160 Format, but I Googled it, and it looks like it's for label printing.
There's certainly nothing in the WinGridDocumentExporter that can handle this. You might be able to achieve something using the Documents assembly and trying to format the exported data yourself, but there's no built-in support for laying out the data for label printing.