I work at a ported .NET application, which was ported from VB6 to .NET win forms, and there is used the OCX List and Label library, version 22.
Mainly it is used the ListLabel control, LlViewCtrl(preview control), DesignerFunctions control.
In the .NET ported solution, we converted the OCX stuff, to .NET interop libraries, and works, but we have a problem while printing some documents with QR code, it is not displayed,
so we want to migrate to the .NET library combit ListLabel 22, maybe using the SetDataBinding/DataSource and PreviewControl.
What I see, for print preview of a document, the old code is very tight to the mechanisms of ListLabel OCX, like defining fields, defining variables, and after printing start, and printing…and in between some warm-ups of fields real data, etc.
Do you have some migration hints for old mechanisms to be decoupled to new SetDataBinding/DataSource and Preview control?
Here is a minimal code flow sample, what I’ve could take it from old code:
//define variables
LL.LlDefineVariableExt
//define fields
LL.LlDefineFieldExt
//
LL.LlPrintStart
//
do
{
lngRC = LL.LlPrint();
while (lngRC == (int)ListLabel.LlErrorConstants.LL_WRN_REPEAT_DATA)
{
lngRC = LL.LlPrint();
}
if (mclsFieldEval.SourceData is not null) // <20>
{
do
{
mclsFieldEval.SourceData.MoveBOF();
while (mclsFieldEval.SourceData.MoveNext())
{
LL.LlDefineFieldExt
while (LL.LlPrintFields() == (int)ListLabel.LlErrorConstants.LL_WRN_REPEAT_DATA)
{
lngRC = LL.LlPrint();
if (IsError(lngRC))
{
LL.LlPrintEnd(0)
}
}
}
}
while (condition);
}
}
while(condition);
tmetternich
(combit Support - Thomas Metternich)
2
Normally you should be able to work with the same APIs. However, we recommend switching to data binding. You will then have a whole range of new features at your disposal. Among other things, you will then no longer need to program the print loop yourself. Check how your data source can be transferred:
You may also be able to use a data provider directly:
If you want to use your existing reports, you may have to adapt the field names here. However, this can also be done using code with the DOM API:
Thanks for the quick answer, I tried to use the DOM API from the .NET assemly, combit ListLabel 22, but at some point when try to run the print stuff for print preview, seems that I get some exceptions related to not DataSource assign, or no DataProvider available.
I don’t know if the mixture between DOM API and the ListLabel and Preview control is a good approach!?
I see that the application uses reports of *.IFV, is this some custom extension, that they use or is some old List and Label extension?
Hi Viorel-Petru,
If you get an exception to the data source in the DOM, this usually has to do with the IgnoreErrors parameter in project.Open(…), even if you open the project in the DOM you need a data source if the parameter is not set to “true”, which in turn would cause other problems.
In the LL you can assign an extension as you like for the respective project types, if you open the file in a text editor you can see what it is (LIST, CARD or Label)