+1 800 256 3608 (toll-free in North America) or +49 7531 90 60 10| service@combit.com

Print using a list of DataSet


(Guest) #1

Hi,
I’m a new developer using List&Label and I must find a solution for my problem. The design of the application I’m working on is already done and I don’t want to change a lot of things to reach my goal.

I want to know if there is an easy way to print a “list of DataSet”. In the project, we’re using DataSets to send fields to List&Label templates. To print the content of the DataSet, we do the following in C# assuming we are in preview mode:

[code][…]
if (printMode == LlPrintMode.Preview) {
ListLabel listLabel = new ListLabel();
listLabel.Core.LlJobOpen(0);

listLabel.DataSource = dataSet;
listLabel.DataMember = dataSet.Tables[“ReportHeader”].ToString();

listLabel.AutoMasterMode = LlAutoMasterMode.AsVariables;
listLabel.AutoShowSelectFile = false;

[…]

listLabel.LicensingInfo = licenseKey;
listLabel.AutoDesignerFile = fileName;

[…]

listLabel.Print(LlProject.List);

listLabel.Core.LlPrintEnd();
listLabel.Core.LlJobClose();
}
[…][/code]
All DataSets contain a Table ‘ReportHeader’ containing headers information (as current date,…) and one or more children tables containing other data rows.

It’s very straightforward, but for a newbie like me, it is very difficult to adapt such code to preview a list of reports whose data are encapsulated in a list of DataSet.

Have you a main proposition (except the fact that I must read carefully the documentation and study the programmable samples, what I’ll do when I’d have more time…) ?

Thanks


(Guest) #2

Hi all,
The code I’m trying to use was posted here : It doesn’t work for me.

Here’s my method “preview” :

public void preview(PreviewFile pf) 
{
   LL = new ListLabel();
   LL.IncrementalPreview = false;
   LL.Core.LlPreviewDisplay(pf.Filename,"", new IntPtr());
   LL.IncrementalPreview = true;
}

Is there a trick I’m not aware of? I get always the same message : “No preview files found, file is corrupted or empty”. But I can open it with LL Viewer.

For information, I’m using LL14.

Thanks


(Guest) #3

Could it possible, that the preview-file (pf.Filename) ist locked while trying to open it wirh .LlPreviewDisplay()? Be sure, the preview-file ist closed (pf.Close()) to open it.

Please also check the give window-handle, because I think “new IntPtr()” is not valid.

Additionally try to use the debug-mode with debwin to get more information about this action.


(Guest) #4

Thanks for your reply but I found the solution just after posting :slight_smile: and it was actually the files that were not closed.
And for information, “new IntPtr()” seems to work (even if it is not “correct”).