How to do label printing with extra information?

Stimulsoft Reports.NET discussion
Post Reply
Artimidor
Posts: 38
Joined: Thu Jan 09, 2020 8:15 am

How to do label printing with extra information?

Post by Artimidor »

How would you recommend to approach label printing with information on multiple extra labels? E.g. item information on the standard label, then there could be e.g. information for all in all 3 labels that have to be added after the first as to mention all ingredients.

The question boils down to this: How is it possible to split one huge information block (=content of one field) into three rows of a certain fixed size?
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: How to do label printing with extra information?

Post by Lech Kulikowski »

Hello,

Could you explain your issue in more detail?

> How is it possible to split one huge information block (=content of one field) into three rows of a certain fixed size?

How that information is present in data source?

Thank you.
Artimidor
Posts: 38
Joined: Thu Jan 09, 2020 8:15 am

Re: How to do label printing with extra information?

Post by Artimidor »

It's present in one single field in a table of a data source. See attachment.

Let's say there's one row of data (just one single product) in that data source, and it is used to fill out the basic label (e.g. 2 cms of height). Now if there's information in, say, the AllergyTypes field, this data has to be printed on an extra label. And if the extra label (2 cms) doesn't have enough space, the information should go on a third label (or even more). How could this be accomplished?
Attachments
3.png
3.png (17.87 KiB) Viewed 1367 times
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: How to do label printing with extra information?

Post by Lech Kulikowski »

Hello,

As a way, you can place each column on separate bands - Childband.

Thank you.
Artimidor
Posts: 38
Joined: Thu Jan 09, 2020 8:15 am

Re: How to do label printing with extra information?

Post by Artimidor »

With a Childband it is possible to get something like this (see screenshot), yes. In combination with properties like Word Wrap, Can Break etc. a long text can be split into more than one label, and this covers most of the issue. (The <StiHtmlJs> tags are only visible in the designer, so that's fine.) See attached file for details on how this currently looks like in the code of the report.

However, this approach doesn't allow a customization of the extra labels 2 and 3. The text is just split and then continued on the next label. In the example the product name is shown in the first extra label, but not in the following ones. Is there a way how displaying the name on the other extra labels can be achieved? Also, is there a way to find out the amount of extra labels needed and print the information (like 1/3, 2/3 and 3/3)? That would make things perfect,
Attachments
Report.mrt
(13.29 KiB) Downloaded 81 times
Childband.png
Childband.png (17.07 KiB) Viewed 1314 times
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: How to do label printing with extra information?

Post by Lech Kulikowski »

Hello,

You can split your information on tree records in the data source and use child band for each with different formating. Or use the Substring() function to split your record into several parts.

Thank you.
Artimidor
Posts: 38
Joined: Thu Jan 09, 2020 8:15 am

Re: How to do label printing with extra information?

Post by Artimidor »

Can you show me in an example based on the report I've attached? After all, what use is a Substring function if the length of the field is variable and it is determined upon printing how many extra labels are shown? And how do you make the header work and get it on all labels? An example would be most helpful to get an idea what you're referring to.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to do label printing with extra information?

Post by HighAley »

Hello,

You could add additional Header band to repeat some data.

Please, look at the attached report template.

Thank you.
Attachments
report v2.mrt
(14.04 KiB) Downloaded 91 times
Artimidor
Posts: 38
Joined: Thu Jan 09, 2020 8:15 am

Re: How to do label printing with extra information?

Post by Artimidor »

Ah yes, that does the job, indeed, the way we intend it :)

As I can see the trick is to add another DataBand, which is not assigned, but uses the original data source as Master. Then you can add a HeaderBand to the extra labels.

Many thanks for that valuable hint!
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: How to do label printing with extra information?

Post by Lech Kulikowski »

Hello,

You are welcome.
Post Reply